var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(k,d,n){if(k==Array.prototype||k==Object.prototype)return k;k[d]=n.value;return k};
$jscomp.getGlobal=function(k){k=["object"==typeof globalThis&&globalThis,k,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var d=0;d<k.length;++d){var n=k[d];if(n&&n.Math==Math)return n}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(k,d){var n=$jscomp.propertyToPolyfillSymbol[d];if(null==n)return k[d];n=k[n];return void 0!==n?n:k[d]};$jscomp.polyfill=function(k,d,n,h){d&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(k,d,n,h):$jscomp.polyfillUnisolated(k,d,n,h))};
$jscomp.polyfillUnisolated=function(k,d,n,h){n=$jscomp.global;k=k.split(".");for(h=0;h<k.length-1;h++){var f=k[h];if(!(f in n))return;n=n[f]}k=k[k.length-1];h=n[k];d=d(h);d!=h&&null!=d&&$jscomp.defineProperty(n,k,{configurable:!0,writable:!0,value:d})};
$jscomp.polyfillIsolated=function(k,d,n,h){var f=k.split(".");k=1===f.length;h=f[0];h=!k&&h in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var l=0;l<f.length-1;l++){var m=f[l];if(!(m in h))return;h=h[m]}f=f[f.length-1];n=$jscomp.IS_SYMBOL_NATIVE&&"es6"===n?h[f]:null;d=d(n);null!=d&&(k?$jscomp.defineProperty($jscomp.polyfills,f,{configurable:!0,writable:!0,value:d}):d!==n&&(void 0===$jscomp.propertyToPolyfillSymbol[f]&&($jscomp.propertyToPolyfillSymbol[f]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(f):
$jscomp.POLYFILL_PREFIX+f),$jscomp.defineProperty(h,$jscomp.propertyToPolyfillSymbol[f],{configurable:!0,writable:!0,value:d})))};$jscomp.underscoreProtoCanBeSet=function(){var k={a:!0},d={};try{return d.__proto__=k,d.a}catch(n){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(k,d){k.__proto__=d;if(k.__proto__!==d)throw new TypeError(k+" is not extensible");return k}:null;
$jscomp.polyfill("Object.setPrototypeOf",function(k){return k||$jscomp.setPrototypeOf},"es6","es5");$jscomp.arrayIteratorImpl=function(k){var d=0;return function(){return d<k.length?{done:!1,value:k[d++]}:{done:!0}}};$jscomp.arrayIterator=function(k){return{next:$jscomp.arrayIteratorImpl(k)}};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(k){if(k)return k;var d=function(f,l){this.$jscomp$symbol$id_=f;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:l})};d.prototype.toString=function(){return this.$jscomp$symbol$id_};var n=0,h=function(f){if(this instanceof h)throw new TypeError("Symbol is not a constructor");return new d("jscomp_symbol_"+(f||"")+"_"+n++,f)};return h},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(k){if(k)return k;k=Symbol("Symbol.iterator");for(var d="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<d.length;n++){var h=$jscomp.global[d[n]];"function"===typeof h&&"function"!=typeof h.prototype[k]&&$jscomp.defineProperty(h.prototype,k,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return k},"es6",
"es3");$jscomp.iteratorPrototype=function(k){k={next:k};k[Symbol.iterator]=function(){return this};return k};$jscomp.iteratorFromArray=function(k,d){k instanceof String&&(k+="");var n=0,h=!1,f={next:function(){if(!h&&n<k.length){var l=n++;return{value:d(l,k[l]),done:!1}}h=!0;return{done:!0,value:void 0}}};f[Symbol.iterator]=function(){return f};return f};$jscomp.polyfill("Array.prototype.keys",function(k){return k?k:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6","es3");
var __extends=this&&this.__extends||function(){var k=function(d,n){k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var l in f)Object.prototype.hasOwnProperty.call(f,l)&&(h[l]=f[l])};return k(d,n)};return function(d,n){function h(){this.constructor=d}k(d,n);d.prototype=null===n?Object.create(n):(h.prototype=n.prototype,new h)}}(),Exitgames;
(function(k){(function(d){var n=function(){function h(f,l){void 0===f&&(f="");void 0===l&&(l=h.Level.INFO);this.prefix=f;this.level=l}h.prototype.setPrefix=function(f){this.prefix=f};h.prototype.getPrefix=function(){return this.prefix};h.prototype.setLevel=function(f){f=Math.max(f,h.Level.DEBUG);this.level=f=Math.min(f,h.Level.OFF)};h.setExceptionHandler=function(f){this.exceptionHandler=f};h.prototype.isLevelEnabled=function(f){return f>=this.level};h.prototype.getLevel=function(){return this.level};
h.prototype.debug=function(f){for(var l=[],m=1;m<arguments.length;m++)l[m-1]=arguments[m];this.log(h.Level.DEBUG,f,l)};h.prototype.info=function(f){for(var l=[],m=1;m<arguments.length;m++)l[m-1]=arguments[m];this.log(h.Level.INFO,f,l)};h.prototype.warn=function(f){for(var l=[],m=1;m<arguments.length;m++)l[m-1]=arguments[m];this.log(h.Level.WARN,f,l)};h.prototype.error=function(f){for(var l=[],m=1;m<arguments.length;m++)l[m-1]=arguments[m];this.log(h.Level.ERROR,f,l)};h.prototype.exception=function(f,
l){for(var m=[],q=2;q<arguments.length;q++)m[q-2]=arguments[q];if(!h.exceptionHandler||!h.exceptionHandler(f,this.format0(l,m)))throw Error(this.format0("["+f+"] "+l,m));};h.prototype.format=function(f){for(var l=[],m=1;m<arguments.length;m++)l[m-1]=arguments[m];return this.format0(f,l)};h.prototype.formatArr=function(f,l){return this.format0(f,l)};h.prototype.log=function(f,l,m){if(f>=this.level&&"undefined"!==typeof console&&void 0!==l)try{var q;(q=console.hasOwnProperty(h.log_types[f])?console[h.log_types[f]]:
console.log)&&q.apply(console,[this.prefix,l].concat(m))}catch(r){}};h.prototype.format0=function(f,l){return(""==this.prefix?"":this.prefix+" ")+f+" "+l.map(function(m){if(void 0!==m)switch(typeof m){case "object":try{return JSON.stringify(m)}catch(q){return m.toString()+"("+q+")"}default:return m.toString()}}).join(" ")};h.Level={DEBUG:1,INFO:2,WARN:3,ERROR:4,OFF:6};h.log_types=["debug","debug","info","warn","error"];return h}();d.Logger=n;n=function(){function h(){}h.isArray=function(f){return"[object Array]"===
Object.prototype.toString.call(f)};h.getPropertyOrElse=function(f,l,m){return f.hasOwnProperty(l)?f[l]:m};return h}();d.Util=n})(k.Common||(k.Common={}))})(Exitgames||(Exitgames={}));var Photon;
(function(k){var d;(function(h){h[h.Ws=0]="Ws";h[h.Wss=1]="Wss"})(d=k.ConnectionProtocol||(k.ConnectionProtocol={}));(function(h){h[h.None=0]="None";h[h.Byte=1]="Byte";h[h.Short=2]="Short";h[h.Int=3]="Int";h[h.Long=4]="Long";h[h.Float=5]="Float";h[h.Double=6]="Double";h[h.String=7]="String";h[h.Bool=8]="Bool";h[h.Table=9]="Table";h[h.Dict=10]="Dict";h[h.Object=11]="Object"})(k.TypeExtType||(k.TypeExtType={}));var n=function(){function h(){}h.Is=function(f){return!1};h.Byte=function(f){return f};h.Short=
function(f){return f};h.Int=function(f){return f};h.Long=function(f){return f};h.Float=function(f){return f};h.Double=function(f){return f};h.String=function(f){return f};h.Bool=function(f){return f};h.Dict=function(f,l,m){return m};h.TableTypedKeys=function(){return{}};h.DictTypedKeys=function(f,l){return{}};h.PutTypedKey=function(f,l,m){f[l]=m};return h}();k.TypeExt=n;n=function(){function h(f,l,m,q){void 0===m&&(m="");void 0===q&&(q="");this.protocol=f;this.address=l;this.subprotocol=m;this.keepAliveTimeoutMs=
3E3;this._frame="~m~";this._isClosing=this._isConnected=this._isConnecting=!1;this._peerStatusListeners={};this._eventListeners={};this._responseListeners={};this.lastRtt=0;this.initTimestamp=Date.now();this.keepAliveTimer=0;this.url=this.addProtocolPrefix(this.address,this.protocol);this._logger=new Exitgames.Common.Logger(q&&""!=q?q+":":"")}h.prototype.addProtocolPrefix=function(f,l){var m={ws:"ws://",wss:"wss://"},q;for(q in m)if(0==f.indexOf(m[q]))return f;switch(l){case d.Ws:return m.ws+f;case d.Wss:return m.wss+
f;default:return m.ws+f}};h.prototype.Destroy=function(){};h.prototype.isConnecting=function(){return this._isConnecting};h.prototype.getLastRtt=function(){return this.lastRtt};h.prototype.isConnected=function(){return this._isConnected};h.prototype.isClosing=function(){return this._isClosing};h.prototype.connect=function(f){var l=this;this._sessionid=void 0;f=this.url+"/"+f+"?libversion=4.1.0.0";this._socket=""==this.subprotocol?new WebSocket(f,"Json"):new WebSocket(f,this.subprotocol);this._onConnecting();
this._socket.onopen=function(m){};this._socket.onmessage=function(m){m=l._decode(m.data);l._onMessage(m.toString())};this._socket.onclose=function(m){l._logger.debug("onclose: wasClean =",m.wasClean,", code=",m.code,", reason =",m.reason);l._isConnecting?l._onConnectFailed(m):(1006==m.code&&l._onTimeout(),l._onDisconnect())};this._socket.onerror=function(m){l._onError(m)}};h.prototype.disconnect=function(){this._isClosing=!0;this._socket&&this._socket.close()};h.prototype.sendOperation=function(f,
l,m,q){f={req:f,vals:[]};Exitgames.Common.Util.isArray(l)?f.vals=l:void 0===l?f.vals=[]:this._logger.exception(201,"PhotonPeer[sendOperation] - Trying to send non array data:",l);this._send(f);this._logger.debug("PhotonPeer[sendOperation] - Sending request:",f)};h.prototype.addPeerStatusListener=function(f,l){this._addListener(this._peerStatusListeners,f,l)};h.prototype.addEventListener=function(f,l){this._addListener(this._eventListeners,f.toString(),l)};h.prototype.addResponseListener=function(f,
l){this._addListener(this._responseListeners,f.toString(),l)};h.prototype.removePeerStatusListener=function(f,l){this._removeListener(this._peerStatusListeners,f,l)};h.prototype.removeEventListener=function(f,l){this._removeListener(this._eventListeners,f.toString(),l)};h.prototype.removeResponseListener=function(f,l){this._removeListener(this._responseListeners,f.toString(),l)};h.prototype.removePeerStatusListenersForCode=function(f){this._removeListenersForCode(this._peerStatusListeners,f)};h.prototype.removeEventListenersForCode=
function(f){this._removeListenersForCode(this._eventListeners,f.toString())};h.prototype.removeResponseListenersForCode=function(f){this._removeListenersForCode(this._responseListeners,f.toString())};h.prototype.setLogLevel=function(f){this._logger.setLevel(f)};h.prototype.onUnhandledEvent=function(f,l){this._logger.warn("PhotonPeer: No handler for event",f,"registered.")};h.prototype.onUnhandledResponse=function(f,l){this._logger.warn("PhotonPeer: No handler for response",f,"registered.")};h.prototype._dispatchEvent=
function(f,l){if(!this._dispatch(this._eventListeners,f.toString(),l,"event"))this.onUnhandledEvent(f,l)};h.prototype._dispatchResponse=function(f,l){if(!this._dispatch(this._responseListeners,f.toString(),l,"response"))this.onUnhandledResponse(f,l)};h.prototype._stringify=function(f){return"[object Object]"==Object.prototype.toString.call(f)?(JSON||this._logger.exception(202,"PhotonPeer[_stringify] - Trying to encode as JSON, but JSON.stringify is missing."),"~j~"+JSON.stringify(f)):String(f)};h.prototype._encode=
function(f){var l="";f=Exitgames.Common.Util.isArray(f)?f:[f];for(var m=0,q=f.length;m<q;m++){var r=null===f[m]||void 0===f[m]?"":this._stringify(f[m]);l+=this._frame+r.length+this._frame+r}return l};h.prototype._decode=function(f){var l=[];var m=f;-1!==f.indexOf("\x00")&&(m=f.replace(/[\0]/g,""));f=m;do{if(f.substr(0,3)!==this._frame)break;f=f.substr(3);m="";for(var q=0,r=f.length;q<r;q++){var t=Number(f.substr(q,1));if(f.substr(q,1)==t)m+=t;else{f=f.substr(m.length+this._frame.length);m=Number(m);
break}}l.push(f.substr(0,m));f=f.substr(m)}while(""!==f);return l};h.prototype._onMessage=function(f){"~j~"==f.substr(0,3)?this._onMessageReceived(JSON.parse(f.substr(3))):this._sessionid?this._onMessageReceived(f):(this._sessionid=f,this._onConnect())};h.prototype.resetKeepAlive=function(){var f=this;clearTimeout(this.keepAliveTimer);1E3<=this.keepAliveTimeoutMs&&(this.keepAliveTimer=setTimeout(function(){var l;f._send((l={},l.irq=1,l.vals=[1,Date.now()-f.initTimestamp],l),!0)},this.keepAliveTimeoutMs))};
h.prototype._send=function(f,l){void 0===l&&(l=!1);var m=this._encode(f);this._socket&&this._isConnected&&!this._isClosing?(this.resetKeepAlive(),this._socket.send(m)):l||this._logger.exception(203,"PhotonPeer[_send] - Operation",f.req,'- failed, "isConnected" is',this._isConnected,', "isClosing" is',this._isClosing,"!")};h.prototype._onMessageReceived=function(f){if("object"===typeof f)if(this._logger.debug("PhotonPeer[_onMessageReceived] - Socket received message:",f),f={err:f.err,msg:f.msg,vals:f.vals,
res:f.res,evt:f.evt,irs:f.irs},f.vals=void 0!==f.vals?f.vals:[],0<f.vals.length&&(f.vals=this._parseMessageValuesArrayToJSON(f.vals)),void 0!==f.res){var l=parseInt(f.res);this._parseResponse(l,f)}else void 0!==f.evt?(l=parseInt(f.evt),this._parseEvent(l,f)):void 0!==f.irs?(l=parseInt(f.irs),this._parseInternalResponse(l,f)):this._logger.exception(204,"PhotonPeer[_onMessageReceived] - Received undefined message type:",f)};h.prototype._parseMessageValuesArrayToJSON=function(f){var l={};if(Exitgames.Common.Util.isArray(f))if(0==
f.length%2)for(var m,q;0<f.length;)m=f.shift()+"",q=f.shift(),l[m]=q;else this._logger.exception(205,"PhotonPeer[_parseMessageValuesToJSON] - Received invalid values array:",f);return l};h.prototype._parseEvent=function(f,l){this._dispatchEvent(f,{vals:l.vals})};h.prototype._parseResponse=function(f,l){this._dispatchResponse(f,{errCode:l.err,errMsg:l.msg,vals:l.vals})};h.prototype._parseInternalResponse=function(f,l){this.lastRtt=Date.now()-this.initTimestamp-l.vals[1];this._logger.debug("internal response:",
l)};h.prototype._onConnecting=function(){this._logger.debug("PhotonPeer[_onConnecting] - Starts connecting",this.url,'..., raising "connecting" event ...');this._isConnecting=!0;this._dispatchPeerStatus(h.StatusCodes.connecting);this.resetKeepAlive()};h.prototype._onConnect=function(){this._logger.debug('PhotonPeer[_onConnect] - Connected successfully! Raising "connect" event ...');this._isConnecting=!1;this._isConnected=!0;this._dispatchPeerStatus(h.StatusCodes.connect);this.resetKeepAlive()};h.prototype._onConnectFailed=
function(f){this._logger.error("PhotonPeer[_onConnectFailed] - Socket connection could not be created:",this.url,this.subprotocol,'Wrong host or port?\n Raising "connectFailed event ...');this._isConnecting=this._isConnected=!1;this._dispatchPeerStatus(h.StatusCodes.connectFailed)};h.prototype._onDisconnect=function(){var f=this._isConnected,l=this._isClosing;this._logger.debug('PhotonPeer[_onDisconnect] - Socket closed, raising "disconnect" event ...');this._isClosing=this._isConnected=this._isConnecting=
!1;f&&(l?this._dispatchPeerStatus(h.StatusCodes.disconnect):this._dispatchPeerStatus(h.StatusCodes.connectClosed))};h.prototype._onTimeout=function(){this._logger.debug('PhotonPeer[_onTimeout] - Client timed out! Raising "timeout" event ...');this._dispatchPeerStatus(h.StatusCodes.timeout)};h.prototype._onError=function(f){this._logger.error("PhotonPeer[_onError] - Connection error:",f);this._isConnecting=this._isConnected=this._isClosing=!1;this._dispatchPeerStatus(h.StatusCodes.error)};h.prototype._addListener=
function(f,l,m){l in f||(f[l]=[]);m&&"function"===typeof m?(this._logger.debug("PhotonPeer[_addListener] - Adding listener for event",l),f[l].push(m)):this._logger.error("PhotonPeer[_addListener] - Listener",l,"is not a function but of type",typeof m,". No listener added!");return this};h.prototype._dispatch=function(f,l,m,q){if(l in f){f=f[l];l=0;for(q=f.length;l<q;l++)Exitgames.Common.Util.isArray(m)||(m=[m]),f[l].apply(this,void 0===m?[]:m);return!0}return!1};h.prototype._dispatchPeerStatus=function(f){this._dispatch(this._peerStatusListeners,
f,void 0,"peerStatus")||this._logger.warn("PhotonPeer[_dispatchPeerStatus] - No handler for ",f,"registered.")};h.prototype._removeListener=function(f,l,m){if(l in f){var q=f[l].length;f[l]=f[l].filter(function(r){return r!=m});this._logger.debug("PhotonPeer[_removeListener] - Removing listener for event",l,"removed:",q-f[l].length)}return this};h.prototype._removeListenersForCode=function(f,l){this._logger.debug("PhotonPeer[_removeListenersForCode] - Removing all listeners for event",l);l in f&&
(f[l]=[]);return this};h.StatusCodes={connecting:"connecting",connect:"connect",connectFailed:"connectFailed",disconnect:"disconnect",connectClosed:"connectClosed",error:"error",timeout:"timeout"};return h}();k.PhotonPeer=n})(Photon||(Photon={}));
(function(k){(function(d){var n,h=function(){function e(a,b,c){this.name=a;this.actorNr=b;this.isLocal=c;this.userId="";this.customProperties={};this.suspended=!1}e.prototype.getRoom=function(){return this.loadBalancingClient?this.loadBalancingClient.myRoom():null};e.prototype.raiseEvent=function(a,b,c){this.loadBalancingClient&&this.loadBalancingClient.raiseEvent(a,b,c)};e.prototype.setProp=function(a,b,c){void 0===c&&(c=void 0);if(this.loadBalancingClient&&this.loadBalancingClient.isJoinedToRoom()){var g=
{};g[a]=b;b={};b[a]=c;this.loadBalancingClient._setPropertiesOfActor(this.actorNr,g,!1,b);return void 0==c}return!0};e.prototype.setName=function(a){this.name!=a&&(this.name=a,this.setProp(d.Constants.ActorProperties.PlayerName,a))};e.prototype.onPropertiesChange=function(a,b){};e.prototype.getCustomProperty=function(a){return this.customProperties[a]};e.prototype.getCustomPropertyOrElse=function(a,b){return Exitgames.Common.Util.getPropertyOrElse(this.customProperties,a,b)};e.prototype.setCustomProperty=
function(a,b,c,g){var p;void 0===c&&(c=!1);this.customProperties[a]=b;var u={};u[a]=b;var w;void 0!=g&&(w=(p={},p[a]=g,p));this.loadBalancingClient&&this.loadBalancingClient.isJoinedToRoom()&&this.loadBalancingClient._setPropertiesOfActor(this.actorNr,u,c,w);this.onPropertiesChange(u,!0)};e.prototype.setCustomProperties=function(a,b,c){void 0===b&&(b=!1);var g={},p;for(p in a)this.customProperties[p]=a[p],g[p]=a[p];this.loadBalancingClient&&this.loadBalancingClient.isJoinedToRoom()&&this.loadBalancingClient._setPropertiesOfActor(this.actorNr,
g,b,c);this.onPropertiesChange(g,!0)};e.prototype.isSuspended=function(){return this.suspended};e.prototype._getAllProperties=function(){var a={};a[d.Constants.ActorProperties.PlayerName]=this.name;for(var b in this.customProperties)a[b]=this.customProperties[b];return a};e.prototype._setLBC=function(a){this.loadBalancingClient=a};e.prototype.getCustomProperties=function(){var a={},b;for(b in this.customProperties)a[b]=this.customProperties[b];return a};e.prototype._updateFromResponse=function(a){this.actorNr=
a[d.Constants.ParameterCode.ActorNr];a=a[d.Constants.ParameterCode.PlayerProperties];if(void 0!==a){var b=a[d.Constants.ActorProperties.PlayerName];void 0!==b&&(this.name=b);b=a[d.Constants.ActorProperties.UserId];void 0!==b&&(this.userId=b);this._updateFromProps(a)}};e.prototype._updateMyActorFromResponse=function(a){this.actorNr=a[d.Constants.ParameterCode.ActorNr]};e.prototype.updateIfExists=function(a,b,c){return c.hasOwnProperty(b)?c[b]:a};e.prototype._updateFromProps=function(a){if(a){this.name=
this.updateIfExists(this.name,d.Constants.ActorProperties.PlayerName,a);var b={},c;for(c in a)parseInt(c).toString()!=c&&this.customProperties[c]!==a[c]&&(this.customProperties[c]=a[c],b[c]=a[c]);this.onPropertiesChange(b,!1)}};e.prototype._setSuspended=function(a){this.suspended=a};e._getActorNrFromResponse=function(a){return a[d.Constants.ParameterCode.ActorNr]};return e}();d.Actor=h;var f=function(){function e(a){this.address=this.name="";this.maxPlayers=0;this.isOpen=this.isVisible=!0;this.suspendedPlayerLiveTime=
this.emptyRoomLiveTime=this.playerCount=0;this.expectedUsers=[];this.plugins=[];this.cleanupCacheOnLeave=this.removed=!1;this.masterClientId=0;this._customProperties={};this._propsListedInLobby=[];this.name=a}e.prototype.getCustomProperties=function(){var a={},b;for(b in this._customProperties)a[b]=this._customProperties[b];return a};e.prototype.getPropsListedInLobby=function(){var a=[],b;for(b in this._propsListedInLobby)a[b]=this._propsListedInLobby[b];return a};e.prototype.onPropertiesChange=function(a,
b){};e.prototype.getCustomProperty=function(a){return this._customProperties[a]};e.prototype.getCustomPropertyOrElse=function(a,b){return Exitgames.Common.Util.getPropertyOrElse(this._customProperties,a,b)};e.prototype._updateFromMasterResponse=function(a){this.address=a[d.Constants.ParameterCode.Address];if(a=a[d.Constants.ParameterCode.RoomName])this.name=a};e.prototype._updateFromProps=function(a){if(a){this.maxPlayers=this.updateIfExists(this.maxPlayers,d.Constants.GameProperties.MaxPlayers,a);
this.isVisible=this.updateIfExists(this.isVisible,d.Constants.GameProperties.IsVisible,a);this.isOpen=this.updateIfExists(this.isOpen,d.Constants.GameProperties.IsOpen,a);this.playerCount=this.updateIfExists(this.playerCount,d.Constants.GameProperties.PlayerCount,a);this.removed=this.updateIfExists(this.removed,d.Constants.GameProperties.Removed,a);this._propsListedInLobby=this.updateIfExists(this._propsListedInLobby,d.Constants.GameProperties.PropsListedInLobby,a);this.cleanupCacheOnLeave=this.updateIfExists(this.cleanupCacheOnLeave,
d.Constants.GameProperties.CleanupCacheOnLeave,a);this.masterClientId=this.updateIfExists(this.masterClientId,d.Constants.GameProperties.MasterClientId,a);this.emptyRoomLiveTime=this.updateIfExists(this.emptyRoomLiveTime,d.Constants.GameProperties.EmptyRoomTtl,a);this.suspendedPlayerLiveTime=this.updateIfExists(this.suspendedPlayerLiveTime,d.Constants.GameProperties.PlayerTtl,a);this.expectedUsers=this.updateIfExists(this.suspendedPlayerLiveTime,d.Constants.GameProperties.ExpectedUsers,a);var b={},
c;for(c in a)parseInt(c).toString()!=c&&this._customProperties[c]!==a[c]&&(this._customProperties[c]=a[c],b[c]=a[c]);this.onPropertiesChange(b,!1)}};e.prototype._updateFromEvent=function(a){a&&(this.masterClientId=this.updateIfExists(this.masterClientId,d.Constants.ParameterCode.MasterClientId,a))};e.prototype.updateIfExists=function(a,b,c){return c.hasOwnProperty(b)?c[b]:a};return e}();d.RoomInfo=f;var l=function(e){function a(b){return e.call(this,b)||this}__extends(a,e);a.prototype.setCustomProperty=
function(b,c,g,p){var u;void 0===g&&(g=!1);this._customProperties[b]=c;var w={};w[b]=c;var v;void 0!=p&&(v=(u={},u[b]=p,u));this.loadBalancingClient&&this.loadBalancingClient.isJoinedToRoom()&&this.loadBalancingClient._setPropertiesOfRoom(w,g,v);this.onPropertiesChange(w,!0)};a.prototype.setCustomProperties=function(b,c,g){void 0===c&&(c=!1);var p={},u;for(u in b)this._customProperties[u]=b[u],p[u]=b[u];this.loadBalancingClient&&this.loadBalancingClient.isJoinedToRoom()&&this.loadBalancingClient._setPropertiesOfRoom(p,
c,g);this.onPropertiesChange(p,!0)};a.prototype.setProp=function(b,c,g){void 0===g&&(g=void 0);if(this.loadBalancingClient&&this.loadBalancingClient.isJoinedToRoom()){var p={};p[b]=c;c={};c[b]=g;this.loadBalancingClient._setPropertiesOfRoom(p,!1,c);return void 0==g}return!0};a.prototype.setIsVisible=function(b){this.isVisible!=b&&(this.isVisible=b,this.setProp(d.Constants.GameProperties.IsVisible,b))};a.prototype.setIsOpen=function(b){this.isOpen!=b&&(this.isOpen=b,this.setProp(d.Constants.GameProperties.IsOpen,
b))};a.prototype.setMaxPlayers=function(b){this.maxPlayers!=b&&(this.maxPlayers=b,this.setProp(d.Constants.GameProperties.MaxPlayers,b))};a.prototype.setEmptyRoomLiveTime=function(b){this.emptyRoomLiveTime!=b&&(this.emptyRoomLiveTime=b,this.setProp(d.Constants.GameProperties.EmptyRoomTtl,b))};a.prototype.setSuspendedPlayerLiveTime=function(b){this.suspendedPlayerLiveTime!=b&&(this.suspendedPlayerLiveTime=b,this.setProp(d.Constants.GameProperties.PlayerTtl,b))};a.prototype.setPlugins=function(b){this.plugins=
b};a.prototype.setPropsListedInLobby=function(b){this._propsListedInLobby=b};a.prototype.setExpectedUsers=function(b){this.setProp(d.Constants.GameProperties.ExpectedUsers,b,this.expectedUsers)&&(this.expectedUsers=b)};a.prototype.clearExpectedUsers=function(){var b=[];this.setProp(d.Constants.GameProperties.ExpectedUsers,b,this.expectedUsers)&&(this.expectedUsers=b)};a.prototype.setMasterClient=function(b){this.setProp(d.Constants.GameProperties.MasterClientId,b)};a.prototype._setLBC=function(b){this.loadBalancingClient=
b};return a}(f);d.Room=l;var m=function(){function e(a,b,c){this.appId=b;this.appVersion=c;this.connectionProtocol=0;this.nameServerAddress=this.masterServerAddress="";this.gamePeerWaitingForDisconnect=!1;this.autoJoinLobby=!0;this.connectOptions={};this.createRoomOptions={};this.joinRoomOptions={};this.roomInfos=[];this.roomInfosDict={};this.actors={};this.actorsArray=[];this.lowestActorId=0;this.userId="";this.userAuthType=d.Constants.CustomAuthenticationType.None;this.userAuthData=this.userAuthParameters=
"";this.findFriendsRequestList=[];this.lobbyStatsRequestList=[];this.state=e.State.Uninitialized;this.logger=new Exitgames.Common.Logger("Client:");this.validNextState={};if("number"==typeof a)switch(this.connectionProtocol=a,a){case k.ConnectionProtocol.Ws:this.masterServerAddress="ws://app-eu.exitgamescloud.com:9090";this.nameServerAddress="ws://ns.exitgames.com:9093";break;case k.ConnectionProtocol.Wss:this.masterServerAddress="wss://app-eu.exitgamescloud.com:19090";this.nameServerAddress="wss://ns.exitgames.com:19093";
break;default:this.nameServerAddress=this.masterServerAddress="wrong_protocol_error",this.logger.error("Wrong protocol: ",a)}else"string"==typeof a?(this.connectionProtocol=k.ConnectionProtocol.Ws,this.nameServerAddress=this.masterServerAddress=a):(this.connectionProtocol=k.ConnectionProtocol.Ws,this.nameServerAddress=this.masterServerAddress="wrong_protocol_type_error",this.logger.error("Wrong protocol type: ",typeof a));this.initValidNextState();this.currentRoom=this.roomFactoryInternal("");this._myActor=
this.actorFactoryInternal("",-1,!0);this.addActor(this._myActor)}e.prototype.onStateChange=function(a){};e.prototype.onError=function(a,b){};e.prototype.onOperationResponse=function(a,b,c,g){};e.prototype.onEvent=function(a,b,c){};e.prototype.onRoomList=function(a){};e.prototype.onRoomListUpdate=function(a,b,c,g){};e.prototype.onMyRoomPropertiesChange=function(){};e.prototype.onActorPropertiesChange=function(a){};e.prototype.onJoinRoom=function(a){};e.prototype.onActorJoin=function(a){};e.prototype.onActorLeave=
function(a,b){};e.prototype.onActorSuspend=function(a){};e.prototype.onFindFriendsResult=function(a,b,c){};e.prototype.onLobbyStats=function(a,b,c){};e.prototype.onAppStats=function(a,b,c){};e.prototype.onGetRegionsResult=function(a,b,c){};e.prototype.onWebRpcResult=function(a,b,c,g,p){};e.prototype.roomFactory=function(a){return new l(a)};e.prototype.actorFactory=function(a,b,c){return new h(a,b,c)};e.prototype.myActor=function(){return this._myActor};e.prototype.myRoom=function(){return this.currentRoom};
e.prototype.myRoomActors=function(){return this.actors};e.prototype.myRoomActorCount=function(){return this.actorsArray.length};e.prototype.myRoomActorsArray=function(){return this.actorsArray};e.prototype.myRoomMasterActorNr=function(){return this.myRoom().masterClientId?this.myRoom().masterClientId:this.lowestActorId};e.prototype.lastRtt=function(){return this.gamePeer?this.gamePeer.getLastRtt():0};e.prototype.roomFactoryInternal=function(a){void 0===a&&(a="");a=this.roomFactory(a);a._setLBC(this);
return a};e.prototype.actorFactoryInternal=function(a,b,c){void 0===a&&(a="");void 0===b&&(b=-1);void 0===c&&(c=!1);a=this.actorFactory(a,b,c);a._setLBC(this);return a};e.prototype.setNameServerAddress=function(a){this.nameServerAddress=a};e.prototype.getNameServerAddress=function(){return this.nameServerAddress};e.prototype.setMasterServerAddress=function(a){this.masterServerAddress=a};e.prototype.getMasterServerAddress=function(){return this.nameServerAddress};e.prototype.setUserId=function(a){this.userId=
a};e.prototype.getUserId=function(){return this.userId};e.prototype.setCustomAuthentication=function(a,b,c){void 0===b&&(b=k.LoadBalancing.Constants.CustomAuthenticationType.Custom);this.userAuthType=b;this.userAuthParameters=a;this.userAuthData=c};e.prototype.connect=function(a){"boolean"===typeof a&&(a=a?{keepMasterConnection:!0}:{keepMasterConnection:!1});a||(a={});if(this.checkNextState(e.State.ConnectingToMasterserver,!0)){this.changeState(e.State.ConnectingToMasterserver);this.logger.info("Connecting to Master",
this.masterServerAddress);this.connectOptions={};for(var b in a)this.connectOptions[b]=a[b];this.masterPeer&&this.masterPeer.Destroy();this.masterPeer=new r(this,this.connectionProtocol,this.masterServerAddress,"");this.initMasterPeer(this.masterPeer);this.masterPeer.connect(this.appId);return!0}return!1};e.prototype.connectToNameServer=function(a){a||(a={});if(this.checkNextState(e.State.ConnectingToNameServer,!0)){this.changeState(e.State.ConnectingToNameServer);this.logger.info("Connecting to NameServer",
this.nameServerAddress);this.connectOptions={};for(var b in a)this.connectOptions[b]=a[b];this.nameServerPeer&&this.nameServerPeer.Destroy();this.nameServerPeer=new q(this,this.connectionProtocol,this.nameServerAddress,"");this.initNameServerPeer(this.nameServerPeer);this.nameServerPeer.connect(this.appId);return!0}return!1};e.prototype.fillCreateRoomOptions=function(a,b){b=b||{};var c={};void 0!==b.isVisible&&(c[d.Constants.GameProperties.IsVisible]=b.isVisible);void 0!==b.isOpen&&(c[d.Constants.GameProperties.IsOpen]=
b.isOpen);void 0!==b.maxPlayers&&(c[d.Constants.GameProperties.MaxPlayers]=b.maxPlayers);void 0!==b.propsListedInLobby&&(c[d.Constants.GameProperties.PropsListedInLobby]=k.TypeExt.String(b.propsListedInLobby));if(void 0!==b.customGameProperties)for(var g in b.customGameProperties)c[g]=b.customGameProperties[g];a.push(d.Constants.ParameterCode.GameProperties,c);a.push(d.Constants.ParameterCode.CleanupCacheOnLeave,!0);a.push(d.Constants.ParameterCode.Broadcast,!0);void 0!==b.emptyRoomLiveTime&&a.push(d.Constants.ParameterCode.EmptyRoomTTL,
k.TypeExt.Int(b.emptyRoomLiveTime));void 0!==b.suspendedPlayerLiveTime&&a.push(d.Constants.ParameterCode.PlayerTTL,k.TypeExt.Int(b.suspendedPlayerLiveTime));void 0!==b.plugins&&a.push(d.Constants.ParameterCode.Plugins,k.TypeExt.String(b.plugins));a.push(d.Constants.ParameterCode.CheckUserOnJoin,!0);a.push(d.Constants.ParameterCode.PublishUserId,!0);b.lobbyName&&(a.push(d.Constants.ParameterCode.LobbyName),a.push(b.lobbyName),void 0!=b.lobbyType&&(a.push(d.Constants.ParameterCode.LobbyType),a.push(b.lobbyType)));
b.expectedUsers&&a.push(d.Constants.ParameterCode.Add,b.expectedUsers)};e.prototype.createRoomFromMy=function(a,b){this.currentRoom.name=a?a:"";b=this.copyCreateOptionsFromMyRoom(b);this.masterPeer&&this.createRoomInternal(this.masterPeer,b)};e.prototype.copyCreateOptionsFromMyRoom=function(a){a=a||{};a.isVisible=this.currentRoom.isVisible;a.isOpen=this.currentRoom.isOpen;a.maxPlayers=this.currentRoom.maxPlayers;a.customGameProperties=this.currentRoom.getCustomProperties();a.propsListedInLobby=this.currentRoom.getPropsListedInLobby();
a.emptyRoomLiveTime=this.currentRoom.emptyRoomLiveTime;a.suspendedPlayerLiveTime=this.currentRoom.suspendedPlayerLiveTime;a.plugins=this.currentRoom.plugins;a.expectedUsers=this.currentRoom.expectedUsers;return a};e.prototype.createRoom=function(a,b){this.currentRoom=this.roomFactoryInternal(a?a:"");if(this.masterPeer)return this.createRoomInternal(this.masterPeer,b)};e.prototype.joinRoom=function(a,b,c){if(!this.masterPeer)return!1;var g=[];b&&(b.createIfNotExists&&(g.push(d.Constants.ParameterCode.JoinMode,
e.JoinMode.CreateIfNotExists),this.fillCreateRoomOptions(g,c)),b.rejoin&&g.push(d.Constants.ParameterCode.JoinMode,e.JoinMode.RejoinOnly),b.expectedUsers&&g.push(d.Constants.ParameterCode.Add,b.expectedUsers));this.currentRoom=this.roomFactoryInternal(a);g.push(d.Constants.ParameterCode.RoomName,a);this.joinRoomOptions=b||{};this.createRoomOptions=c||{};this.logger.info("Join Room",a,b,c,"...");this.masterPeer.sendOperation(d.Constants.OperationCode.JoinGame,g);return!0};e.prototype.joinRandomRoom=
function(a){if(!this.masterPeer)return!1;var b=[];if(a){void 0!=a.matchingType&&a.matchingType!=d.Constants.MatchmakingMode.FillRoom&&(b.push(d.Constants.ParameterCode.MatchMakingType),b.push(a.matchingType));var c={},g=!1;if(void 0!=a.expectedCustomRoomProperties)for(var p in a.expectedCustomRoomProperties)c[p]=a.expectedCustomRoomProperties[p],g=!0;void 0!=a.expectedMaxPlayers&&0<a.expectedMaxPlayers&&(c[d.Constants.GameProperties.MaxPlayers]=a.expectedMaxPlayers,g=!0);g&&(b.push(d.Constants.ParameterCode.GameProperties),
b.push(c));a.lobbyName&&(b.push(d.Constants.ParameterCode.LobbyName),b.push(a.lobbyName),void 0!=a.lobbyType&&(b.push(d.Constants.ParameterCode.LobbyType),b.push(a.lobbyType)));a.sqlLobbyFilter&&(b.push(d.Constants.ParameterCode.Data),b.push(a.sqlLobbyFilter));a.expectedUsers&&b.push(d.Constants.ParameterCode.Add,a.expectedUsers)}this.logger.info("Join Random Room",a&&a.lobbyName,a&&a.lobbyType,"...");this.masterPeer.sendOperation(d.Constants.OperationCode.JoinRandomGame,b);return!0};e.prototype._setPropertiesOfRoom=
function(a,b,c){if(this.gamePeer){var g=[];g.push(d.Constants.ParameterCode.Properties);g.push(a);g.push(d.Constants.ParameterCode.Broadcast);g.push(!0);b&&(g.push(d.Constants.ParameterCode.WebFlags),g.push(k.TypeExt.Byte(1)));c&&(g.push(d.Constants.ParameterCode.ExpectedValues),g.push(c));this.gamePeer.sendOperation(d.Constants.OperationCode.SetProperties,g)}};e.prototype._setPropertiesOfActor=function(a,b,c,g){if(this.gamePeer){var p=[];p.push(d.Constants.ParameterCode.ActorNr);p.push(k.TypeExt.Int(a));
p.push(d.Constants.ParameterCode.Properties);p.push(b);p.push(d.Constants.ParameterCode.Broadcast);p.push(!0);c&&(p.push(d.Constants.ParameterCode.WebFlags),p.push(k.TypeExt.Byte(1)));g&&(p.push(d.Constants.ParameterCode.ExpectedValues),p.push(g));this.gamePeer.sendOperation(d.Constants.OperationCode.SetProperties,p)}};e.prototype.disconnect=function(){this.nameServerPeer&&this.nameServerPeer.disconnect();this._cleanupNameServerPeerData();this.masterPeer&&this.masterPeer.disconnect();this._cleanupMasterPeerData();
this.gamePeer&&this.gamePeer.disconnect();this._cleanupGamePeerData();this.changeState(e.State.Disconnected)};e.prototype.suspendRoom=function(a){if(this.isJoinedToRoom()){if(this.gamePeer){var b=[];a&&a.sendAuthCookie&&b.push(d.Constants.ParameterCode.WebFlags,k.TypeExt.Byte(2));b.push(d.Constants.ParameterCode.IsInactive,!0);this.gamePeer.sendOperation(d.Constants.OperationCode.Leave,b);this.gamePeerWaitingForDisconnect=!0}this._cleanupGamePeerData();this.isConnectedToMaster()?this.changeState(e.State.JoinedLobby):
(this.changeState(e.State.Disconnected),this.connect(this.connectOptions))}};e.prototype.leaveRoom=function(a){if(this.isJoinedToRoom()){if(this.gamePeer){var b=[];a&&a.sendAuthCookie&&b.push(d.Constants.ParameterCode.WebFlags,k.TypeExt.Byte(2));this.gamePeer.sendOperation(d.Constants.OperationCode.Leave,b);this.gamePeerWaitingForDisconnect=!0}this._cleanupGamePeerData();this.isConnectedToMaster()?this.changeState(e.State.JoinedLobby):(this.changeState(e.State.Disconnected),this.connect(this.connectOptions))}};
e.prototype.raiseEvent=function(a,b,c){this.gamePeer&&this.isJoinedToRoom()&&this.gamePeer.raiseEvent(a,b,c)};e.prototype.changeGroups=function(a,b){this.gamePeer&&this.isJoinedToRoom()&&(this.logger.debug("Group change:",a,b),this.gamePeer.changeGroups(a,b))};e.prototype.findFriends=function(a){if(this.masterPeer&&this.isConnectedToMaster())if(a&&"object"==typeof a){this.findFriendsRequestList=[];for(var b=0;b<a.length;++b)if("string"==typeof a[b])this.findFriendsRequestList[b]=a[b];else{this.logger.error("FindFriends request error:",
"Friend name is not a string",b);this.onFindFriendsResult(-1,"Friend name is not a string "+b,{});return}this.logger.debug("Find friends:",a);this.masterPeer.findFriends(this.findFriendsRequestList)}else this.logger.error("FindFriends request error:","Parameter is not an array"),this.onFindFriendsResult(-1,"Parameter is not an array",{});else this.logger.error("FindFriends request error:","Not connected to Master"),this.onFindFriendsResult(e.PeerErrorCode.MasterError,"Not connected to Master",{})};
e.prototype.requestLobbyStats=function(a){if(this.masterPeer&&this.isConnectedToMaster()){this.lobbyStatsRequestList=[];if(a)if("object"==typeof a)for(var b=0;b<a.length;++b){var c=a[b];if("object"==typeof c){var g=c[0];if(g){if(void 0===c[1])c=d.Constants.LobbyType.Default;else if("number"==typeof c[1])c=c[1];else{this.requestLobbyStatsErr("Lobby type is invalid",b);return}this.lobbyStatsRequestList[b]=[g.toString(),c]}else{this.requestLobbyStatsErr("Lobby name is empty",b);return}}else{this.requestLobbyStatsErr("Lobby id is not an array",
b);return}}else{this.requestLobbyStatsErr("Parameter is not an array");return}this.masterPeer.requestLobbyStats(this.lobbyStatsRequestList)}else this.logger.error("LobbyState request error:","Not connected to Master"),this.onLobbyStats(e.PeerErrorCode.MasterError,"Not connected to Master",[])};e.prototype.requestLobbyStatsErr=function(a,b){void 0===b&&(b="");this.logger.error("LobbyState request error:",a,b);this.onLobbyStats(-1,a+" "+b,[])};e.prototype.getRegions=function(){this.nameServerPeer&&
this.isConnectedToNameServer()?(this.logger.debug("GetRegions..."),this.nameServerPeer.getRegions(this.appId)):(this.logger.error("GetRegions request error:","Not connected to NameServer"),this.onGetRegionsResult(e.PeerErrorCode.NameServerError,"Not connected to NameServer",{}))};e.prototype.webRpc=function(a,b,c){this.masterPeer&&this.isConnectedToMaster()?(this.logger.debug("WebRpc..."),this.masterPeer.webRpc(a,b,c)):this.gamePeer&&this.isJoinedToRoom()?(this.logger.debug("WebRpc..."),this.gamePeer.webRpc(a,
b,c)):(this.logger.error("WebRpc request error:","Connected to neither Master nor Game server"),this.onWebRpcResult(e.PeerErrorCode.MasterError,"Connected to neither Master nor Game server",a,0,{}))};e.prototype.connectToRegionMaster=function(a){if(this.nameServerPeer&&this.isConnectedToNameServer())return this.logger.debug("Connecting to Region Master",a,"..."),this.nameServerPeer.opAuth(this.appId,this.appVersion,this.userAuthType,this.userAuthParameters,this.userAuthData,this.userId,a),!0;if(this.connectToNameServer({region:a}))return!0;
this.logger.error("Connecting to Region Master error:","Not connected to NameServer");return!1};e.prototype.isConnectedToMaster=function(){return this.masterPeer&&this.masterPeer.isConnected()};e.prototype.isConnectedToNameServer=function(){return this.nameServerPeer&&this.nameServerPeer.isConnected()};e.prototype.isInLobby=function(){return this.state==e.State.JoinedLobby};e.prototype.isJoinedToRoom=function(){return this.state==e.State.Joined};e.prototype.isConnectedToGame=function(){return this.isJoinedToRoom()};
e.prototype.availableRooms=function(){return this.roomInfos};e.prototype.setLogLevel=function(a){this.logger.setLevel(a);this.nameServerPeer&&this.nameServerPeer.setLogLevel(a);this.masterPeer&&this.masterPeer.setLogLevel(a);this.gamePeer&&this.gamePeer.setLogLevel(a)};e.prototype.addRoom=function(a){this.roomInfos.push(a);this.roomInfosDict[a.name]=a};e.prototype.clearRooms=function(){this.roomInfos=[];this.roomInfosDict={}};e.prototype.purgeRemovedRooms=function(){this.roomInfos=this.roomInfos.filter(function(b){return!b.removed});
for(var a in this.roomInfosDict)this.roomInfosDict[a].removed&&delete this.roomInfosDict[a]};e.prototype.addActor=function(a){this.actors[a.actorNr]=a;this.actorsArray.push(a);this.currentRoom.playerCount=this.actorsArray.length;if(0==this.lowestActorId||this.lowestActorId>a.actorNr)this.lowestActorId=a.actorNr};e.prototype.removeActor=function(a){delete this.actors[a];this.actorsArray=this.actorsArray.filter(function(b){return b.actorNr!=a});this.currentRoom.playerCount=this.actorsArray.length;this.lowestActorId==
a&&(this.lowestActorId=0<this.actorsArray.length?this.actorsArray.reduce(function(b,c){return b.actorNr<c.actorNr?b:c}).actorNr:0)};e.prototype.clearActors=function(){this.actors={};this.actorsArray=[];this.lowestActorId=this.currentRoom.playerCount=0};e.prototype.changeState=function(a){this.logger.info("State:",e.StateToName(this.state),"->",e.StateToName(a));this.state=a;this.onStateChange(a)};e.prototype.createRoomInternal=function(a,b){var c=[];this.currentRoom.name&&c.push(d.Constants.ParameterCode.RoomName,
this.currentRoom.name);this.fillCreateRoomOptions(c,b);a===this.masterPeer&&(this.createRoomOptions=b);a===this.gamePeer&&(c.push(d.Constants.ParameterCode.PlayerProperties),c.push(this._myActor._getAllProperties()));var g=a==this.gamePeer?this.gamePeer._logger:this.masterPeer?this.masterPeer._logger:null;g&&g.info("Create Room",b&&b.lobbyName,b&&b.lobbyType,"...");a.sendOperation(d.Constants.OperationCode.CreateGame,c)};e.prototype.updateUserIdAndNickname=function(a,b){var c=a[d.Constants.ParameterCode.UserId];
void 0!=c&&(this.setUserId(c),b.info("Setting userId sent by server:",c));a=a[d.Constants.ParameterCode.Nickname];void 0!=a&&(this.myActor().setName(a),b.info("Setting nickname sent by server:",a))};e.prototype.initNameServerPeer=function(a){var b=this;a.setLogLevel(this.logger.getLevel());a.addPeerStatusListener(k.PhotonPeer.StatusCodes.error,function(){b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.NameServerError,"NameServer peer error")});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connectFailed,
function(){b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.NameServerConnectFailed,"NameServer peer connect failed. "+b.nameServerAddress)});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.timeout,function(){b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.NameServerTimeout,"NameServer peer timeout")});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connecting,function(){});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connect,function(){a._logger.info("Connected");
b.changeState(e.State.ConnectedToNameServer);void 0!=b.connectOptions.region&&a.opAuth(b.appId,b.appVersion,b.userAuthType,b.userAuthParameters,b.userAuthData,b.userId,b.connectOptions.region)});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.disconnect,function(){a==b.nameServerPeer&&(b._cleanupNameServerPeerData(),a._logger.info("Disconnected"))});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connectClosed,function(){a._logger.info("Server closed connection");b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.NameServerConnectClosed,
"NameServer server closed connection")});a.addResponseListener(d.Constants.OperationCode.GetRegions,function(c){a._logger.debug("resp GetRegions",c);var g={};if(0==c.errCode){var p=c.vals[d.Constants.ParameterCode.Region],u=c.vals[d.Constants.ParameterCode.Address],w;for(w in p)g[p[w]]=u[w]}else a._logger.error("GetRegions request error.",c.errCode);b.onGetRegionsResult(c.errCode,c.errMsg,g)});a.addResponseListener(d.Constants.OperationCode.Authenticate,function(c){a._logger.debug("resp Authenticate",
c);0==c.errCode?(a._logger.info("Authenticated"),a.disconnect(),b.updateUserIdAndNickname(c.vals,a._logger),b.masterServerAddress=c.vals[d.Constants.ParameterCode.Address],a._logger.info("Connecting to Master server",b.masterServerAddress,"..."),b.connectOptions.userAuthSecret=c.vals[d.Constants.ParameterCode.Secret],b.connect(b.connectOptions)):(b.changeState(e.State.Error),b._onErrorInternal(e.PeerErrorCode.NameServerAuthenticationFailed,"NameServer authentication failed: "+c.errCode+" "+c.errMsg))})};
e.prototype.initMasterPeer=function(a){var b=this;a.setLogLevel(this.logger.getLevel());a.addPeerStatusListener(k.PhotonPeer.StatusCodes.error,function(){b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.MasterError,"Master peer error")});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connectFailed,function(){b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.MasterConnectFailed,"Master peer connect failed: "+b.masterServerAddress)});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.timeout,
function(){b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.MasterTimeout,"Master peer error timeout")});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connecting,function(){});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connect,function(){a._logger.info("Connected");var c=[];b.connectOptions.userAuthSecret?(c.push(d.Constants.ParameterCode.Secret,b.connectOptions.userAuthSecret),a.sendOperation(d.Constants.OperationCode.Authenticate,c),a._logger.info("Authenticate with secret...")):
(c.push(d.Constants.ParameterCode.ApplicationId),c.push(b.appId),c.push(d.Constants.ParameterCode.AppVersion),c.push(b.appVersion),b.userAuthType!=d.Constants.CustomAuthenticationType.None&&(c.push(d.Constants.ParameterCode.ClientAuthenticationType,k.TypeExt.Byte(b.userAuthType)),c.push(d.Constants.ParameterCode.ClientAuthenticationParams,b.userAuthParameters),b.userAuthData&&c.push(d.Constants.ParameterCode.ClientAuthenticationData,b.userAuthData)),b.userId&&c.push(d.Constants.ParameterCode.UserId,
b.userId),b.connectOptions.lobbyStats&&c.push(d.Constants.ParameterCode.LobbyStats,!0),a.sendOperation(d.Constants.OperationCode.Authenticate,c),a._logger.info("Authenticate..."))});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.disconnect,function(){a==b.masterPeer&&(b._cleanupMasterPeerData(),a._logger.info("Disconnected"))});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connectClosed,function(){a._logger.info("Server closed connection");b.changeState(e.State.Error);b._onErrorInternal(e.PeerErrorCode.MasterConnectClosed,
"Master server closed connection")});a.addEventListener(d.Constants.EventCode.GameList,function(c){c=c.vals[d.Constants.ParameterCode.GameList];b.clearRooms();for(var g in c){var p=new f(g);p._updateFromProps(c[g]);b.addRoom(p)}b.onRoomList(b.roomInfos);a._logger.debug("ev GameList",b.roomInfos,c)});a.addEventListener(d.Constants.EventCode.GameListUpdate,function(c){c=c.vals[d.Constants.ParameterCode.GameList];var g=[],p=[],u=[],w;for(w in c){var v=b.roomInfos.filter(function(x){return x.name==w});
0<v.length?(v=v[0],v._updateFromProps(c[w]),v.removed?u.push(v):g.push(v)):(v=new f(w),v._updateFromProps(c[w]),b.addRoom(v),p.push(v))}b.purgeRemovedRooms();b.onRoomListUpdate(b.roomInfos,g,p,u);a._logger.debug("ev GameListUpdate:",b.roomInfos,"u:",g,"a:",p,"r:",u,c)});a.addResponseListener(d.Constants.OperationCode.Authenticate,function(c){a._logger.debug("resp Authenticate",c);c.errCode?(b.changeState(e.State.Error),b._onErrorInternal(e.PeerErrorCode.MasterAuthenticationFailed,"Master authentication failed: "+
c.errCode+" "+c.errMsg)):(a._logger.info("Authenticated"),b.updateUserIdAndNickname(c.vals,a._logger),void 0!=c.vals[d.Constants.ParameterCode.Secret]&&(b.connectOptions.userAuthSecret=c.vals[d.Constants.ParameterCode.Secret]),b.changeState(e.State.ConnectedToMaster),c=[],b.connectOptions.lobbyName&&(c.push(d.Constants.ParameterCode.LobbyName),c.push(b.connectOptions.lobbyName),void 0!=b.connectOptions.lobbyType&&(c.push(d.Constants.ParameterCode.LobbyType),c.push(b.connectOptions.lobbyType))),b.autoJoinLobby&&
(a.sendOperation(d.Constants.OperationCode.JoinLobby,c),a._logger.info("Join Lobby",b.connectOptions.lobbyName,b.connectOptions.lobbyType,"...")))});a.addResponseListener(d.Constants.OperationCode.JoinLobby,function(c){a._logger.debug("resp JoinLobby",c);c.errCode||(a._logger.info("Joined to Lobby"),b.changeState(e.State.JoinedLobby));b._onOperationResponseInternal2(d.Constants.OperationCode.JoinLobby,c)});a.addResponseListener(d.Constants.OperationCode.CreateGame,function(c){a._logger.debug("resp CreateGame",
c);c.errCode||(b.currentRoom._updateFromMasterResponse(c.vals),a._logger.debug("Created/Joined "+b.currentRoom.name),b.connectToGameServer(d.Constants.OperationCode.CreateGame));b._onOperationResponseInternal2(d.Constants.OperationCode.CreateGame,c)});a.addResponseListener(d.Constants.OperationCode.JoinGame,function(c){a._logger.debug("resp JoinGame",c);c.errCode||(b.currentRoom._updateFromMasterResponse(c.vals),a._logger.debug("Joined "+b.currentRoom.name),b.connectToGameServer(d.Constants.OperationCode.JoinGame));
b._onOperationResponseInternal2(d.Constants.OperationCode.JoinGame,c)});a.addResponseListener(d.Constants.OperationCode.JoinRandomGame,function(c){a._logger.debug("resp JoinRandomGame",c);c.errCode||(b.currentRoom._updateFromMasterResponse(c.vals),a._logger.debug("Joined "+b.currentRoom.name),b.connectToGameServer(d.Constants.OperationCode.JoinRandomGame));b._onOperationResponseInternal2(d.Constants.OperationCode.JoinRandomGame,c)});a.addResponseListener(d.Constants.OperationCode.FindFriends,function(c){a._logger.debug("resp FindFriends",
c);var g={};if(c.errCode)a._logger.error("FindFriends request error:",c.errCode);else for(var p=c.vals[d.Constants.ParameterCode.FindFriendsResponseOnlineList]||{},u=c.vals[d.Constants.ParameterCode.FindFriendsResponseRoomIdList]||{},w=0;w<b.findFriendsRequestList.length;++w){var v=b.findFriendsRequestList[w];v&&(g[v]={online:p[w],roomId:u[w]})}b.onFindFriendsResult(c.errCode,c.errMsg,g)});a.addResponseListener(d.Constants.OperationCode.LobbyStats,function(c){a._logger.debug("resp LobbyStats",c);
var g=[];if(c.errCode)a._logger.error("LobbyStats request error:",c.errCode);else{var p=c.vals[d.Constants.ParameterCode.LobbyName],u=c.vals[d.Constants.ParameterCode.LobbyType]||{},w=c.vals[d.Constants.ParameterCode.PeerCount]||{},v=c.vals[d.Constants.ParameterCode.GameCount]||{};if(p)for(var x=0;x<p.length;++x)g[x]={lobbyName:p[x],lobbyType:u[x],peerCount:w[x],gameCount:v[x]};else for(x=0;x<b.lobbyStatsRequestList.length;++x)p=b.lobbyStatsRequestList[x],g[x]={lobbyName:p[0],lobbyType:p[1],peerCount:w[x],
gameCount:v[x]}}b.onLobbyStats(c.errCode,c.errMsg,g)});a.addEventListener(d.Constants.EventCode.LobbyStats,function(c){a._logger.debug("ev LobbyStats",c);var g=[],p=c.vals[d.Constants.ParameterCode.LobbyName],u=c.vals[d.Constants.ParameterCode.LobbyType]||{},w=c.vals[d.Constants.ParameterCode.PeerCount]||{};c=c.vals[d.Constants.ParameterCode.GameCount]||{};if(p)for(var v=0;v<p.length;++v)g[v]={lobbyName:p[v],lobbyType:u[v],peerCount:w[v],gameCount:c[v]};b.onLobbyStats(0,"",g)});a.addEventListener(d.Constants.EventCode.AppStats,
function(c){a._logger.debug("ev AppStats",c);b.onAppStats(0,"",{peerCount:c.vals[d.Constants.ParameterCode.PeerCount],masterPeerCount:c.vals[d.Constants.ParameterCode.MasterPeerCount],gameCount:c.vals[d.Constants.ParameterCode.GameCount]})});a.addResponseListener(d.Constants.OperationCode.Rpc,a.webRpcHandler(this))};e.prototype.connectToGameServer=function(a){!this.connectOptions.keepMasterConnection&&this.masterPeer&&this.masterPeer.disconnect();return this.checkNextState(e.State.ConnectingToGameserver,
!0)?(this.logger.info("Connecting to Game",this.currentRoom.address),this.gamePeer&&this.gamePeer.Destroy(),this.gamePeer=new t(this,this.connectionProtocol,this.currentRoom.address,""),this.gamePeerWaitingForDisconnect=!1,this.initGamePeer(this.gamePeer,a),this.gamePeer.connect(this.appId),this.changeState(e.State.ConnectingToGameserver),!0):!1};e.prototype.initGamePeer=function(a,b){var c=this;a.setLogLevel(this.logger.getLevel());a.addPeerStatusListener(k.PhotonPeer.StatusCodes.error,function(){c.changeState(e.State.Error);
c._onErrorInternal(e.PeerErrorCode.GameError,"Game peer error")});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connectFailed,function(){c.changeState(e.State.Error);c._onErrorInternal(e.PeerErrorCode.GameConnectFailed,"Game peer connect failed: "+c.currentRoom.address)});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.timeout,function(){c.changeState(e.State.Error);c._onErrorInternal(e.PeerErrorCode.GameTimeout,"Game peer timeout")});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connect,function(){a._logger.info("Connected");
var g=[];g.push(d.Constants.ParameterCode.ApplicationId);g.push(c.appId);g.push(d.Constants.ParameterCode.AppVersion);g.push(c.appVersion);void 0!=c.connectOptions.userAuthSecret&&(g.push(d.Constants.ParameterCode.Secret),g.push(c.connectOptions.userAuthSecret));c.userAuthType!=d.Constants.CustomAuthenticationType.None&&(g.push(d.Constants.ParameterCode.ClientAuthenticationType),g.push(k.TypeExt.Byte(c.userAuthType)));c.userId&&g.push(d.Constants.ParameterCode.UserId,c.userId);a.sendOperation(d.Constants.OperationCode.Authenticate,
g);a._logger.info("Authenticate...")});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.disconnect,function(){a==c.gamePeer&&(c._cleanupGamePeerData(),a._logger.info("Disconnected"))});a.addPeerStatusListener(k.PhotonPeer.StatusCodes.connectClosed,function(){a._logger.info("Server closed connection");c.gamePeerWaitingForDisconnect||(c.changeState(e.State.Error),c._onErrorInternal(e.PeerErrorCode.GameConnectClosed,"Game server closed connection"))});a.addResponseListener(d.Constants.OperationCode.Authenticate,
function(g){a._logger.debug("resp Authenticate",g);g.errCode?(c.changeState(e.State.Error),c._onErrorInternal(e.PeerErrorCode.GameAuthenticationFailed,"Game authentication failed: "+g.errCode+" "+g.errMsg)):(a._logger.info("Authenticated"),a._logger.info("Connected"),b==d.Constants.OperationCode.CreateGame?c.createRoomInternal(a,c.createRoomOptions):(g=[],g.push(d.Constants.ParameterCode.RoomName),g.push(c.currentRoom.name),g.push(d.Constants.ParameterCode.Broadcast),g.push(!0),g.push(d.Constants.ParameterCode.PlayerProperties),
g.push(c._myActor._getAllProperties()),b==d.Constants.OperationCode.JoinGame&&(c.joinRoomOptions.createIfNotExists&&(g.push(d.Constants.ParameterCode.JoinMode,e.JoinMode.CreateIfNotExists),c.fillCreateRoomOptions(g,c.createRoomOptions)),c.joinRoomOptions.rejoin&&g.push(d.Constants.ParameterCode.JoinMode,e.JoinMode.RejoinOnly),c.joinRoomOptions.expectedUsers&&g.push(d.Constants.ParameterCode.Add,c.joinRoomOptions.expectedUsers)),a.sendOperation(d.Constants.OperationCode.JoinGame,g)),c.changeState(e.State.ConnectedToGameserver))});
a.addResponseListener(d.Constants.OperationCode.CreateGame,function(g){a._logger.debug("resp CreateGame",g);g.errCode||(c._myActor._updateMyActorFromResponse(g.vals),a._logger.info("myActor: ",c._myActor),c.currentRoom._updateFromProps(g.vals[d.Constants.ParameterCode.GameProperties]),c.clearActors(),c.addActor(c._myActor),c.changeState(e.State.Joined),c.onJoinRoom(!0));c._onOperationResponseInternal2(d.Constants.OperationCode.CreateGame,g)});a.addResponseListener(d.Constants.OperationCode.JoinGame,
function(g){a._logger.debug("resp JoinGame",g);if(!g.errCode){c._myActor._updateMyActorFromResponse(g.vals);a._logger.info("myActor: ",c._myActor);c.clearActors();c.addActor(c._myActor);var p=g.vals[d.Constants.ParameterCode.ActorList],u=g.vals[d.Constants.ParameterCode.PlayerProperties];if(void 0!==p)for(var w=0;w<p.length;w++){var v=p[w],x;void 0!==u&&(x=u[v]);var y="";void 0!==x&&(y=x[d.Constants.ActorProperties.PlayerName]);v==c._myActor.actorNr?v=c._myActor:(v=c.actorFactoryInternal(y,v),c.addActor(v));
void 0!==x&&(y=x[d.Constants.ActorProperties.UserId],void 0!=y&&(v.userId=y));void 0!==x&&v._updateFromProps(x)}c.currentRoom._updateFromProps(g.vals[d.Constants.ParameterCode.GameProperties]);c.changeState(e.State.Joined);c.onJoinRoom(!1)}c._onOperationResponseInternal2(d.Constants.OperationCode.JoinGame,g)});a.addResponseListener(d.Constants.OperationCode.SetProperties,function(g){a._logger.debug("resp SetProperties",g);c._onOperationResponseInternal2(d.Constants.OperationCode.SetProperties,g)});
a.addResponseListener(d.Constants.OperationCode.Leave,function(g){a._logger.debug("resp Leave",g);a.disconnect();c._onOperationResponseInternal2(d.Constants.OperationCode.Leave,g)});a.addResponseListener(d.Constants.OperationCode.Rpc,a.webRpcHandler(this));a.addEventListener(d.Constants.EventCode.Join,function(g){a._logger.debug("ev Join",g);if(h._getActorNrFromResponse(g.vals)===c._myActor.actorNr)c._myActor._updateFromResponse(g.vals),c.onActorJoin(c._myActor);else{var p=c.actorFactoryInternal();
p._updateFromResponse(g.vals);c.addActor(p);c.onActorJoin(p)}});a.addEventListener(d.Constants.EventCode.Leave,function(g){a._logger.debug("ev Leave",g);c.myRoom()._updateFromEvent(g.vals);var p=h._getActorNrFromResponse(g.vals);if(p&&c.actors[p]){var u=c.actors[p];g.vals[d.Constants.ParameterCode.IsInactive]?(u._setSuspended(!0),c.onActorSuspend(u)):(c.removeActor(p),c.onActorLeave(u,!1))}});a.addEventListener(d.Constants.EventCode.Disconnect,function(g){a._logger.debug("ev Disconnect",g);(g=h._getActorNrFromResponse(g.vals))&&
c.actors[g]&&(g=c.actors[g],g._setSuspended(!0),c.onActorSuspend(g))});a.addEventListener(d.Constants.EventCode.PropertiesChanged,function(g){a._logger.debug("ev PropertiesChanged",g);var p=g.vals[d.Constants.ParameterCode.TargetActorNr];void 0!==p&&0<p?void 0!==c.actors[p]&&(p=c.actors[p],p._updateFromProps(g.vals[d.Constants.ParameterCode.Properties]),c.onActorPropertiesChange(p)):(c.currentRoom._updateFromProps(g.vals[d.Constants.ParameterCode.Properties]),c.onMyRoomPropertiesChange())})};e.prototype._cleanupNameServerPeerData=
function(){};e.prototype._cleanupMasterPeerData=function(){};e.prototype._cleanupGamePeerData=function(){for(var a in this.actors)this.onActorLeave(this.actors[a],!0);this.clearActors();this.addActor(this._myActor)};e.prototype._onOperationResponseInternal2=function(a,b){b.errCode&&this.logger.warn("Operation",a,"error:",b.errMsg,"("+b.errCode+")");this.onOperationResponse(b.errCode,b.errMsg,a,b.vals)};e.prototype._onErrorInternal=function(a,b){this.logger.error("Error:",a,b);this.onError(a,b)};e.prototype.initValidNextState=
function(){this.validNextState[e.State.Error]=[e.State.ConnectingToMasterserver,e.State.ConnectingToNameServer];this.validNextState[e.State.Uninitialized]=[e.State.ConnectingToMasterserver,e.State.ConnectingToNameServer];this.validNextState[e.State.ConnectedToNameServer]=[e.State.ConnectingToMasterserver];this.validNextState[e.State.Disconnected]=[e.State.ConnectingToMasterserver,e.State.ConnectingToNameServer];this.validNextState[e.State.ConnectedToMaster]=[e.State.JoinedLobby,e.State.ConnectingToGameserver];
this.validNextState[e.State.JoinedLobby]=[e.State.ConnectingToGameserver];this.validNextState[e.State.ConnectingToGameserver]=[e.State.ConnectedToGameserver];this.validNextState[e.State.ConnectedToGameserver]=[e.State.Joined]};e.prototype.checkNextState=function(a,b){void 0===b&&(b=!1);var c=this.validNextState[this.state];(c=c&&0<=c.indexOf(a))||(b?this.logger.error("LoadBalancingPeer checkNextState fail: "+e.StateToName(this.state)+" -> "+e.StateToName(a)):this.logger.exception(501,"LoadBalancingPeer checkNextState fail: "+
e.StateToName(this.state)+" -> "+e.StateToName(a)));return c};e.StateToName=function(a){return e.stateName[a]};e.JoinMode={Default:0,CreateIfNotExists:1,RejoinOnly:3};e.PeerErrorCode={Ok:0,MasterError:1001,MasterConnectFailed:1002,MasterConnectClosed:1003,MasterTimeout:1004,MasterEncryptionEstablishError:1005,MasterAuthenticationFailed:1101,GameError:2001,GameConnectFailed:2002,GameConnectClosed:2003,GameTimeout:2004,GameEncryptionEstablishError:2005,GameAuthenticationFailed:2101,NameServerError:3001,
NameServerConnectFailed:3002,NameServerConnectClosed:3003,NameServerTimeout:3004,NameServerEncryptionEstablishError:3005,NameServerAuthenticationFailed:3101};e.State={Error:-1,Uninitialized:0,ConnectingToNameServer:1,ConnectedToNameServer:2,ConnectingToMasterserver:3,ConnectedToMaster:4,JoinedLobby:5,ConnectingToGameserver:6,ConnectedToGameserver:7,Joined:8,Disconnected:10};e.stateName=(n={},n[e.State.Error]="Error",n[e.State.Uninitialized]="Uninitialized",n[e.State.ConnectingToNameServer]="ConnectingToNameServer",
n[e.State.ConnectedToNameServer]="ConnectedToNameServer",n[e.State.ConnectingToMasterserver]="ConnectingToMasterserver",n[e.State.ConnectedToMaster]="ConnectedToMaster",n[e.State.JoinedLobby]="JoinedLobby",n[e.State.ConnectingToGameserver]="ConnectingToGameserver",n[e.State.ConnectedToGameserver]="ConnectedToGameserver",n[e.State.Joined]="Joined",n[e.State.Disconnected]="Disconnected",n);return e}();d.LoadBalancingClient=m;m=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}
__extends(a,e);a.prototype.webRpc=function(b,c,g){var p=[];p.push(d.Constants.ParameterCode.UriPath,b);p.push(d.Constants.ParameterCode.RpcCallParams,c);g&&g.sendAuthCookie&&p.push(d.Constants.ParameterCode.WebFlags,k.TypeExt.Byte(2));this.sendOperation(d.Constants.OperationCode.Rpc,p)};a.prototype.webRpcHandler=function(b){var c=this;return function(g){c._logger.debug("resp Rpc",g);if(0==g.errCode){var p=g.vals[d.Constants.ParameterCode.UriPath];var u=g.vals[d.Constants.ParameterCode.RpcCallRetData];
var w=g.vals[d.Constants.ParameterCode.RpcCallRetCode]}else c._logger.error("WebRpc request error:",g.errCode);b.onWebRpcResult(g.errCode,g.errMsg,p,w,u)}};return a}(k.PhotonPeer);d.LbcPeer=m;var q=function(e){function a(b,c,g,p){c=e.call(this,c,g,p,b.logger.getPrefix()+" NameServer")||this;c.client=b;return c}__extends(a,e);a.prototype.onUnhandledEvent=function(b,c){this.client.onEvent(b,c.vals[d.Constants.ParameterCode.CustomEventContent],c.vals[d.Constants.ParameterCode.ActorNr])};a.prototype.onUnhandledResponse=
function(b,c){this.client.onOperationResponse(c.errCode,c.errMsg,b,c.vals)};a.prototype.getRegions=function(b){var c=[];c.push(d.Constants.ParameterCode.ApplicationId,b);this.sendOperation(d.Constants.OperationCode.GetRegions,c,!0,0)};a.prototype.opAuth=function(b,c,g,p,u,w,v){var x=[];x.push(d.Constants.ParameterCode.ApplicationId,b);x.push(d.Constants.ParameterCode.AppVersion,c);g!=d.Constants.CustomAuthenticationType.None&&(x.push(d.Constants.ParameterCode.ClientAuthenticationType,k.TypeExt.Byte(g)),
x.push(d.Constants.ParameterCode.ClientAuthenticationParams,p),u&&x.push(d.Constants.ParameterCode.ClientAuthenticationData,u));w&&x.push(d.Constants.ParameterCode.UserId,w);x.push(d.Constants.ParameterCode.Region,v);this.sendOperation(d.Constants.OperationCode.Authenticate,x,!0,0);this._logger.info("Authenticate...")};return a}(m);d.NameServerPeer=q;var r=function(e){function a(b,c,g,p){c=e.call(this,c,g,p,b.logger.getPrefix()+" Master")||this;c.client=b;return c}__extends(a,e);a.prototype.onUnhandledEvent=
function(b,c){this.client.onEvent(b,c.vals[d.Constants.ParameterCode.CustomEventContent],c.vals[d.Constants.ParameterCode.ActorNr])};a.prototype.onUnhandledResponse=function(b,c){this.client.onOperationResponse(c.errCode,c.errMsg,b,c.vals)};a.prototype.findFriends=function(b){var c=[];c.push(d.Constants.ParameterCode.FindFriendsRequestList);c.push(b);this.sendOperation(d.Constants.OperationCode.FindFriends,c)};a.prototype.requestLobbyStats=function(b){var c=[];if(b&&0<b.length){for(var g=[],p=[],
u=0;u<b.length;++u)g[u]=b[u][0],p[u]=b[u][1];c.push(d.Constants.ParameterCode.LobbyName);c.push(g);c.push(d.Constants.ParameterCode.LobbyType);c.push(p)}this.sendOperation(d.Constants.OperationCode.LobbyStats,c)};return a}(m);d.MasterPeer=r;var t=function(e){function a(b,c,g,p){c=e.call(this,c,g,p,b.logger.getPrefix()+" Game")||this;c.client=b;return c}__extends(a,e);a.prototype.onUnhandledEvent=function(b,c){this.client.onEvent(b,c.vals[d.Constants.ParameterCode.CustomEventContent],c.vals[d.Constants.ParameterCode.ActorNr])};
a.prototype.onUnhandledResponse=function(b,c){this.client.onOperationResponse(c.errCode,c.errMsg,b,c.vals)};a.prototype.raiseEvent=function(b,c,g){if(this.client.isJoinedToRoom())this._logger.debug("raiseEvent",b,c,g),b=[d.Constants.ParameterCode.Code,k.TypeExt.Byte(b),d.Constants.ParameterCode.Data,c],g&&(void 0!=g.receivers&&g.receivers!==d.Constants.ReceiverGroup.Others&&(b.push(d.Constants.ParameterCode.ReceiverGroup),b.push(k.TypeExt.Byte(g.receivers))),void 0!=g.cache&&g.cache!==d.Constants.EventCaching.DoNotCache&&
(b.push(d.Constants.ParameterCode.Cache),b.push(k.TypeExt.Byte(g.cache))),void 0!=g.interestGroup&&(this.checkGroupNumber(g.interestGroup)?(b.push(d.Constants.ParameterCode.Group),b.push(k.TypeExt.Byte(g.interestGroup))):this._logger.exception(502,"raiseEvent - Group not a number: "+g.interestGroup)),void 0!=g.targetActors&&(b.push(d.Constants.ParameterCode.ActorList),b.push(g.targetActors)),g.webForward&&(b.push(d.Constants.ParameterCode.WebFlags),b.push(k.TypeExt.Byte(1)))),this.sendOperation(d.Constants.OperationCode.RaiseEvent,
b);else throw Error("raiseEvent - Not joined!");};a.prototype.changeGroups=function(b,c){var g=[];null!=b&&void 0!=b&&(this.checkGroupArray(b,"groupsToRemove"),g.push(d.Constants.ParameterCode.Remove),g.push(k.TypeExt.Byte(b)));null!=c&&void 0!=c&&(this.checkGroupArray(c,"groupsToAdd"),g.push(d.Constants.ParameterCode.Add),g.push(k.TypeExt.Byte(c)));this.sendOperation(d.Constants.OperationCode.ChangeGroups,g)};a.prototype.checkGroupNumber=function(b){return!("number"!=typeof b||isNaN(b)||Infinity===
b||-Infinity===b)};a.prototype.checkGroupArray=function(b,c){if(Exitgames.Common.Util.isArray(b))for(var g=0;g<b.length;++g){var p=b[g];this.checkGroupNumber(p)||this._logger.exception(503,"changeGroups - "+c+" ("+b+") not an array of numbers: element "+g+" = "+p)}else this._logger.exception(504,"changeGroups - groupsToRemove not an array: "+b)};return a}(m);d.GamePeer=t})(k.LoadBalancing||(k.LoadBalancing={}))})(Photon||(Photon={}));
(function(k){k=k.Lite||(k.Lite={});k=k.Constants||(k.Constants={});k.LiteOpKey={ActorList:252,ActorNr:254,ActorProperties:249,Add:238,Broadcast:250,Cache:247,Code:244,Data:245,GameId:255,GameProperties:248,Group:240,Properties:251,ReceiverGroup:246,Remove:239,TargetActorNr:253,EmptyRoomLiveTime:236};k.LiteEventCode={Join:255,Leave:254,PropertiesChanged:253};k.LiteOpCode={ChangeGroups:248,GetProperties:251,Join:255,Leave:254,RaiseEvent:253,SetProperties:252}})(Photon||(Photon={}));
(function(k){var d=k.LoadBalancing||(k.LoadBalancing={});d=d.Constants||(d.Constants={});var n=k.Lite.Constants.LiteOpKey,h=k.Lite.Constants.LiteOpCode;k=k.Lite.Constants.LiteEventCode;d.ErrorCode={Ok:0,OperationNotAllowedInCurrentState:-3,InvalidOperationCode:-2,InternalServerError:-1,InvalidAuthentication:32767,GameIdAlreadyExists:32766,GameFull:32765,GameClosed:32764,NoRandomMatchFound:32760,GameDoesNotExist:32758,MaxCcuReached:32757,InvalidRegion:32756,CustomAuthenticationFailed:32755,AuthenticationTicketExpired:32753,
PluginReportedError:32752,PluginMismatch:32751,JoinFailedPeerAlreadyJoined:32750,JoinFailedFoundInactiveJoiner:32749,JoinFailedWithRejoinerNotFound:32748,JoinFailedFoundExcludedUserId:32747,JoinFailedFoundActiveJoiner:32746,HttpLimitReached:32745,ExternalHttpCallFailed:32744,SlotError:32742,InvalidEncryptionParameters:32741};d.ActorProperties={PlayerName:255,UserId:253};d.GameProperties={MaxPlayers:255,IsVisible:254,IsOpen:253,PlayerCount:252,Removed:251,PropsListedInLobby:250,CleanupCacheOnLeave:249,
MasterClientId:248,ExpectedUsers:247,PlayerTtl:246,EmptyRoomTtl:245};d.EventCode={GameList:230,GameListUpdate:229,QueueState:228,AppStats:226,AzureNodeInfo:210,Join:k.Join,Leave:k.Leave,PropertiesChanged:k.PropertiesChanged,Disconnect:252,LobbyStats:224};d.ParameterCode={Address:230,PeerCount:229,GameCount:228,MasterPeerCount:227,UserId:225,ApplicationId:224,Position:223,MatchMakingType:223,GameList:222,Secret:221,AppVersion:220,AzureNodeInfo:210,AzureLocalNodeId:209,AzureMasterNodeId:208,RoomName:n.GameId,
Broadcast:n.Broadcast,ActorList:n.ActorList,ActorNr:n.ActorNr,PlayerProperties:n.ActorProperties,CustomEventContent:n.Data,Data:n.Data,Code:n.Code,GameProperties:n.GameProperties,Properties:n.Properties,TargetActorNr:n.TargetActorNr,ReceiverGroup:n.ReceiverGroup,Cache:n.Cache,CleanupCacheOnLeave:241,Group:n.Group,Remove:n.Remove,Add:n.Add,EmptyRoomTTL:n.EmptyRoomLiveTime,PlayerTTL:235,Plugins:204,ClientAuthenticationType:217,ClientAuthenticationParams:216,ClientAuthenticationData:214,JoinMode:215,
MasterClientId:203,FindFriendsRequestList:1,FindFriendsResponseOnlineList:1,FindFriendsResponseRoomIdList:2,LobbyName:213,LobbyType:212,LobbyStats:211,Region:210,IsInactive:233,CheckUserOnJoin:232,ExpectedValues:231,UriPath:209,RpcCallParams:208,RpcCallRetCode:207,RpcCallRetMessage:206,RpcCallRetData:208,WebFlags:234,Nickname:202,PublishUserId:239};d.OperationCode={Authenticate:230,JoinLobby:229,LeaveLobby:228,CreateGame:227,JoinGame:226,JoinRandomGame:225,Leave:h.Leave,RaiseEvent:h.RaiseEvent,SetProperties:h.SetProperties,
GetProperties:h.GetProperties,ChangeGroups:h.ChangeGroups,FindFriends:222,LobbyStats:221,GetRegions:220,Rpc:219};d.MatchmakingMode={FillRoom:0,SerialMatching:1,RandomMatching:2};d.EventCaching={DoNotCache:0,MergeCache:1,ReplaceCache:2,RemoveCache:3,AddToRoomCache:4,AddToRoomCacheGlobal:5,RemoveFromRoomCache:6,RemoveFromRoomCacheForActorsLeft:7};d.ReceiverGroup={Others:0,All:1,MasterClient:2};d.CustomAuthenticationType={Custom:0,Steam:1,Facebook:2,None:255};d.LobbyType={Default:0,SqlLobby:2}})(Photon||
(Photon={}));
(function(k){(function(d){(function(n){var h;n.ParameterCode={Channels:0,Channel:1,Messages:2,Message:3,Senders:4,Sender:5,ChannelUserCount:6,UserId:225,MsgId:8,MsgIds:9,SubscribeResults:15,Status:10,Friends:11,SkipMessage:12,HistoryLength:14,WebFlags:21,Properties:22,ChannelSubscribers:23};n.OperationCode={Subscribe:0,Unsubscribe:1,Publish:2,SendPrivate:3,ChannelHistory:4,UpdateStatus:5,AddFriendds:6,RemoveFriends:7};n.EventCode={ChatMessages:0,Users:1,PrivateMessage:2,FriendsList:3,StatusUpdate:4,
Subscribe:5,Unsubscribe:6,UserSubscribe:8,UserUnsubscribe:9};n.UserStatus={Offline:0,Invisible:1,Online:2,Away:3,Dnd:4,Lfg:5,Playing:6};var f=(h={},h[n.UserStatus.Offline]="Offline",h[n.UserStatus.Invisible]="Invisible",h[n.UserStatus.Online]="Online",h[n.UserStatus.Away]="Away",h[n.UserStatus.Dnd]="Dnd",h[n.UserStatus.Lfg]="Lfg",h[n.UserStatus.Playing]="Playing",h);n.ChannelProperties={MaxSubscribers:255,PublishSubscribers:254};n.UserStatusToName=function(l){return f[l]}})(d.Constants||(d.Constants=
{}))})(k.Chat||(k.Chat={}))})(Photon||(Photon={}));
(function(k){(function(d){var n,h=function(){function m(q,r){this.sender=q;this.content=r}m.prototype.getSender=function(){return this.sender};m.prototype.getContent=function(){return this.content};return m}();d.Message=h;var f=function(){function m(q,r){this.name=q;this.isPrivat=r;this.messages=[];this.lastId=0;this.properties={};this.publishSubscribers=!1;this.maxSubscribers=0;this.subscribers={}}m.prototype.getName=function(){return this.name};m.prototype.isPrivate=function(){return this.isPrivat};
m.prototype.getMessages=function(){return this.messages};m.prototype.getLastId=function(){return this.lastId};m.prototype.clearMessages=function(){this.messages.splice(0)};m.prototype.addMessages=function(q,r){var t=[],e;for(e in q)if(parseInt(e)<r.length){var a=new h(q[e],r[e]);this.messages.push(a);t.push(a)}return t};m.prototype.readProperties=function(q){if(q){for(var r in q)this.properties[r]=null==q[r]?void 0:q[r];r=q[d.Constants.ChannelProperties.PublishSubscribers];void 0!=r&&(this.publishSubscribers=
r);r=q[d.Constants.ChannelProperties.MaxSubscribers];void 0!=r&&(this.maxSubscribers=r)}};m.prototype.addSubscriber=function(q){return this.subscribers[q]||Object.keys(this.subscribers).length>this.maxSubscribers?!1:this.subscribers[q]=!0};m.prototype.removeSubscriber=function(q){if(!this.subscribers[q])return!1;delete this.subscribers[q];return!0};m.prototype.reset=function(){this.subscribers={};this.properties={}};return m}();d.Channel=f;var l=function(m){function q(r,t,e){r=m.call(this,r,t,e)||
this;r.DefaultMaxSubscribers=100;r.publicChannels={};r.privateChannels={};r.subscribeRequests=[];r.unsubscribeRequests=[];r.autoJoinLobby=!1;return r}__extends(q,m);q.prototype.onStateChange=function(r){};q.prototype.onError=function(r,t){};q.prototype.onSubscribeResult=function(r){};q.prototype.onUnsubscribeResult=function(r){};q.prototype.onChatMessages=function(r,t){};q.prototype.onPrivateMessage=function(r,t){};q.prototype.onUserStatusUpdate=function(r,t,e,a){};q.prototype.onUserSubscribe=function(r,
t){};q.prototype.onUserUnsubscribe=function(r,t){};q.prototype.connectToNameServer=function(r){return m.prototype.connectToNameServer.call(this,r)};q.prototype.connectToRegionFrontEnd=function(r){return this.connectToRegionMaster(r)};q.prototype.isConnectedToFrontEnd=function(){return this.state==q.ChatState.ConnectedToFrontEnd};q.prototype.subscribe=function(r,t){"number"==typeof t&&(t={historyLength:t});if(this.masterPeer&&this.isConnectedToFrontEnd()){this.logger.debug("Subscribe channels:",r);
var e=[];e.push(d.Constants.ParameterCode.Channels,k.TypeExt.String(r));if(t&&(t.historyLength&&e.push(d.Constants.ParameterCode.HistoryLength,k.TypeExt.Int(t.historyLength)),t.lastIds&&(e.push(d.Constants.ParameterCode.MsgIds,k.TypeExt.Int(t.lastIds)),void 0===t.historyLength&&e.push(d.Constants.ParameterCode.HistoryLength,k.TypeExt.Int(-1))),t.createOptions&&t.createOptions.publishSubscribers)){if(t.createOptions.maxSubscribers>this.DefaultMaxSubscribers)return this.logger.error("Cannot set MaxSubscribers > "+
this.DefaultMaxSubscribers+" when PublishSubscribers == true."),!1;r=k.TypeExt.DictTypedKeys(k.TypeExtType.Object,k.TypeExtType.Object);k.TypeExt.PutTypedKey(r,k.TypeExt.Byte(d.Constants.ChannelProperties.PublishSubscribers),!0);k.TypeExt.PutTypedKey(r,k.TypeExt.Byte(d.Constants.ChannelProperties.MaxSubscribers),k.TypeExt.Int(t.createOptions.maxSubscribers));e.push(d.Constants.ParameterCode.Properties,r)}this.masterPeer.sendOperation(d.Constants.OperationCode.Subscribe,e);return!0}this.logger.error("subscribe request error:",
"Not connected to Front End");return!1};q.prototype.unsubscribe=function(r){if(this.masterPeer&&this.isConnectedToFrontEnd()){this.logger.debug("Unsubscribe channels:",r);var t=[];t.push(d.Constants.ParameterCode.Channels,k.TypeExt.String(r));this.masterPeer.sendOperation(d.Constants.OperationCode.Unsubscribe,t);return!0}this.logger.error("unsubscribe request error:","Not connected to Front End");return!1};q.prototype.publishMessage=function(r,t,e){if(this.masterPeer&&this.isConnectedToFrontEnd()){var a=
[];a.push(d.Constants.ParameterCode.Channel,r);a.push(d.Constants.ParameterCode.Message,t);e&&e.webForward&&(a.push(d.Constants.ParameterCode.WebFlags),a.push(k.TypeExt.Byte(1)));this.masterPeer.sendOperation(d.Constants.OperationCode.Publish,a);return!0}this.logger.error("publishMessage request error:","Not connected to Front End");return!1};q.prototype.sendPrivateMessage=function(r,t,e){if(this.masterPeer&&this.isConnectedToFrontEnd()){var a=[];a.push(d.Constants.ParameterCode.UserId,r);a.push(d.Constants.ParameterCode.Message,
t);e&&e.webForward&&(a.push(d.Constants.ParameterCode.WebFlags),a.push(k.TypeExt.Byte(1)));this.masterPeer.sendOperation(d.Constants.OperationCode.SendPrivate,a);return!0}this.logger.error("sendPrivateMessage request error:","Not connected to Front End");return!1};q.prototype.setUserStatus=function(r,t,e){void 0===t&&(t=null);void 0===e&&(e=!1);if(this.masterPeer&&this.isConnectedToFrontEnd()){var a=[];a.push(d.Constants.ParameterCode.Status,k.TypeExt.Int(r));e?a.push(d.Constants.ParameterCode.SkipMessage,
!0):a.push(d.Constants.ParameterCode.Message,t);this.masterPeer.sendOperation(d.Constants.OperationCode.UpdateStatus,a);return!0}this.logger.error("setUserStatus request error:","Not connected to Front End");return!1};q.prototype.addFriends=function(r){if(this.masterPeer&&this.isConnectedToFrontEnd()){var t=[];t.push(d.Constants.ParameterCode.Friends,k.TypeExt.String(r));this.masterPeer.sendOperation(d.Constants.OperationCode.AddFriendds,t);return!0}this.logger.error("addFriends request error:","Not connected to Front End");
return!1};q.prototype.removeFriends=function(r){if(this.masterPeer&&this.isConnectedToFrontEnd()){var t=[];t.push(d.Constants.ParameterCode.Friends,k.TypeExt.String(r));this.masterPeer.sendOperation(d.Constants.OperationCode.RemoveFriends,t);return!0}this.logger.error("removeFriends request error:","Not connected to Front End");return!1};q.prototype.getPublicChannels=function(){return this.publicChannels};q.prototype.getPrivateChannels=function(){return this.privateChannels};q.prototype.getOrAddChannel=
function(r,t,e){void 0==r[t]&&(r[t]=new f(t,e));return r[t]};q.prototype.initMasterPeer=function(r){var t=this;m.prototype.initMasterPeer.call(this,r);r.addEventListener(d.Constants.EventCode.ChatMessages,function(e){var a=e.vals[d.Constants.ParameterCode.Senders],b=e.vals[d.Constants.ParameterCode.Messages],c=e.vals[d.Constants.ParameterCode.Channel],g=t.publicChannels[c];g?(a=g.addMessages(a,b),g.lastId=e.vals[d.Constants.ParameterCode.MsgId],t.onChatMessages(c,a)):r._logger.warn("ev ChatMessages: Got message from unsubscribed channel ",
c)});r.addEventListener(d.Constants.EventCode.PrivateMessage,function(e){var a=e.vals[d.Constants.ParameterCode.Sender],b=e.vals[d.Constants.ParameterCode.Message],c=e.vals[d.Constants.ParameterCode.UserId];c=t.getUserId()==a?c:a;t.getOrAddChannel(t.privateChannels,c,!0).lastId=e.vals[d.Constants.ParameterCode.MsgId];t.onPrivateMessage(c,new h(a,b))});r.addEventListener(d.Constants.EventCode.StatusUpdate,function(e){var a=e.vals[d.Constants.ParameterCode.Message];t.onUserStatusUpdate(e.vals[d.Constants.ParameterCode.Sender],
e.vals[d.Constants.ParameterCode.Status],void 0!==a,a)});r.addEventListener(d.Constants.EventCode.Subscribe,function(e){r._logger.debug("ev Subscribe",e);var a={},b=e.vals[d.Constants.ParameterCode.Channels]||[],c=e.vals[d.Constants.ParameterCode.SubscribeResults]||[],g=!1,p=e.vals[d.Constants.ParameterCode.Properties];e=e.vals[d.Constants.ParameterCode.ChannelSubscribers];void 0!=p&&(1==b.length?g=!0:t.logger.error("Subscribe event for multiple channels with channels properties returned. Ignoring properties."));
for(var u in b){var w=b[u];a[w]=!1;if(u<c.length&&c[u]){var v=t.getOrAddChannel(t.publicChannels,w,!1);v.reset();a[w]=!0;if(g&&(v.readProperties(p),e))for(u in e)if(!v.addSubscriber(e[u])){r._logger.error("Subscribe: channel '"+w+"' max subscribers exceeded");break}}}t.onSubscribeResult(a)});r.addEventListener(d.Constants.EventCode.Unsubscribe,function(e){r._logger.debug("ev Unsubscribe",e);var a={};e=e.vals[d.Constants.ParameterCode.Channels]||[];for(var b in e){var c=e[b];delete t.publicChannels[c];
a[c]=!0}t.onUnsubscribeResult(a)});r.addEventListener(d.Constants.EventCode.UserSubscribe,function(e){r._logger.debug("ev UserSubscribe",e);var a=e.vals[d.Constants.ParameterCode.Channel];e=e.vals[d.Constants.ParameterCode.UserId];var b=t.publicChannels[a];void 0==b?r._logger.error("UserSubscribe: channel '"+a+"' not found"):b.addSubscriber(e)||r._logger.error("UserSubscribe: channel '"+a+"' max subscribers exceeded");t.onUserSubscribe(a,e)});r.addEventListener(d.Constants.EventCode.UserUnsubscribe,
function(e){r._logger.debug("ev UserUnsubscribe",e);var a=e.vals[d.Constants.ParameterCode.Channel];e=e.vals[d.Constants.ParameterCode.UserId];var b=t.publicChannels[a];void 0==b?r._logger.debug("UserUnsubscribe: channel '"+a+"' not found"):b.removeSubscriber(e)||r._logger.debug("UserUnsubscribe: subscriber '"+e+"' not found in channel '"+a+"'");t.onUserUnsubscribe(a,e)})};q.StateToName=function(r){var t=q.chatStateName[r];return void 0===t?m.StateToName.call(this,r):t};q.ChatPeerErrorCode={Ok:0,
FrontEndError:1001,FrontEndConnectFailed:1002,FrontEndConnectClosed:1003,FrontEndTimeout:1004,FrontEndEncryptionEstablishError:1005,FrontEndAuthenticationFailed:1101,NameServerError:3001,NameServerConnectFailed:3002,NameServerConnectClosed:3003,NameServerTimeout:3004,NameServerEncryptionEstablishError:300,NameServerAuthenticationFailed:3101};q.ChatState={Error:-1,Uninitialized:0,ConnectingToNameServer:1,ConnectedToNameServer:2,ConnectingToFrontEnd:3,ConnectedToFrontEnd:4,Disconnected:10};q.chatStateName=
(n={},n[q.ChatState.Error]="Error",n[q.ChatState.Uninitialized]="Uninitialized",n[q.ChatState.ConnectingToNameServer]="ConnectingToNameServer",n[q.ChatState.ConnectedToNameServer]="ConnectedToNameServer",n[q.ChatState.ConnectingToFrontEnd]="ConnectingToFrontEnd",n[q.ChatState.ConnectedToFrontEnd]="ConnectedToFrontEnd",n[q.ChatState.Disconnected]="Disconnected",n);return q}(k.LoadBalancing.LoadBalancingClient);d.ChatClient=l})(k.Chat||(k.Chat={}))})(Photon||(Photon={}));
