if (self.CavalryLogger) { CavalryLogger.start_js(["dYJWo"]); } __d("FleetBeaconSubscriptionNetwork_LogMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"FleetBeaconLogResponsePayload",kind:"LinkedField",name:"fleet_beacon_log",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"FleetBeaconSubscriptionNetwork_LogMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"FleetBeaconSubscriptionNetwork_LogMutation",selections:b},params:{id:"3531482613593478",metadata:{},name:"FleetBeaconSubscriptionNetwork_LogMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("FleetBeaconSubscriptionNetwork_PublishMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"FleetBeaconPublishResponsePayload",kind:"LinkedField",name:"fleet_beacon_publish",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"FleetBeaconSubscriptionNetwork_PublishMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"FleetBeaconSubscriptionNetwork_PublishMutation",selections:b},params:{id:"3253299374687488",metadata:{},name:"FleetBeaconSubscriptionNetwork_PublishMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("FleetBeaconSubscriptionNetwork_Subscription.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"TestFleetBeaconSubscribeResponsePayload",kind:"LinkedField",name:"test_fleet_beacon_subscribe",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"client_subscription_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"test_id",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"FleetBeaconSubscriptionNetwork_Subscription",selections:b,type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"FleetBeaconSubscriptionNetwork_Subscription",selections:b},params:{id:"3194829573871785",metadata:{subscriptionName:"test_fleet_beacon_subscribe"},name:"FleetBeaconSubscriptionNetwork_Subscription",operationKind:"subscription",text:null}}}();e.exports=a}),null); __d("destroyOnUnload",["Run"],(function(a,b,c,d,e,f){function a(a){return b("Run").onLeave(a)}e.exports=a}),null); __d("BladeRunnerConfig",["RTISubscriptionManagerConfig","WebDriverConfig"],(function(a,b,c,d,e,f){var g="javascript-sandbox",h="OverrideServer";a=function(){"use strict";function a(){}var c=a.prototype;c.patchRequestHeaders=function(a){var c,d={},e=b("RTISubscriptionManagerConfig").bladerunner_www_sandbox;if(((c=b("WebDriverConfig").auxiliaryServiceInfo)==null?void 0:c.bladeRunner)!=null){c=b("WebDriverConfig").auxiliaryServiceInfo.bladeRunner;var f=c.hostname;c=c.port;f!=null&&c!=null&&(d[h]=f+":"+c)}else e!=null&&(d[g]=e);for(var i in a)d[i]=a[i];return d};return a}();c=new a();e.exports=c}),null); __d("MqttPublishListener",[],(function(a,b,c,d,e,f){"use strict";a=Object.freeze({NOT_CONNECTED:"NOT_CONNECTED",PUBLISH_ERROR:"PUBLISH_ERROR",QUEUED:"QUEUED",SENT:"SENT",ACKED:"ACKED",NOT_ACKED:"NOT_ACKED"});f.MqttPublishEvent=a}),null); __d("RealtimeRequestStreamWebClientTypedLogger",["Banzai","GeneratedLoggerUtils","nullthrows"],(function(a,b,c,d,e,f){"use strict";a=function(){function a(){this.$1={}}var c=a.prototype;c.log=function(a){b("GeneratedLoggerUtils").log("logger:RealtimeRequestStreamWebClientLoggerConfig",this.$1,b("Banzai").BASIC,a)};c.logVital=function(a){b("GeneratedLoggerUtils").log("logger:RealtimeRequestStreamWebClientLoggerConfig",this.$1,b("Banzai").VITAL,a)};c.logImmediately=function(a){b("GeneratedLoggerUtils").log("logger:RealtimeRequestStreamWebClientLoggerConfig",this.$1,{signal:!0},a)};c.clear=function(){this.$1={};return this};c.getData=function(){return babelHelpers["extends"]({},this.$1)};c.updateData=function(a){this.$1=babelHelpers["extends"]({},this.$1,a);return this};c.setClientSessionID=function(a){this.$1.client_session_id=a;return this};c.setClientTimeMs=function(a){this.$1.client_time_ms=a;return this};c.setMessage=function(a){this.$1.message=a;return this};c.setSeverity=function(a){this.$1.severity=a;return this};c.setUserFbid=function(a){this.$1.user_fbid=a;return this};return a}();c={client_session_id:!0,client_time_ms:!0,message:!0,severity:!0,user_fbid:!0};e.exports=a}),null); __d("RequestStreamE2EClientLoggerEvent",[],(function(a,b,c,d,e,f){e.exports=Object.freeze({RECEIVED:"received",SENT:"sent",FAILURE:"failure",PUBACK:"puback"})}),null); __d("RequestStreamE2EClientLoggerMessageType",[],(function(a,b,c,d,e,f){e.exports=Object.freeze({REQUEST_STREAM:"request_stream",AMENDMENT:"amendment",AMENDMENT_ACK:"amendment_ack",CANCEL:"cancel",RESPONSE:"response",RESPONSE_ACK:"response_ack",TIMED_REQUEST:"timed_request",INTERRUPT:"interrupt"})}),null); __d("BladeRunnerLogger",["BanzaiLogger","BanzaiODS","BladeRunnerTypes","CurrentUser","FBLogger","MqttPublishListener","Random","RealtimeRequestStreamWebClientTypedLogger","RequestStreamE2EClientLoggerEvent","RequestStreamE2EClientLoggerMessageType","RequestStreamE2EClientSamplingConfig","gkx"],(function(a,b,c,d,e,f){var g=b("MqttPublishListener").MqttPublishEvent,h="bladerunner_js_client",i={info:"info",warning:"warning",exception:"exception"};a=function(){"use strict";function a(){this.$1=this.$4(),this.setFBLoggerLevel(1)}var c=a.prototype;c.info=function(a){this.$3>=2&&b("FBLogger")(h).info("BladeRunner info: %s",a),this.$5(i.info,a)};c.warn=function(a){this.$3>=1&&b("FBLogger")(h).warn("BladeRunner warn: %s",a),this.$5(i.warning,a)};c.exception=function(a,c){c===void 0&&(c="");var d=c+" "+a.toString();this.$3>=0&&b("FBLogger")(h).warn("BladeRunner exception: %s, %s",c,a.toString());this.$5(i.exception,d)};c.trimForLogging=function(a){var b=1024;return typeof a==="string"&&a.length>b?"[trimmed]:"+a.substring(0,b)+"...":a};c.bumpCounter=function(a,c){c===void 0&&(c=1),b("BanzaiODS").bumpEntityKey(2966,"BladeRunnerClient",a,c)};c.setClientSessionId=function(a){this.$2=a};c.setFBLoggerLevel=function(a){this.$3=a};c.$5=function(a,c){if(this.$1){a=new(b("RealtimeRequestStreamWebClientTypedLogger"))().setClientTimeMs(Date.now()).setSeverity(a).setMessage(this.trimForLogging(c)).setClientSessionID(this.$2).setUserFbid(b("CurrentUser").getID());a.log()}};c.$4=function(){return b("gkx")("676834")};c.shouldLogE2E=function(a){var c=b("RequestStreamE2EClientSamplingConfig").sampleRate;if(c>1&&a!=null){a=b("RequestStreamE2EClientSamplingConfig").methodToSamplingMultiplier[a];a===0?c=0:a!=null&&(c/=a)}return b("Random").coinflip(c)};c.logE2EEvent=function(a,c,d,e,f){c===void 0&&(c=b("RequestStreamE2EClientLoggerEvent").RECEIVED);d===void 0&&(d=null);e===void 0&&(e=null);f===void 0&&(f=null);if(d==null)return;a={request_id:d.requestId,message_type:a,event:c,method:e,timestamp:Date.now()/1e3};d.auxId&&(a.aux_id=d.auxId);f!=null&&(a.additional_data=f);b("BanzaiLogger").log("RequestStreamE2EClientLoggerConfig",a)};c.logFrameWithMQTTEvent=function(a,c){switch(c){case g.SENT:this.logFrame(a,b("RequestStreamE2EClientLoggerEvent").SENT);break;case g.ACKED:this.logFrame(a,b("RequestStreamE2EClientLoggerEvent").PUBACK);break;case g.NOT_ACKED:case g.NOT_CONNECTED:case g.PUBLISH_ERROR:this.logFrameFailure(a,c)}};c.logFrameFailure=function(a,c){this.logFrame(a,b("RequestStreamE2EClientLoggerEvent").FAILURE,{reason:c})};c.logFrame=function(a,c,d){d===void 0&&(d=null);var e=null,f=null,g=null;switch(a.type){case b("BladeRunnerTypes").StreamFrameType.REQUEST:e=b("RequestStreamE2EClientLoggerMessageType").REQUEST_STREAM;var h=a.getRequest();f=h.getHeaders().method;g=h.getInstrumentationData();break;case b("BladeRunnerTypes").StreamFrameType.DATA:e=b("RequestStreamE2EClientLoggerMessageType").AMENDMENT;g=a.getData().getInstrumentationData();break}g!=null&&e!=null&&this.logE2EEvent(e,c,g,f,d)};return a}();c=new a();e.exports=c}),null); __d("BladeRunnerTypesInternal",["Base64","BladeRunnerLogger","BladeRunnerTypes"],(function(a,b,c,d,e,f){var g=function(){function a(){}var b=a.prototype;b.getHeaders=function(){if(this.headers!=null)return this.headers;throw new Error("Expected headers")};b.getInstrumentationData=function(){if(this.instrumentationData!=null)try{return JSON.parse(this.instrumentationData)}catch(a){return null}else return null};a.readObject=function(b){var c=new a();c.streamId=n(b.streamId);c.requestType=n(b.requestType);c.payload=q(b.payload);c.headers=t(b.headers);c.extraHeader=q(b.extraHeader);c.requestTarget=q(b.requestTarget);c.instrumentationData=q(b.instrumentationData);return c};return a}();f.GatewayStreamRequest=g;var h=function(){function a(){}a.readObject=function(b){var c=new a();c.streamId=n(b.streamId);c.dataId=o(b.dataId);c.data=q(b.data);c.shouldAck=v(b.shouldAck);return c};var c=a.prototype;c.rawData=function(){if(this.data==null)throw new Error("Expected data");return this.data};c.decodeData=function(){if(this.data==null)throw new Error("Expected data");return b("Base64").decode(this.data)};c.setData=function(a){this.data=b("Base64").encode(a)};c.getInstrumentationData=function(){if(this.instrumentationData!=null)return JSON.parse(this.instrumentationData);else return null};return a}();f.GatewayStreamData=h;var i=function(){function a(){}a.readObject=function(b){var c=new a();c.streamId=n(b.streamId);c.dataId=n(b.dataId);c.success=u(b.success);c.message=q(b.message);c.code=o(b.code);return c};return a}();f.GatewayStreamDataAck=i;i.ACK_CODE_LANDED_AND_ACCEPTED=20;i.ACK_CODE_LANDED_BUT_NOT_ACCEPTED=21;i.ACK_CODE_FAILED_TO_LAND=50;var j=function(){function a(){}a.readObject=function(b){var c=new a();c.streamId=o(b.streamId);c.message=q(b.message);return c};return a}();f.GatewayStreamLog=j;var k=function(){function a(){}a.readObject=function(b){var c=new a();c.streamId=n(b.streamId);c.status=n(b.status);c.message=q(b.message);c.code=o(b.code);c.shouldRetry=v(b.shouldRetry);c.retryDelayMs=o(b.retryDelayMs);return c};return a}();f.GatewayStreamStatusUpdate=k;var l=function(){function a(){}a.readObject=function(b){var c=new a();c.streamId=n(b.streamId);c.newBody=q(b.newBody);c.newExtraHeader=q(b.newExtraHeader);c.patchExtraHeader=q(b.patchExtraHeader);c.killBody=v(b.killBody);c.temporary=v(b.temporary);return c};return a}();f.GatewayStreamRewriteRequest=l;var m=function(){function a(){}var c=a.prototype;c.getRequest=function(){if(this.type==b("BladeRunnerTypes").StreamFrameType.REQUEST&&this.request!=null)return this.request;throw new Error("Expected request")};c.getData=function(){if(this.type==b("BladeRunnerTypes").StreamFrameType.DATA&&this.data!=null)return this.data;throw new Error("Expected data")};c.getDataAck=function(){if(this.type==b("BladeRunnerTypes").StreamFrameType.DATA_ACK&&this.dataAck!=null)return this.dataAck;throw new Error("Expected dataAck")};c.getStatusUpdate=function(){if(this.type==b("BladeRunnerTypes").StreamFrameType.STATUS_UPDATE&&this.statusUpdate!=null)return this.statusUpdate;throw new Error("Expected status update")};c.getLog=function(){if(this.type==b("BladeRunnerTypes").StreamFrameType.LOG&&this.log!=null)return this.log;throw new Error("Expected log")};c.getRewriteRequest=function(){if(this.type==b("BladeRunnerTypes").StreamFrameType.REWRITE_REQUEST&&this.rewriteRequest!=null)return this.rewriteRequest;throw new Error("Expected rewrite request")};c.getStreamId=function(){if(this.type==b("BladeRunnerTypes").StreamFrameType.REQUEST&&this.request!=null)return this.request.streamId;if(this.type==b("BladeRunnerTypes").StreamFrameType.DATA&&this.data!=null)return this.data.streamId;if(this.type==b("BladeRunnerTypes").StreamFrameType.STATUS_UPDATE&&this.statusUpdate!=null)return this.statusUpdate.streamId;if(this.type==b("BladeRunnerTypes").StreamFrameType.LOG&&this.log!=null)return this.log.streamId;if(this.type==b("BladeRunnerTypes").StreamFrameType.REWRITE_REQUEST&&this.rewriteRequest!=null)return this.rewriteRequest.streamId;if(this.type==b("BladeRunnerTypes").StreamFrameType.DATA_ACK&&this.dataAck!=null)return this.dataAck.streamId;throw new Error("Frame with unexpected type")};c.isInstrumented=function(){if(this.type===b("BladeRunnerTypes").StreamFrameType.REQUEST)return this.getRequest().instrumentationData!=null;else if(this.type===b("BladeRunnerTypes").StreamFrameType.DATA)return this.getData().instrumentationData!=null;else return!1};a.readObject=function(c){var d=new a();d.type=n(c.type);switch(d.type){case b("BladeRunnerTypes").StreamFrameType.REQUEST:d.request=g.readObject(r(c.request));break;case b("BladeRunnerTypes").StreamFrameType.DATA:d.data=h.readObject(r(c.data));break;case b("BladeRunnerTypes").StreamFrameType.DATA_ACK:d.dataAck=i.readObject(r(c.dataAck));break;case b("BladeRunnerTypes").StreamFrameType.STATUS_UPDATE:d.statusUpdate=k.readObject(r(c.statusUpdate));break;case b("BladeRunnerTypes").StreamFrameType.LOG:d.log=j.readObject(r(c.log));break;case b("BladeRunnerTypes").StreamFrameType.REWRITE_REQUEST:d.rewriteRequest=l.readObject(r(c.rewriteRequest));break;default:b("BladeRunnerLogger").warn("Frame with unexpected type: "+d.type);return null}return d};a.newRequestFrame=function(c){var d=new a();d.type=b("BladeRunnerTypes").StreamFrameType.REQUEST;d.request=c;return d};a.newDataFrame=function(c){var d=new a();d.type=b("BladeRunnerTypes").StreamFrameType.DATA;d.data=c;return d};a.newDataAckFrame=function(c){var d=new a();d.type=b("BladeRunnerTypes").StreamFrameType.DATA_ACK;d.dataAck=c;return d};a.newStatusUpdateFrame=function(c){var d=new a();d.type=b("BladeRunnerTypes").StreamFrameType.STATUS_UPDATE;d.statusUpdate=c;return d};a.newLogFrame=function(c){var d=new a();d.type=b("BladeRunnerTypes").StreamFrameType.LOG;d.log=c;return d};a.newRewriteRequestFrame=function(c){var d=new a();d.type=b("BladeRunnerTypes").StreamFrameType.REWRITE_REQUEST;d.rewriteRequest=c;return d};return a}();f.GatewayStreamFrame=m;a=function(){function a(a,b,c){this.batchId=a,this.frames=b,this.instrumentationData=c}var b=a.prototype;b.getFrames=function(){if(this.frames!=null)return this.frames;throw new Error("Expected frames")};b.getInstrumentationData=function(){if(this.instrumentationData!=null)try{return JSON.parse(this.instrumentationData)}catch(a){return null}else return null};b.write=function(){return JSON.stringify(this)};b.isInstrumented=function(){return this.getFrames().some(function(a){return a.isInstrumented()})};a.read=function(b){b=JSON.parse(b);var c=b.batchId||0,d=[];for(var e=b.frames,f=Array.isArray(e),g=0,e=f?e:e[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var h;if(f){if(g>=e.length)break;h=e[g++]}else{g=e.next();if(g.done)break;h=g.value}h=h;h=m.readObject(h);h!=null&&d.push(h)}h=b.instrumentationData||null;return new a(c,d,h)};return a}();f.GatewayStreamBatch=a;function n(a){if(typeof a==="number")return a;throw new Error("Expected number")}function o(a){return a==null?null:n(a)}function p(a){if(typeof a==="string")return a;throw new Error("Expected string")}function q(a){return a==null?null:p(a)}function r(a){if(typeof a==="object"&&a!=null)return a;throw new Error("Expected object")}function s(a){if(typeof a==="object"&&a!=null){var b=a,c={};Object.keys(b).forEach(function(a){var d=b[a];typeof d==="string"&&d!=null&&(c[a]=d)});return c}throw new Error("Expected string map")}function t(a){return a==null?null:s(a)}function u(a){if(typeof a==="boolean"&&a!=null)return a;throw new Error("Expected boolean")}function v(a){return a==null?null:u(a)}}),null); __d("BladeRunnerEventHandler",["BladeRunnerLogger","BladeRunnerTypes","BladeRunnerTypesInternal","RequestStreamE2EClientLoggerEvent","RequestStreamE2EClientLoggerMessageType","setTimeoutAcrossTransitions"],(function(a,b,c,d,e,f){var g=1e3;a=function(){function a(a,b,c){this.$2=a,this.$1=b,this.$3=c}var c=a.prototype;c.onProxyResponse=function(a){this.$4(a);var c=[];for(var d=a.getFrames(),e=Array.isArray(d),f=0,d=e?d:d[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{f=d.next();if(f.done)break;g=f.value}g=g;this.$2.witnessFrame(g)&&c.push(g)}b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").RESPONSE,b("RequestStreamE2EClientLoggerEvent").SENT,a.getInstrumentationData());c.length>0&&this.$5(new(b("BladeRunnerTypesInternal").GatewayStreamBatch)(a.batchId,c,a.instrumentationData))};c.onDisconnect=function(){this.$2.resetErrors();var a=new(b("BladeRunnerTypesInternal").GatewayStreamStatusUpdate)();a.streamId=this.$2.getRequest().streamId;a.status=b("BladeRunnerTypes").StreamStatus.CLOSED;a.shouldRetry=!0;a.retryDelayMs=0;a=new(b("BladeRunnerTypesInternal").GatewayStreamBatch)(null,[b("BladeRunnerTypesInternal").GatewayStreamFrame.newStatusUpdateFrame(a)]);this.onProxyResponse(a)};c.$4=function(a){var c=this;a=a.getFrames().filter(function(a){return a.type==b("BladeRunnerTypes").StreamFrameType.STATUS_UPDATE});for(var a=a,d=Array.isArray(a),e=0,a=d?a:a[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var f;if(d){if(e>=a.length)break;f=a[e++]}else{e=a.next();if(e.done)break;f=e.value}f=f;f=f.getStatusUpdate();if(f.status==b("BladeRunnerTypes").StreamStatus.CLOSED||f.status==b("BladeRunnerTypes").StreamStatus.REJECTED){this.$2.onError();var h=f.shouldRetry!=null&&f.shouldRetry,i=f.message!=null?f.message:"null";if(h&&this.$2.getErrorCount()<=this.$2.getRetriesAllowed()){f.status=b("BladeRunnerTypes").StreamStatus.PAUSED;var j=g;f.retryDelayMs!=null&&(j=f.retryDelayMs);b("BladeRunnerLogger").info("Can retry: stream "+f.streamId+" closed with status "+f.status+", message "+i+". Error count: "+this.$2.getErrorCount()+", retryDelay "+j+"ms. Already retrying: "+this.$2.getRetryRequestScheduled().toString());this.$2.getRetryRequestScheduled()?b("BladeRunnerLogger").bumpCounter("stream_closed_already_retrying"):(b("BladeRunnerLogger").bumpCounter("stream_closed_will_retry"),this.$2.setRetryRequestScheduled(!0),j>0?b("setTimeoutAcrossTransitions")(function(){return c.$6()},j):this.$6())}else b("BladeRunnerLogger").info("Will not retry: stream "+f.streamId+" closed with status "+f.status+", message "+i+". Error count: "+this.$2.getErrorCount()+", shouldRetry "+h.toString()+". Already retrying: "+this.$2.getRetryRequestScheduled().toString()),h?b("BladeRunnerLogger").bumpCounter("stream_closed_retry_exceeded"):b("BladeRunnerLogger").bumpCounter("stream_closed_no_retry"),this.$3.removeStream(f.streamId)}}};c.$6=function(){this.$2.setRetryRequestScheduled(!1),this.$2.isAlive()&&this.$3.sendRetryStreamRequest(this.$2)};c.$5=function(a){b("BladeRunnerLogger").bumpCounter("send_to_handler");var c=[];this.$1.onBatch(a);for(var a=a.getFrames(),d=Array.isArray(a),e=0,a=d?a:a[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var f;if(d){if(e>=a.length)break;f=a[e++]}else{e=a.next();if(e.done)break;f=e.value}f=f;try{switch(f.type){case b("BladeRunnerTypes").StreamFrameType.DATA:this.$1.onData(f.getData());c.push(f.getData());break;case b("BladeRunnerTypes").StreamFrameType.STATUS_UPDATE:this.$1.onStatusUpdate(f.getStatusUpdate().status);break;case b("BladeRunnerTypes").StreamFrameType.LOG:f=f.getLog().message;f!=null&&this.$1.onLog(f);break;case b("BladeRunnerTypes").StreamFrameType.DATA_ACK:break;default:throw new Error("Frame with unexpected type")}}catch(a){b("BladeRunnerLogger").bumpCounter("send_to_handler_error"),b("BladeRunnerLogger").exception(a,"Failed sending frame to stream handler")}}this.$7(c)};c.$7=function(a){var c=[];for(var d=0;d2?c-2:0),e=2;e>=7;if(a>0)b[c]=d|128;else{b[c]=d;break}}return b}function h(a,b,c){c=c;b[c++]=a>>8;b[c++]=a%256;return c}function f(a,b){return 256*a[b]+a[b+1]}function i(a){var b=0;for(var c=0,d=a.length;c=55296&&e<=56319?(b+=4,c++):b+=3}return b}function j(a,b,c,d){d=h(b,c,d);k(a,c,d);return d+b}function k(a,b,c){c=c;for(var d=0,e=a.length;d>6,b[c++]=128|f&63):f<55296||f>=57344?(b[c++]=224|f>>12,b[c++]=128|f>>6&63,b[c++]=128|f&63):(f=65536+((f&1023)<<10|a.charCodeAt(++d)&1023),b[c++]=240|f>>18,b[c++]=128|f>>12&63,b[c++]=128|f>>6&63,b[c++]=128|f&63)}}function l(a,b,c){var d=[],e=b,f=0;while(e191&&g<224){var h=a[e++];d[f++]=String.fromCharCode((g&31)<<6|h&63)}else if(g>239&&g<365){h=a[e++];var i=a[e++],j=a[e++];h=((g&7)<<18|(h&63)<<12|(i&63)<<6|j&63)-65536;d[f++]=String.fromCharCode(55296+(h>>10));d[f++]=String.fromCharCode(56320+(h&1023))}else{i=a[e++];j=a[e++];d[f++]=String.fromCharCode((g&15)<<12|(i&63)<<6|j&63)}}return d.join("")}b=function(){"use strict";function a(a,b,c){this.$1=a*1e3,this.$4=b,this.$5=c,this.$3=!1}var b=a.prototype;b.$6=function(){var a=this;this.$3?(this.$3=!1,this.$4(),this.$2=g.setTimeout(function(){a.$6()},this.$1)):this.$5()};b.reset=function(){var a=this;this.$3=!0;this.$2&&(g.clearTimeout(this.$2),this.$2=null);this.$1>0&&(this.$2=g.setTimeout(function(){a.$6()},this.$1))};b.cancel=function(){this.$2&&(g.clearTimeout(this.$2),this.$2=null)};return a}();e.exports={UTF8Length:i,convertStringToUTF8:k,concatBuffers:a,decodeMultiByteInt:c,convertUTF8ToString:l,encodeMultiByteInt:d,writeUInt16BE:h,readUInt16BE:f,writeString:j,Pinger:b}}),null); __d("MqttUtils",["MqttEnv"],(function(a,b,c,d,e,f){"use strict";var g=b("MqttEnv").Env,h={endpointWithSessionId:function(a,b){return this.endpointWithExtraParameter(a,"sid",b.toString())},endpointWithExtraParameters:function(a,b){var c=this,d=a;b.forEach(function(a,b,e){d=c.endpointWithExtraParameter(d,b,a)});return d},endpointWithExtraParameter:function(a,b,c){if(a.indexOf("?")>0)return a+"&"+b+"="+c;else return a+"?"+b+"="+c},generateSessionId:function(){return Math.floor(g.random()*Number.MAX_SAFE_INTEGER)},promiseDone:function(a,b,c){var d=arguments.length>1?a.then(b,c):a;d.then(null,function(a){g.setTimeout(function(){if(a instanceof Error)throw a;else throw new Error("promiseDone")},0)})},promiseDoneWithTimeout:function(a,b,c,d){var e=!1;g.setTimeout(function(){e||(e=!0,c(new Error("promise timeout")))},d);h.promiseDone(a,function(a){e||(e=!0,b(a))},function(a){e||(e=!0,c(a))})},sprintf:function(a){for(var b=arguments.length,c=new Array(b>1?b-1:0),d=1;d>4;b+=1;var f=j(a,b);if(f==null)return{wireMessage:null,position:c};b=f.offset;f=b+f.value;if(f>a.length)return{wireMessage:null,position:c};var g;switch(e){case p.CONNACK:c=a[b++];c=!!(c&1);var h=a[b++];g=new u(c,h);break;case p.PUBLISH:c=d&15;h=c>>1&3;d=l(a,b);b+=2;var k=i(a,b,d);b+=d;d=null;h===1&&(d=l(a,b),b+=2);var m=w.createWithBytes(a.subarray(b,f)),n=(c&1)===1;c=(c&8)===8;g=new x(k,m,h,d,n,c);break;case p.PINGREQ:g=new s("PINGREQ");break;case p.PINGRESP:g=new s("PINGRESP");break;case p.PUBACK:case p.UNSUBACK:k=l(a,b);g=new v(e===p.PUBACK?"PUBACK":"UNSUBACK",k);break;case p.SUBACK:m=l(a,b);b+=2;h=a.subarray(b,f);g=new t(m,h);break;default:throw new Error(o("Invalid MQTT message type %s.",e))}return{wireMessage:g,position:f}}function a(a){var b=[],c=0;while(c1||d===1&&e==null)throw new TypeError(o("Argument Invalid. qos: %s messageType: %s.",d,b));f.qos=d;f.messageIdentifier=e;return f}var c=b.prototype;c.encode=function(){var a=(this.messageType&15)<<4;a|=2;var b=g(this.topic),c=2+b+2;this.messageType===p.SUBSCRIBE&&(c+=1);var d=k(c);c=new ArrayBuffer(1+d.length+c);var e=new Uint8Array(c);e[0]=a;a=1;e.set(d,1);a+=d.length;this.messageIdentifier!=null&&(a=n(this.messageIdentifier,e,a));a=m(this.topic,b,e,a);this.messageType===p.SUBSCRIBE&&this.qos!=null&&(e[a++]=this.qos);return c};return b}(d);var w=function(){"use strict";function a(a,b){this.payloadString=a,this.payloadBytes=b}a.createWithString=function(b){var c=new Uint8Array(new ArrayBuffer(g(b)));h(b,c,0);return new a(b,c)};a.createWithBytes=function(b){var c=i(b,0,b.length);return new a(c,b)};var b=a.prototype;b.string=function(){return this.payloadString};b.bytes=function(){return this.payloadBytes};return a}(),x=function(b){"use strict";babelHelpers.inheritsLoose(a,b);function a(a,c,d,e,f,g){var h;h=b.call(this,"PUBLISH")||this;h.topic=a;h.payloadMessage=c;h.qos=d;h.messageIdentifier=e;h.retained=f!=null?f:!1;h.duplicate=g!=null?g:!1;if(h.qos===1&&h.messageIdentifier==null)throw new TypeError("Argument Invalid. messageIdentifier: null and qos: 1");return h}var c=a.prototype;c.encode=function(){var a=(this.messageType&15)<<4;this.duplicate&&(a|=8);a=a|=this.qos<<1;this.retained&&a!=1;var b=g(this.topic),c=b+2,d=this.qos===0?0:2;c+=d;d=this.payloadMessage.bytes();c+=d.byteLength;var e=k(c);c=new ArrayBuffer(1+e.length+c);var f=new Uint8Array(c);f[0]=a;f.set(e,1);a=1+e.length;a=m(this.topic,b,f,a);this.qos!==0&&this.messageIdentifier!=null&&(a=n(this.messageIdentifier,f,a));f.set(d,a);return c};return a}(d);e.exports={MESSAGE_TYPE:p,WireMessage:{Base:d,PubAckUnsubAck:v,Ping:s,ConnAck:u,Connect:c,Disconnect:f,Subscription:b,Publish:x},createMessageWithString:w.createWithString,decodeMessage:r,decodeByteMessages:a}}),null); __d("MqttTypes",[],(function(a,b,c,d,e,f){"use strict";a=function(a,b){this.errorCode=a,this.errorMessage=b};f.MqttError=a;b=function(a,b){this.mqttError=a,this.connAck=b};f.ConnectFailure=b;c=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c,d){d===void 0&&(d=null);c=a.call(this,c)||this;c.isRecoverable=b;c.originalError=d;return c}return b}(babelHelpers.wrapNativeSuper(Error));f.MqttChannelError=c}),null); __d("MqttProtocolClient",["MqttEnv","MqttProtocolCodec","MqttTypes","MqttProtocolUtils"],(function(a,b,c,d,e,f){"use strict";var g=30,h=6e4,i=b("MqttEnv").Env,j=(a=b("MqttProtocolCodec")).MESSAGE_TYPE,k=a.WireMessage,l=a.createMessageWithString,m=a.decodeByteMessages;c=b("MqttTypes").MqttError;var n=b("MqttTypes").ConnectFailure,o=b("MqttProtocolUtils").concatBuffers,p=b("MqttProtocolUtils").Pinger,q={SOCKET_ERROR:new c(1,"Socket error"),SOCKET_MESSAGE:new c(2,"Unable to parse invalid socket message"),INVALID_DATA_TYPE:new c(3,"Received non-arraybuffer from socket."),CONNECT_TIMEOUT:new c(4,"Connect timed out"),CONNACK_FAILURE:new c(5,"Connection failure due to connack"),PING_TIMEOUT:new c(6,"Ping timeout"),APP_DISCONNECT:new c(7,"Disconnect initiated by app"),SERVER_DISCONNECT:new c(8,"Disconnect message sent my server"),SOCKET_CLOSE:new c(9,"Socket connection closed")};d=function(){function a(a){this.$3=a,this.$2={userName:"",mqttVersion:3,keepAliveInterval:10,ignoreSubProtocol:!1,onConnectSuccess:function(){},onConnectFailure:function(a){},onConnection:function(){},onConnectionError:function(a){},onConnectionLost:function(a){},onMessageArrived:function(a,b,c){},onMessageDelivered:function(a,b){}},this.$1="mqttwsclient",this.$4=0,this.$5=!1,this.$9=i.getLoggerInstance()}var b=a.prototype;b.connect=function(a){var b=this;if(this.$5)throw new Error("Invalid state: connect - already connected");this.$2=a;this.setConnected(!1);this.$7!=null&&(i.clearTimeout(this.$7),this.$7=null);this.$7=i.setTimeout(function(){b.$9.bumpCounter("protocol.error.connect.timeout"),b.$11(q.CONNECT_TIMEOUT)},g*1e3);this.$6=i.createSocket(this.$3);this.$6.binaryType="arraybuffer";this.$6.onopen=function(){b.setConnected(!0),b.$12(new k.Connect(b.$1,a)),a.onConnection()};this.$6.onmessage=function(a){a=a.data;if(!(a instanceof ArrayBuffer)){b.$9.bumpCounter("protocol.error.onmessage.type");b.$11(q.INVALID_DATA_TYPE);return}try{a=new Uint8Array(a);b.$10!=null&&(a=o(b.$10,a),b.$9.bumpCounter("protocol.debug.usingMessagesBuffer"),delete b.$10,b.$10=null);a=m(a);var c=a.messages;b.$10=a.remaining;for(var a=0;ap,c=this.$12>q;(b||c)&&(this.$12=0);this.$13!==0&&a<=p&&this.$10.bumpCounter("short_lived_session");c&&this.$10.bumpCounter("connection_attempt_limit")};c.$38=function(a,b,c,d,e,f,g){a===!0?this.$19++:this.$18++,this.$10.eventLogConnect({sessionID:this.$9,connectionStatus:a,connectionState:this.mqttStateFromConnectionState(this.$11),ackReceived:b,duration:Date.now()-c,hostname:this.$5,attemptNumber:this.$12,failTotal:this.$18,successTotal:this.$19,subscribedTopics:d,publishes:e,errorCode:f,errorMessage:g})};c.$31=function(a,b,c,d){var e=a.mqttError,f=e.errorMessage;this.$10.debugTrace("connect","Connect failed "+f);this.$10.bumpCounter("protocol.onconnectfailure");this.$20.onConnectFailure();this.$6.getIsGuestAuthStringPresent()&&this.$10.bumpCounter("guestAuthentication.onconnectfailure");this.$38(!1,a.connAck!=null,b,c,d,e.errorCode,f);if(a.connAck!=null){this.$10.bumpCounter("protocol.connect_failure."+a.connAck);if(a.connAck===r){this.$40(o);return}}this.$40()};c.$33=function(a,b){var c=this;this.$10.bumpCounter("protocol.onconnection");this.$10.debugTrace("Connect","Socket established");this.$20.onConnected();this.$6.getIsGuestAuthStringPresent()&&this.$10.bumpCounter("guestAuthentication.onconnection");b.forEach(function(a){c.$20.onSubscribe(a)});a.forEach(function(a){c.$20.onPublish(a.topic)});this.$29("TransportConnected")};c.$32=function(a,b,c){this.$10.bumpCounter("protocol.onconnectsuccess"),this.$10.debugTrace("connect","Connect success"),this.$6.getIsGuestAuthStringPresent()&&this.$10.bumpCounter("guestAuthentication.onconnectsucess"),this.$20.onConnectSuccess(),this.$17=!0,this.$38(!0,!0,a,b,c),this.$29("Connected"),this.$42(b),this.$13=Date.now()};c.$35=function(a){this.$10.bumpCounter("protocol.onconnectionlost"),a.errorCode&&this.$10.eventLogDisconnect({sessionID:this.$9,errorCode:a.errorCode,errorMessage:a.errorMessage,duration:Date.now()-this.$13}),this.$10.debugTrace("connect","connection lost"),this.$20.onConnectionLost(),this.$6.getIsGuestAuthStringPresent()&&this.$10.bumpCounter("guestAuthentication.onconnectionlost"),this.$40()};c.$34=function(a){};c.$36=function(a,b,c){this.$10.bumpCounter("protocol.onmessagearrived");this.$6.getIsGuestAuthStringPresent()&&this.$10.bumpCounter("guestAuthentication.onmessagearrived");this.$10.debugTrace("onMessageArrived","Message received on "+a);this.$20.onMessage(a);try{this.$3(a,b,c)}catch(b){this.$10.logError(b,"Listener threw error"),this.$10.bumpCounter("listener_error."+a)}};c.$37=function(a,b){this.$10.bumpCounter("protocol.onmessagedelivered");a=b!=null?b:"null";this.$10.debugTrace("onMessageDelivered","Delivered Message {ID: "+a+"}");if(b==null)return;a=this.$15.get(b);if(a==null){this.$10.bumpCounter("protocol.message_with_unknown_id");return}this.$15["delete"](b);(b=a.listener)==null?void 0:b.onEvent(h.ACKED);a.resolve()};c.$24=function(a){this.$10.bumpCounter("protocol.fail_all_unacked_publishes."+a),this.$15.forEach(function(b,c,d){(c=b.listener)==null?void 0:c.onEvent(h.NOT_ACKED);b.reject(new Error(a))}),this.$15.clear()};c.$42=function(a){var b=this,c=new Set(a);c.forEach(function(a){b.$14.has(a)||b.unsubscribe(a)});a=new Set(this.$14);a.forEach(function(a){c.has(a)||b.subscribe(a)})};c.$39=function(a,b){try{this.$10.bumpCounter("js_error_in_init");this.$10.bumpCounter(b+".error");this.$16=!0;var c=a?a.message:"error";this.$10.debugTrace("onError",b+": "+c);this.$2(a)}catch(a){this.$10.bumpCounter("js_error_in_error_logging"),this.$10.logError(a,"JS error while trying to log previous error")}};return a}();e.exports=a}),null); __d("isFastRefreshEnabledForCurrentDomain",[],(function(a,b,c,d,e,f){"use strict";e.exports=a;function a(){return!1}}),null); __d("MqttChannel",["Promise","requireDeferred","ChannelClientID","IrisSubscribeChecker","MqttAnalyticsHook","MqttConnection","MqttEnv","MqttPublishListener","MqttPublishTimeoutConfig","MqttUserName","MqttUtils","isFastRefreshEnabledForCurrentDomain","promiseDone"],(function(a,b,c,d,e,f){"use strict";var g=b("MqttEnv").Env,h=b("MqttEnv").MqttGkNames,i=b("MqttPublishListener").MqttPublishEvent,j=b("MqttPublishTimeoutConfig").mqttPublishTimeoutMs||60*1e3;a=function(){function a(a){var c=this,d=a.endpoint,e=a.pollingEndpoint,f=a.userFbid,h=a.appId,i=a.initialSubscribedTopics,j=a.capabilities,k=a.clientCapabilities,l=a.chatVisibility;l=l===void 0?!0:l;a=a.guestAuthString;a=a===void 0?null:a;this.$10=g.getLoggerInstance();this.$10.setAppId(h);this.$11=new(b("MqttUserName"))(f,j,k,b("ChannelClientID").getID(),h,l,a);this.$1=d;this.$2=e;this.$5="Disconnected";this.$7="LPInactive";this.$6="Disconnected";this.$3=[];this.$4=new Set();this.$8=new Map();this.$9=new(b("MqttConnection"))();this.$12=null;this.$15=new(b("MqttAnalyticsHook"))();this.$14=new Map();this.$13=[];if(!g.isUserLoggedInNow()&&!b("isFastRefreshEnabledForCurrentDomain")()&&(a==null||a=="")){this.$10.bumpCounter("logged_out_init");return}this.$9.addHook(this.$15);this.$9.addHook(new(b("IrisSubscribeChecker"))(function(){return c.$4.size>0}));this.$16(i);this.$17();this.$10.logIfLoggedOut()}var c=a.prototype;c.$16=function(a){var c=this;if(this.$9.isRunning()){this.$18("run","Connection started calling run again");return}if(g.genGk(h.mqtt_ws_polling_enabled)){var d=g.killswitch("MQTT_WS_FORCE_LONG_POLLING");if(d){this.$18("MqttChannel","Websocket disabled, will do long polling only");return}else if(!b("MqttUtils").hasWSSupport()){this.$18("MqttChannel","Websocket Unavailable, will do long polling only");this.$10.bumpCounter("ws_unavailable_polling");return}}this.$9.run({onStateChange:function(a){c.$19(a)},onJSError:function(a){c.$20(a)},onMessageReceived:function(a,b,d){c.$21(a,b,d)},endpoint:this.$1,mqttUserName:this.$11,subscribedTopics:a,extraConnectMessageProvider:function(){return c.$22()}})};c.shutdown=function(){this.$9&&this.$9.shutdown()};c.publish=function(a,c,d){d===void 0&&(d={qos:1,skipBuffer:!1});var e;d.qos===0?e=this.$23(a,c,d.listener):e=this.$24(a,c,d);b("MqttUtils").promiseDone(e,function(){},function(a){(a=d.listener)==null?void 0:a.onEvent(i.PUBLISH_ERROR)});return e};c.$23=function(a,b,c){return this.$25(a,b,0,c)};c.$24=function(a,c,d){var e={resolve:function(){},reject:function(a){}},f=new(b("Promise"))(function(a,b){e.resolve=a,e.reject=b}),h=g.random();a={topic:a,payload:c,options:d,ack:e,publishToken:h,timeoutId:null};if(d.skipBuffer)if(this.$9.connectionState()==="Connecting"){this.$13.push(a);(c=d.listener)==null?void 0:c.onEvent(i.QUEUED)}else this.$26(a);else{a.timeoutId=this.$27(h);this.$14.set(h,a);(c=d.listener)==null?void 0:c.onEvent(i.QUEUED);this.$28(a)}return f};c.$26=function(a){b("MqttUtils").promiseDone(this.$25(a.topic,a.payload,a.options.qos,a.options.listener),function(){a.ack.resolve()},function(b){a.ack.reject(b)})};c.$28=function(a){var c=this;b("MqttUtils").promiseDone(this.$25(a.topic,a.payload,a.options.qos,a.options.listener),function(){return c.$29(a)},function(a){})};c.$25=function(a,c,d,e){var f=this,g,h,j=this.getConnectionState(),k=Date.now();!this.$9.canPublish()&&this.$12&&this.$12.canPublish()?(g=this.$12.publish(a,c,d),h="lp",e!=null&&(g=g.then(function(){return e.onEvent(i.SENT)})),this.$10.bumpCounter("try_publish_lp")):(g=this.$9.publish(a,c,d,e),h="ws",this.$10.bumpCounter("try_publish_ws"));b("promiseDone")(g,function(){f.$10.eventLogOutgoingPublish({sessionID:f.$9.getSessionId(),topic:a,qos:d,payloadSizeBytes:c.length*2,success:!0,protocol:h,errorMessage:null,connectionState:j,startTime:k})},function(b){f.$10.eventLogOutgoingPublish({sessionID:f.$9.getSessionId(),topic:a,qos:d,payloadSizeBytes:c.length*2,success:!1,protocol:h,errorMessage:b.toString(),connectionState:j,startTime:k})});return g};c.subscribe=function(a,b){var c=this;this.$9.subscribe(a);var d=this.$8.get(a);!d?(d=[b],this.$8.set(a,d)):d.push(b);return function(){var d=c.$8.get(a)||[];d=d.filter(function(a){return a!==b});c.$8.set(a,d);d.length===0&&c.unsubscribeAll(a)}};c.subscribeChannelEvents=function(a){this.$3.push(a)};c.unsubscribeChannelEvents=function(a){a=this.$3.indexOf(a);a>-1&&this.$3.splice(a,1)};c.registerExtraConnectPayloadProvider=function(a){var b=this;this.$18("MqttChannel","registerExtraConnectPayloadProvider called");this.$4.add(a);if(this.$9.isRunning()){a=a.getPublishMessages();a.forEach(function(a){b.publish(a.topic,a.payload,{qos:a.qos,skipBuffer:!0})})}};c.unregisterExtraConnectPayloadProvider=function(a){this.$4["delete"](a)};c.unsubscribeAll=function(a){this.$9.unsubscribe(a),this.$8["delete"](a)};c.getConnectionState=function(){return this.$5};c.getLongPollingStatus=function(){return this.$7};c.getEndpoint=function(){return this.$1};c.addHook=function(a){this.$9.addHook(a)};c.removeHook=function(a){this.$9.removeHook(a)};c.testOnlyMessageReceived=function(a,b){this.$21(a,b,-1)};c.$30=function(a){var b=this.$14.get(a);b!=null&&b.timeoutId!=null&&g.clearTimeout(b.timeoutId);this.$14["delete"](a)};c.$27=function(a){var b=this;a=g.setTimeout(function(a){var c=b.$14.get(a);if(!c)return;var d=c.topic;b.$10.bumpCounter("publish_timeout."+d);b.$10.debugTrace("publish_timeout","Timeout publishing topic: "+d+" publishToken: "+a);b.$10.eventLogPublishTimeout({topic:d});b.$30(a);c.ack.reject(new Error("Publish Timed Out"))},j,a);return a};c.$29=function(a){var b=a.publishToken,c=this.$14.get(b);if(!c)return;this.$30(b);a.ack.resolve();this.$10.debugTrace("publish_success","Topic: "+a.topic+" publishToken: "+a.publishToken);this.$10.bumpCounter("publish_success."+a.topic)};c.$21=function(a,b,c){var d=this.$8.get(a);this.$10.eventLogIncomingPublish({sessionID:this.$9.getSessionId(),topic:a,connectionState:this.getConnectionState(),qos:c,payloadSizeBytes:b.length*2});if(!d)this.$10.debugTrace("_onMessageReceived",a+" being dropped, no listeners");else for(var c=d,a=Array.isArray(c),d=0,c=a?c:c[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var e;if(a){if(d>=c.length)break;e=c[d++]}else{d=c.next();if(d.done)break;e=d.value}e=e;try{e(b)}catch(a){this.$10.logError(a,"Listener exception"),this.$10.bumpCounter("listener_error")}}};c.$20=function(a){if(g.genGk(h.mqtt_ws_polling_enabled)){a.isRecoverable?this.$10.bumpCounter("recoverable_error_skipped"):this.$10.bumpCounter("unrecoverable_error_skipped");return}a.isRecoverable?this.$10.bumpCounter("recoverable_error_not_skipped"):this.$10.bumpCounter("unrecoverable_error_not_skipped");this.$31(a)};c.$32=function(a){this.$31(a)};c.$31=function(a){for(var b=this.$3,c=Array.isArray(b),d=0,b=c?b:b[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var e;if(c){if(d>=b.length)break;e=b[d++]}else{d=b.next();if(d.done)break;e=d.value}e=e;e.onJSError&&e.onJSError(a)}};c.$33=function(){var a=this;this.$13.forEach(function(b){a.$26(b)});this.$13=[];this.$14.forEach(function(b,c,d){a.$28(b)})};c.$19=function(a){a==="Connecting"?(this.$13.forEach(function(a){a.ack.reject(new Error("Client Reconnecting"))}),this.$13=[]):a==="TransportConnected"&&this.$33(),this.$18("_changeState","Connection state = "+a),this.$34(a,this.$7)};c.$35=function(a,b){this.$12&&this.$12.canPublish()&&this.$33(),this.$18("_changeLPStatus","LP status = "+a+", LP Request status = "+b),this.$34(this.$6,a)};c.$34=function(a,b){var c=this.$9.mqttStateFromConnectionState(a);this.$12&&this.$12.canPublish()&&(c="Connected");this.$6=a;(c!==this.$5||b!=this.$7)&&(this.$5=c,this.$7=b,this.$36(c))};c.$36=function(a){for(var b=this.$3,c=Array.isArray(b),d=0,b=c?b:b[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var e;if(c){if(d>=b.length)break;e=b[d++]}else{d=b.next();if(d.done)break;e=d.value}e=e;e.onMQTTStateChanged(a)}};c.$22=function(){var a=this,b=[];this.$4.forEach(function(c){try{c=c.getPublishMessages();Array.prototype.push.apply(b,c)}catch(b){a.$10.logError(b,"ConnectPayload provider exception"),a.$10.bumpCounter("connectPayloadProvider_error")}});return b};c.$17=function(){var a=this;g.genGk(h.mqtt_ws_polling_enabled)&&this.$2&&this.$2!=""&&b("requireDeferred")("MqttLongPollingRunner").onReady(function(b){b=new b(a.$2,a.$11,a.$9.hasFatal(),a.$9.hasConnectSuccess(),function(b,c,d){return a.$21(b,c,d)},function(){return Array.from(a.$8.keys())},function(){return a.$22()},function(b){a.$32(b)},function(b,c){a.$35(b,c)});b.start();a.$9.addHook(b);b.addHook(a.$15);a.$12=b;a.$10.debugTrace("MqttChannel","longPollingRunner loaded")})};c.$18=function(a,b){this.$10.debugTrace(a,"Mqtt channel: "+b)};c.setForegroundState=function(a){this.$11&&this.$11.setForegroundState(a)};c.setChatVisibility=function(a){this.$11&&this.$11.setChatVisibility(a)};c.getEndpointCapabilities=function(){return this.$11.getEndpointCapabilities()};c.setEndpointCapabilities=function(a){this.$11.setEndpointCapabilities(a)};return a}();e.exports=a}),null); __d("FantailLogger",["FantailConfig"],(function(a,b,c,d,e,f){var g=b("FantailConfig").FantailLogQueue;a={debug:function(a,b){var c;for(var d=arguments.length,e=new Array(d>2?d-2:0),f=2;f2?d-2:0),f=2;f2?d-2:0),f=2;f2?d-2:0),f=2;f0){try{this.$20(this.$1)}finally{this.$1=[]}return!0}return!1};c.$20=function(a){var c=this,d=new(b("BladeRunnerTypesInternal").GatewayStreamBatch)(this.$19(),a),e=d.write();if(e.length>i){var f=Math.floor(a.length/2);if(f===0){var g=new Error("Publish is too long: "+e.length);a.forEach(function(a){return b("BladeRunnerLogger").logFrameFailure(a,"too long")});this.$21(d,g,"Publish is too long");throw g}this.$20(a.slice(0,f));this.$20(a.slice(f,a.length))}else try{b("BladeRunnerLogger").info("send message to "+j+" "+e);g={qos:1,skipBuffer:!1};d.isInstrumented()&&(g.listener={onEvent:function(c){for(var d=0;d=a.length)break;g=a[f++]}else{f=a.next();if(f.done)break;g=f.value}g=g;if(g.type===b("BladeRunnerTypes").StreamFrameType.REQUEST){var h=g.getRequest(),i=this.$6.get(h.streamId);i!=null&&this.$23(i,h.streamId,b("BladeRunnerTypes").StreamStatus.CLOSED,!0,null)}else if(g.type===b("BladeRunnerTypes").StreamFrameType.DATA){i=g.getData();h=i.dataId;if(i.shouldAck!=null&&i.shouldAck&&h!=null){g=new(b("BladeRunnerTypesInternal").GatewayStreamDataAck)();g.streamId=i.streamId;g.dataId=h;g.success=!1;g.code=b("BladeRunnerTypesInternal").GatewayStreamDataAck.ACK_CODE_FAILED_TO_LAND;g.message=d;this.$24(g)}}}b("BladeRunnerLogger").info("Failed publishing to MQTT: "+c.message);b("BladeRunnerLogger").bumpCounter("mqtt_publish_error")};c.$24=function(a){var c=this.$8.get(a.dataId);c!=null&&(this.$8["delete"](a.dataId),a.success?c.resolve(!0):a.code===b("BladeRunnerTypesInternal").GatewayStreamDataAck.ACK_CODE_LANDED_BUT_NOT_ACCEPTED?c.resolve(!1):c.reject(a.message))};c.processBatch=function(a){try{b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").RESPONSE,b("RequestStreamE2EClientLoggerEvent").RECEIVED,a.getInstrumentationData());b("BladeRunnerLogger").bumpCounter("socket_process_batch");var c=JSON.stringify(a);b("BladeRunnerLogger").info("Received batch "+c.substring(0,256)+(c.length>256?"...":""));c=null;for(var d=a.getFrames(),e=Array.isArray(d),f=0,d=e?d:d[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{f=d.next();if(f.done)break;g=f.value}g=g;var h=g.getStreamId();c==null&&(c=h);if(h!=null&&c!=h)throw new Error("Received batch with frames for multiple streams");g.type==b("BladeRunnerTypes").StreamFrameType.DATA_ACK&&this.$24(g.getDataAck())}if(c!=null){h=this.$6.get(c);h!=null?h.onProxyResponse(a):b("BladeRunnerLogger").info("Received batch with frames for unknown stream id: "+c)}else b("BladeRunnerLogger").info("Received batch with no frames")}catch(a){b("BladeRunnerLogger").exception(a,"Failed processing batch from MQTT");b("BladeRunnerLogger").bumpCounter("socket_process_batch_error");throw a}};c.$18=function(){this.$6.forEach(function(a,b,c){a.onDisconnect()})};c.$11=function(a,c){this.$23(a,c,b("BladeRunnerTypes").StreamStatus.REJECTED,!1,0)};c.$23=function(a,c,d,e,f){var g=new(b("BladeRunnerTypesInternal").GatewayStreamStatusUpdate)();g.streamId=c;g.status=d;g.shouldRetry=e;g.retryDelayMs=f;c=new(b("BladeRunnerTypesInternal").GatewayStreamBatch)(null,[b("BladeRunnerTypesInternal").GatewayStreamFrame.newStatusUpdateFrame(g)]);a.onProxyResponse(c)};c.$10=function(){if(!b("CurrentUser").isLoggedIn()){b("BladeRunnerLogger").bumpCounter("request_stream_user_logged_out");return!1}return!0};return a}();e.exports=a;a.maxStreamCount=2e3}),null); __d("BladeRunnerStream",["regeneratorRuntime"],(function(a,b,c,d,e,f){a=function(){function a(a){this.$1=a}var c=a.prototype;c.getStreamHandler=function(){return this.$1};c.cancel=function(){};c.amendWithAck=function(a){return b("regeneratorRuntime").async(function(a){while(1)switch(a.prev=a.next){case 0:return a.abrupt("return",!1);case 1:case"end":return a.stop()}},null,this)};c.amendFireAndForget=function(a){};c.isAlive=function(){return!1};c.canAmend=function(){return!1};c.getStatus=function(){return null};c.getStreamId=function(){return 0};return a}();e.exports=a}),null); __d("BladeRunnerStreamState",["BladeRunnerTypes","BladeRunnerTypesInternal"],(function(a,b,c,d,e,f){a=function(){function a(a){this.$1=a,this.$2=null,this.$3=0,this.$4=!1,this.$5=0,this.$6=!1}var c=a.prototype;c.getRequest=function(){return this.$1};c.isAlive=function(){return!(this.$2==b("BladeRunnerTypes").StreamStatus.CLOSED||this.$2==b("BladeRunnerTypes").StreamStatus.REJECTED)};c.canAmend=function(){return this.$2==b("BladeRunnerTypes").StreamStatus.ACCEPTED||this.$2==b("BladeRunnerTypes").StreamStatus.STARTED||this.$2==b("BladeRunnerTypes").StreamStatus.PAUSED};c.getLastStatus=function(){return this.$2};c.setLastStatus=function(a){this.$2=a};c.onError=function(){this.$3+=1};c.getErrorCount=function(){return this.$3};c.resetErrors=function(){this.$3=0};c.getRetryRequestScheduled=function(){return this.$6};c.setRetryRequestScheduled=function(a){this.$6=a};c.witnessFrame=function(a){switch(a.type){case b("BladeRunnerTypes").StreamFrameType.STATUS_UPDATE:var c=a.getStatusUpdate(),d=!0;switch(c.status){case b("BladeRunnerTypes").StreamStatus.ACCEPTED:d=!this.$4;this.$4||(this.$4=!0);break;case b("BladeRunnerTypes").StreamStatus.STARTED:d=this.getLastStatus()!=b("BladeRunnerTypes").StreamStatus.STARTED;break;case b("BladeRunnerTypes").StreamStatus.PAUSED:d=this.getLastStatus()==b("BladeRunnerTypes").StreamStatus.STARTED;break;case b("BladeRunnerTypes").StreamStatus.CLOSED:case b("BladeRunnerTypes").StreamStatus.REJECTED:default:d=!0}this.setLastStatus(c.status);return d;case b("BladeRunnerTypes").StreamFrameType.REWRITE_REQUEST:this.$7(a.getRewriteRequest());return!1;default:return!0}};c.setRetriesAllowed=function(a){this.$5=a};c.getRetriesAllowed=function(){return this.$5};c.$7=function(a){if(a.patchExtraHeader!=null)return;a.temporary!=null||a.temporary==!0||(a.newBody!=null&&(this.$1.payload=a.newBody),a.newExtraHeader!=null&&(this.$1.extraHeader=a.newExtraHeader,this.$1.headers=JSON.parse(a.newExtraHeader)),a.killBody!=null&&a.killBody==!0&&(this.$1.payload=null))};return a}();e.exports=a}),null); __d("BladeRunnerSocketStream",["regeneratorRuntime","Promise","BladeRunnerLogger","BladeRunnerStream","BladeRunnerStreamState","BladeRunnerTypes","BladeRunnerTypesInternal","RequestStreamE2EClientLoggerEvent","RequestStreamE2EClientLoggerMessageType","uuid"],(function(a,b,c,d,e,f){var g=4,h={reason:"stream_dead"};a=function(a){babelHelpers.inheritsLoose(c,a);function c(c,d,e,f){c=a.call(this,c)||this;c.$BladeRunnerSocketStream1=e;c.$BladeRunnerSocketStream2=new(b("BladeRunnerStreamState"))(d);c.$BladeRunnerSocketStream2.setRetriesAllowed(g);c.$BladeRunnerSocketStream3=f;return c}var d=c.prototype;d.send=function(){var a=this.$BladeRunnerSocketStream2.getRequest();b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").REQUEST_STREAM,b("RequestStreamE2EClientLoggerEvent").RECEIVED,a.getInstrumentationData(),a.getHeaders().method,this.$BladeRunnerSocketStream3?{clientForced:"true"}:null);this.$BladeRunnerSocketStream1.sendNewStreamRequest(this.$BladeRunnerSocketStream2,this.getStreamHandler())};d.amendWithAck=function(a){var c,d;return b("regeneratorRuntime").async(function(e){while(1)switch(e.prev=e.next){case 0:c=this.$BladeRunnerSocketStream2.getRequest();d=c.getInstrumentationData();d&&(d.auxId=b("uuid")(),b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").AMENDMENT,b("RequestStreamE2EClientLoggerEvent").RECEIVED,d));if(!this.canAmend()){e.next=5;break}return e.abrupt("return",this.$BladeRunnerSocketStream1.sendAmendmentWithAck(c.streamId,a,d==null?null:JSON.stringify(d)));case 5:b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").AMENDMENT,b("RequestStreamE2EClientLoggerEvent").FAILURE,d,null,h);return e.abrupt("return",b("Promise").reject("Stream is closed or not accepted"));case 7:case"end":return e.stop()}},null,this)};d.amendFireAndForget=function(a){var c=this.$BladeRunnerSocketStream2.getRequest();c=c.getInstrumentationData();c&&(c.auxId=b("uuid")(),b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").AMENDMENT,b("RequestStreamE2EClientLoggerEvent").RECEIVED,c));if(this.canAmend())this.$BladeRunnerSocketStream1.sendAmendment(this.$BladeRunnerSocketStream2.getRequest().streamId,a,c==null?null:JSON.stringify(c));else{b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").AMENDMENT,b("RequestStreamE2EClientLoggerEvent").FAILURE,c,null,h);throw new Error("Stream is closed or not accepted")}};d.cancel=function(){b("BladeRunnerLogger").logE2EEvent(b("RequestStreamE2EClientLoggerMessageType").CANCEL,b("RequestStreamE2EClientLoggerEvent").RECEIVED,this.$BladeRunnerSocketStream2.getRequest().getInstrumentationData()),this.isAlive()&&(this.$BladeRunnerSocketStream1.sendCancel(this.$BladeRunnerSocketStream2.getRequest().streamId),this.$BladeRunnerSocketStream2.setLastStatus(b("BladeRunnerTypes").StreamStatus.CLOSED),this.getStreamHandler().onClientCancel())};d.isAlive=function(){return this.$BladeRunnerSocketStream2.isAlive()};d.canAmend=function(){return this.$BladeRunnerSocketStream2.canAmend()};d.getStatus=function(){return this.$BladeRunnerSocketStream2.getLastStatus()};d.getStreamId=function(){return this.$BladeRunnerSocketStream2.getRequest().streamId};return c}(b("BladeRunnerStream"));e.exports=a}),null); __d("BladeRunnerClient",["Base64","BladeRunnerConfig","BladeRunnerLogger","BladeRunnerSocket","BladeRunnerSocketStream","BladeRunnerTypes","BladeRunnerTypesInternal","uuid"],(function(a,b,c,d,e,f){a=function(){function a(a){this.$1=a!=null?a:b("BladeRunnerSocket").get()}var c=a.prototype;c.requestStream=function(a,c,d,e){e===void 0&&(e={});var f=new(b("BladeRunnerTypesInternal").GatewayStreamRequest)();f.streamId=this.$1.getNextStreamId();f.requestType=b("BladeRunnerTypes").StreamRequestType.BLADE_RUNNER;f.headers=b("BladeRunnerConfig").patchRequestHeaders(a);f.extraHeader=JSON.stringify(f.headers);f.payload=c!=null?b("Base64").encode(c):null;a=e.requestId!=null;c=!1;a||(c=this.$2(f,e));(a||c)&&(f.instrumentationData=JSON.stringify(e));c=new(b("BladeRunnerSocketStream"))(d,f,this.$1,a);c.send();return c};c.logInfo=function(a){b("BladeRunnerLogger").info(a)};c.bumpCounter=function(a){b("BladeRunnerLogger").bumpCounter(a)};c.$2=function(a,c){if(c.requestId!=null)return!1;var d=a.getHeaders().method;d=b("BladeRunnerLogger").shouldLogE2E(d);a=a.getHeaders().requestId;d&&(c.requestId=a!=null?a:b("uuid")());return d};return a}();e.exports=a}),null); __d("SimpleFBAuthenticatedXHRRequest",["invariant","CurrentUser","DTSG","DTSGUtils","ServerJSDefine","SprinkleConfig","StaticSiteData","XHRRequest","isFacebookURI"],(function(a,b,c,d,e,f,g){var h=1;a=function(a){"use strict";babelHelpers.inheritsLoose(c,a);function c(c,d){var e;c=a.call(this,c)||this;e=(e={},e[b("StaticSiteData").jsmod_key]=b("ServerJSDefine").getLoadedModuleHash(),e.__req=(h++).toString(36),e.__a=1,e.__user=b("CurrentUser").getID(),e);a.prototype.setData.call(babelHelpers.assertThisInitialized(c),babelHelpers["extends"]({},d,e));return c}var d=c.prototype;d.send=function(){var c=this;if(!b("isFacebookURI")(this.getURI()))return a.prototype.send.call(this);if(b("DTSG").getCachedToken){var d=b("DTSG").getCachedToken();if(d)return this.sendOnDTSGToken(d);else{b("DTSG").getToken().done(function(a){return c.sendOnDTSGToken(a)});return this}}else this.sendOnDTSGToken(b("DTSG").getToken())};d.sendOnDTSGToken=function(c){if(c){a.prototype.setData.call(this,babelHelpers["extends"]({},this.getData(),{fb_dtsg:c}));if(b("SprinkleConfig").param_name){var d;a.prototype.setData.call(this,babelHelpers["extends"]({},this.getData(),(d={},d[b("SprinkleConfig").param_name]=b("DTSGUtils").getNumericValue(c),d)))}}return a.prototype.send.call(this)};d.setData=function(a){g(0,5518)};c.parseResponse=function(a){return JSON.parse(a.substr(9))};c.getPayload=function(a){a=c.parseResponse(a).payload;return a.payload?a.payload:a};return c}(b("XHRRequest"));e.exports=a}),null); __d("XFantailLogController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/ajax/fantail/",{service:{type:"String",required:!0}})}),null); __d("FantailLogQueue",["ChannelClientID","CircularBuffer","PHPQuerySerializer","SimpleFBAuthenticatedXHRRequest","XFantailLogController","destroyOnUnload","setIntervalAcrossTransitions","sprintf"],(function(a,b,c,d,e,f){var g,h={DEBUG:"debug",INFO:"info",WARN:"warn",ERROR:"error"};a=function(){function a(a){this.$2=a,this.$3=new(b("CircularBuffer"))(200),b("setIntervalAcrossTransitions")(this.$4.bind(this),30*1e3),b("destroyOnUnload")(this.$4.bind(this))}a.get=function(b){a.$1=a.$1||{};a.$1[b]=a.$1[b]||new a(b);return a.$1[b]};var c=a.prototype;c.debug=function(a){for(var b=arguments.length,c=new Array(b>1?b-1:0),d=1;d1?b-1:0),d=1;d1?b-1:0),d=1;d1?b-1:0),d=1;d2?d-2:0),f=2;f0){var c={log_time:[],log:[],severity:[],device_id:[]};a.forEach(function(a){c.log_time.push(a.log_time),c.log.push(a.log),c.severity.push(a.severity),c.device_id.push(a.device_id)});this.$3.clear();a=b("XFantailLogController").getURIBuilder().setString("service",this.$2).getURI();new(b("SimpleFBAuthenticatedXHRRequest"))(a,c).setMethod("POST").setDataSerializer((g||(g=b("PHPQuerySerializer"))).serialize).setRequestHeader("Content-Type","application/x-www-form-urlencoded").send()}};return a}();e.exports=a}),null); __d("FleetBeaconStates",[],(function(a,b,c,d,e,f){"use strict";a=function(){function a(a){this.$1=a}var b=a.prototype;b.getName=function(){return"initial"};b.getFleetBeaconRunner=function(){return this.$1};b.prepareFleetBeaconSucceed=function(){throw new Error("Invalid transition")};b.prepareFleetBeaconFailed=function(){throw new Error("Invalid transition")};b.subscribeIssued=function(){throw new Error("Invalid transition")};b.subscribeSuccessSignalReceived=function(){throw new Error("Invalid transition")};b.publishIssued=function(){throw new Error("Invalid transition")};b.publishFailed=function(){throw new Error("Invalid transition")};b.payloadReceived=function(){throw new Error("Invalid transition")};b.waitForPublishTimeout=function(){throw new Error("Invalid transition")};b.subscribeTimeout=function(){throw new Error("Invalid transition")};b.payloadTimeout=function(){throw new Error("Invalid transition")};b.cleanUpFinish=function(){throw new Error("Invalid transition")};return a}();f.FleetBeaconState=a;b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.getName=function(){return"preparing"};c.prepareFleetBeaconSucceed=function(){var b=this;return{newState:new g(a.prototype.getFleetBeaconRunner.call(this)),action:function(){a.prototype.getFleetBeaconRunner.call(b).runFleetBeaconTest()}}};c.prepareFleetBeaconFailed=function(){var b=this;return{newState:new m(a.prototype.getFleetBeaconRunner.call(this)),action:function(){b.getFleetBeaconRunner().cleanUpFleetBeacon()}}};return b}(a);f.FleetBeaconPreparingState=b;var g=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"before_subscribe"};c.subscribeIssued=function(){var a=this;return{newState:new h(b.prototype.getFleetBeaconRunner.call(this)),action:function(){b.prototype.getFleetBeaconRunner.call(a).startSubscribeTimer()}}};return a}(a);f.FleetBeaconBeforeSubscribeState=g;var h=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"subscribe_issued"};c.subscribeSuccessSignalReceived=function(){var a=this;return{newState:new i(b.prototype.getFleetBeaconRunner.call(this)),action:function(){b.prototype.getFleetBeaconRunner.call(a).waitForNextPublish()}}};c.subscribeTimeout=function(){var a=this;return{newState:new k(b.prototype.getFleetBeaconRunner.call(this)),action:function(){a.getFleetBeaconRunner().cleanUpFleetBeacon()}}};return a}(a);f.FleetBeaconSubscribedIssuedState=h;var i=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"waiting_to_publish"};c.waitForPublishTimeout=function(){var a=this;return{newState:new j(b.prototype.getFleetBeaconRunner.call(this)),action:function(){b.prototype.getFleetBeaconRunner.call(a).publish(),b.prototype.getFleetBeaconRunner.call(a).startPayloadTimer()}}};return a}(a);f.FleetBeaconWaitingToPublishState=i;var j=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"publish_issued"};c.publishFailed=function(){var a=this;return{newState:new m(b.prototype.getFleetBeaconRunner.call(this)),action:function(){a.getFleetBeaconRunner().cleanUpFleetBeacon()}}};c.payloadReceived=function(){var a=this,c,d;(function(){});b.prototype.getFleetBeaconRunner.call(this).isLastPayload()?(c=new l(b.prototype.getFleetBeaconRunner.call(this)),d=function(){a.getFleetBeaconRunner().cleanUpFleetBeacon()}):(c=new i(b.prototype.getFleetBeaconRunner.call(this)),d=function(){b.prototype.getFleetBeaconRunner.call(a).waitForNextPublish()});return{newState:c,action:d}};c.payloadTimeout=function(){var a=this;return{newState:new k(b.prototype.getFleetBeaconRunner.call(this)),action:function(){a.getFleetBeaconRunner().cleanUpFleetBeacon()}}};return a}(a);f.FleetBeaconPublishIssuedState=j;var k=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"failed"};c.cleanUpFinish=function(){return{newState:new n(b.prototype.getFleetBeaconRunner.call(this)),action:function(){}}};return a}(a);f.FleetBeaconFailedState=k;var l=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"succeed"};c.cleanUpFinish=function(){return{newState:new n(b.prototype.getFleetBeaconRunner.call(this)),action:function(){}}};return a}(a);f.FleetBeaconSucceedState=l;var m=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"aborted"};c.cleanUpFinish=function(){return{newState:new n(b.prototype.getFleetBeaconRunner.call(this)),action:function(){}}};return a}(a);f.FleetBeaconAbortedState=m;var n=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getName=function(){return"finish"};return a}(a);f.FleetBeaconFinishState=n}),null); __d("FleetBeaconRunner",["FleetBeaconStates","clearTimeout","setTimeout"],(function(a,b,c,d,e,f){"use strict";a=function(){function a(a){this.$1=a;this.$2=new(b("FleetBeaconStates").FleetBeaconState)(this);var c=new(b("FleetBeaconStates").FleetBeaconPreparingState)(this);this.$1.cleanPreviousFleetBeaconResult();this.$6(function(){return{newState:c,action:function(){}}});this.$3=0;this.$1.setFleetBeaconRunner(this)}var c=a.prototype;c.getPublishTimes=function(){return this.$3};c.prepareFleetBeaconTest=function(){this.$1.prepareFleetBeaconTest()};c.runFleetBeaconTest=function(){var a=this;this.$6(function(){return a.$2.subscribeIssued()});this.$7()};c.$7=function(){this.$1.subscribe()};c.publish=function(){this.$1.publish()};c.isLastPayload=function(){return this.$3>=this.$1.publishWaitIntervalsMS().length};c.waitForNextPublish=function(){var a=this,c=this.$1.publishWaitIntervalsMS()[this.$3];this.$3+=1;c===0?this.$8():b("setTimeout")(function(){a.$8()},c)};c.startSubscribeTimer=function(){var a=this,c=this.$1.subscribeTimeoutIntervalMS();this.$4=b("setTimeout")(function(){a.$9()},c)};c.startPayloadTimer=function(){var a=this,c=this.$1.payloadTimeoutIntervalMS();this.$5=b("setTimeout")(function(){a.$10()},c)};c.cleanUpFleetBeacon=function(){this.$1.cleanUpFleetBeacon()};c.onCleanUpFinish=function(){var a=this;this.$6(function(){return a.$2.cleanUpFinish()})};c.$8=function(){var a=this;this.$6(function(){return a.$2.waitForPublishTimeout()})};c.$9=function(){var a=this;this.$6(function(){return a.$2.subscribeTimeout()})};c.$10=function(){var a=this;this.$6(function(){return a.$2.payloadTimeout()})};c.onPrepareFleetBeaconSuccess=function(){var a=this;this.$6(function(){return a.$2.prepareFleetBeaconSucceed()})};c.onPrepareFleetBeaconFailed=function(){var a=this;this.$6(function(){return a.$2.prepareFleetBeaconFailed()})};c.onSubscribe=function(){var a=this;b("clearTimeout")(this.$4);this.$6(function(){return a.$2.subscribeSuccessSignalReceived()})};c.onPayloadReceived=function(){var a=this;b("clearTimeout")(this.$5);this.$6(function(){return a.$2.payloadReceived()})};c.onPublishFailed=function(){var a=this;b("clearTimeout")(this.$5);this.$6(function(){return a.$2.publishFailed()})};c.$6=function(a){a=a();var b=this.$2;this.$2=a.newState;var c=this.$2;this.$11(b,c);a.action()};c.$11=function(a,b){this.$1.onFleetBeaconStateTransition(a,b)};return a}();e.exports=a}),null); __d("FleetBeaconStateTransitionListener",[],(function(a,b,c,d,e,f){a=function(){function a(){}var b=a.prototype;b.onFleetBeaconStateTransition=function(a,b,c,d){throw new Error("Require implementation")};b.cleanState=function(){throw new Error("Require implementation")};return a}();e.exports=a}),null); __d("FleetBeaconTestBase",[],(function(a,b,c,d,e,f){"use strict";a=function(){function a(){this.$1=null,this.$2=[]}var b=a.prototype;b.addStateTransitionListener=function(a){this.$2.push(a)};b.cleanPreviousFleetBeaconResult=function(){this.$2.forEach(function(a){a.cleanState()})};b.getNumberOfPublishers=function(){var a;return(a=(a=this.$1)==null?void 0:a.getPublishTimes())!=null?a:-1};b.getTestID=function(){throw new Error("Require implementation")};b.setFleetBeaconRunner=function(a){this.$1=a};b.prepareFleetBeaconTest=function(){throw new Error("Require implementation")};b.onPrepareFleetBeaconSuccess=function(){var a;(a=this.$1)==null?void 0:a.onPrepareFleetBeaconSuccess()};b.onPrepareFleetBeaconFailed=function(){var a;(a=this.$1)==null?void 0:a.onPrepareFleetBeaconFailed()};b.subscribe=function(){throw new Error("Require implementation")};b.onSubscribe=function(){var a;(a=this.$1)==null?void 0:a.onSubscribe()};b.publish=function(){throw new Error("Require implementation")};b.cleanUpFleetBeacon=function(){throw new Error("Require implementation")};b.onCleanUpFinish=function(){var a;(a=this.$1)==null?void 0:a.onCleanUpFinish()};b.onPublishFailed=function(){var a;(a=this.$1)==null?void 0:a.onPublishFailed()};b.onPayloadReceived=function(){var a;(a=this.$1)==null?void 0:a.onPayloadReceived()};b.subscribeTimeoutIntervalMS=function(){return 1e4};b.payloadTimeoutIntervalMS=function(){return 2e4};b.publishWaitIntervalsMS=function(){return[1e4,5e3]};b.shouldStartTime=function(){return!0};b.onFleetBeaconStateTransition=function(a,b){var c=this,d=Date.now();this.$2.forEach(function(e){e.onFleetBeaconStateTransition(a,b,d,c)})};return a}();e.exports=a}),null); __d("FleetBeaconTestUIAnnouncer",["FleetBeaconStateTransitionListener"],(function(a,b,c,d,e,f){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.$FleetBeaconTestUIAnnouncer1=[];b.$FleetBeaconTestUIAnnouncer3=!1;b.$FleetBeaconTestUIAnnouncer4=!1;b.$FleetBeaconTestUIAnnouncer5=!1;b.$FleetBeaconTestUIAnnouncer6=!1;b.$FleetBeaconTestUIAnnouncer7=-1;b.$FleetBeaconTestUIAnnouncer8=-1;b.$FleetBeaconTestUIAnnouncer9=0;b.$FleetBeaconTestUIAnnouncer10=0;b.$FleetBeaconTestUIAnnouncer11=[];b.$FleetBeaconTestUIAnnouncer12=-1;b.$FleetBeaconTestUIAnnouncer13=-1;b.$FleetBeaconTestUIAnnouncer14=-1;return b}var c=b.prototype;c.cleanState=function(){this.$FleetBeaconTestUIAnnouncer3=!1,this.$FleetBeaconTestUIAnnouncer4=!1,this.$FleetBeaconTestUIAnnouncer5=!1,this.$FleetBeaconTestUIAnnouncer6=!1,this.$FleetBeaconTestUIAnnouncer7=-1,this.$FleetBeaconTestUIAnnouncer8=-1,this.$FleetBeaconTestUIAnnouncer9=0,this.$FleetBeaconTestUIAnnouncer10=0,this.$FleetBeaconTestUIAnnouncer11=[],this.$FleetBeaconTestUIAnnouncer12=-1,this.$FleetBeaconTestUIAnnouncer13=-1,this.$FleetBeaconTestUIAnnouncer14=-1};c.addSubscriber=function(a){this.$FleetBeaconTestUIAnnouncer1.push(a)};c.onFleetBeaconStateTransition=function(a,b,c,d){var e=d.getTestID(),f={oldState:a,newState:b,testID:e,timestamp:c,extra:{}};this.$FleetBeaconTestUIAnnouncer2==null&&(this.$FleetBeaconTestUIAnnouncer2=d);e="NONE";switch(b.getName()){case"initial":break;case"preparing":this.$FleetBeaconTestUIAnnouncer12=Date.now();this.$FleetBeaconTestUIAnnouncer3=!0;f.extra=babelHelpers["extends"]({},f.extra,{createIssued:!0});break;case"before_subscribe":this.$FleetBeaconTestUIAnnouncer13=Date.now();this.$FleetBeaconTestUIAnnouncer4=!0;f.extra=babelHelpers["extends"]({},f.extra,{createSuccess:!0});break;case"subscribe_issued":this.$FleetBeaconTestUIAnnouncer5=!0;f.extra=babelHelpers["extends"]({},f.extra,{subscribeIssued:!0,subscribeTimestamp:this.$FleetBeaconTestUIAnnouncer13,subscribeTimeoutIntervalMS:(d=(c=this.$FleetBeaconTestUIAnnouncer2)==null?void 0:c.subscribeTimeoutIntervalMS())!=null?d:-1});break;case"waiting_to_publish":a.getName()==="subscribe_issued"&&(this.$FleetBeaconTestUIAnnouncer6=!0,this.$FleetBeaconTestUIAnnouncer7=Date.now()-this.$FleetBeaconTestUIAnnouncer13,f.extra=babelHelpers["extends"]({},f.extra,{subscribeSuccess:!0,subscribeLatencyMS:this.$FleetBeaconTestUIAnnouncer7}));a.getName()==="publish_issued"&&this.$FleetBeaconTestUIAnnouncer15(f);break;case"publish_issued":this.$FleetBeaconTestUIAnnouncer9+=1;this.$FleetBeaconTestUIAnnouncer14=Date.now();f.extra=babelHelpers["extends"]({},f.extra,{publishIssued:!0,payloadTimeoutInterval:(c=(b=this.$FleetBeaconTestUIAnnouncer2)==null?void 0:b.payloadTimeoutIntervalMS())!=null?c:-1});break;case"failed":a.getName()==="subscribe_issued"&&(e="SUBSCRIBE_FAILED");a.getName()==="publish_issued"&&(e="RECEIVE_PUBLISH_FAILED");this.$FleetBeaconTestUIAnnouncer16(f,"FAILURE",e);break;case"succeed":a.getName()==="publish_issued"&&this.$FleetBeaconTestUIAnnouncer15(f);this.$FleetBeaconTestUIAnnouncer16(f,"SUCCESS","NONE");break;case"aborted":a.getName()==="preparing"&&(e="CREATE_TEST_FAILED");a.getName()==="publish_issued"&&(e="MUTATE_FIELD_FAILED");this.$FleetBeaconTestUIAnnouncer16(f,"ABORT",e);break;case"finish":f.extra=babelHelpers["extends"]({},f.extra,{cleanUpFinish:!0});break;default:}this.$FleetBeaconTestUIAnnouncer1.forEach(function(a){a(f)})};c.$FleetBeaconTestUIAnnouncer15=function(a){this.$FleetBeaconTestUIAnnouncer10+=1;var b=Date.now()-this.$FleetBeaconTestUIAnnouncer14;this.$FleetBeaconTestUIAnnouncer11.push(b);a.extra=babelHelpers["extends"]({},a.extra,{payloadSuccess:!0,payloadSuccessCnt:this.$FleetBeaconTestUIAnnouncer10,payloadLatency:b})};c.$FleetBeaconTestUIAnnouncer16=function(a,b,c){a.extra=babelHelpers["extends"]({},a.extra,{testResult:b,failureReason:c})};return b}(b("FleetBeaconStateTransitionListener"));e.exports=a}),null); __d("FleetBeaconSubscriptionNetwork",["regeneratorRuntime","Promise","CurrentUser","RelayModern","uuid","FleetBeaconSubscriptionNetwork_Subscription.graphql","FleetBeaconSubscriptionNetwork_PublishMutation.graphql","FleetBeaconSubscriptionNetwork_LogMutation.graphql"],(function(a,b,c,d,e,f){"use strict";var g,h,i;a=function(){function a(a){this.environment=a}var c=a.prototype;c.subscribe=function(a,c){return b("RelayModern").requestSubscription(this.environment,{subscription:g!==void 0?g:g=b("FleetBeaconSubscriptionNetwork_Subscription.graphql"),variables:{input:{test_id:a}},onError:c.onError,onNext:c.onNext})};c.publish=function(a){var c=this;return b("regeneratorRuntime").async(function(d){while(1)switch(d.prev=d.next){case 0:return d.abrupt("return",new(b("Promise"))(function(d,e){b("RelayModern").commitMutation(c.environment,{mutation:h!==void 0?h:h=b("FleetBeaconSubscriptionNetwork_PublishMutation.graphql"),variables:{input:{client_mutation_id:b("uuid")(),actor_id:b("CurrentUser").getAccountID(),test_id:a}},onCompleted:function(a){return d()},onError:e})}));case 1:case"end":return d.stop()}},null,this)};c.log=function(a){var c=this;return b("regeneratorRuntime").async(function(d){while(1)switch(d.prev=d.next){case 0:return d.abrupt("return",new(b("Promise"))(function(d,e){b("RelayModern").commitMutation(c.environment,{mutation:i!==void 0?i:i=b("FleetBeaconSubscriptionNetwork_LogMutation.graphql"),variables:{input:a},onCompleted:function(a){return d()},onError:e})}));case 1:case"end":return d.stop()}},null,this)};return a}();e.exports=a}),null); __d("FleetBeaconTestSubscriptionLogger",["CurrentUser","FleetBeaconStateTransitionListener","RelayRTIUtils","uuid"],(function(a,b,c,d,e,f){a=function(a){babelHelpers.inheritsLoose(c,a);function c(b,c,d){var e;e=a.call(this)||this;e.$FleetBeaconTestSubscriptionLogger1=null;e.$FleetBeaconTestSubscriptionLogger2=b;e.$FleetBeaconTestSubscriptionLogger3=!1;e.$FleetBeaconTestSubscriptionLogger4=!1;e.$FleetBeaconTestSubscriptionLogger5=!1;e.$FleetBeaconTestSubscriptionLogger6=!1;e.$FleetBeaconTestSubscriptionLogger7=-1;e.$FleetBeaconTestSubscriptionLogger8=-1;e.$FleetBeaconTestSubscriptionLogger9=0;e.$FleetBeaconTestSubscriptionLogger10=0;e.$FleetBeaconTestSubscriptionLogger11=[];e.$FleetBeaconTestSubscriptionLogger12=-1;e.$FleetBeaconTestSubscriptionLogger13=-1;e.$FleetBeaconTestSubscriptionLogger14=-1;e.$FleetBeaconTestSubscriptionLogger15=c;e.$FleetBeaconTestSubscriptionLogger16=d;return e}var d=c.prototype;d.cleanState=function(){this.$FleetBeaconTestSubscriptionLogger3=!1,this.$FleetBeaconTestSubscriptionLogger4=!1,this.$FleetBeaconTestSubscriptionLogger5=!1,this.$FleetBeaconTestSubscriptionLogger6=!1,this.$FleetBeaconTestSubscriptionLogger7=-1,this.$FleetBeaconTestSubscriptionLogger8=-1,this.$FleetBeaconTestSubscriptionLogger9=0,this.$FleetBeaconTestSubscriptionLogger10=0,this.$FleetBeaconTestSubscriptionLogger11=[],this.$FleetBeaconTestSubscriptionLogger12=-1,this.$FleetBeaconTestSubscriptionLogger13=-1,this.$FleetBeaconTestSubscriptionLogger14=-1};d.onFleetBeaconStateTransition=function(a,b,c,d){this.$FleetBeaconTestSubscriptionLogger1==null&&(this.$FleetBeaconTestSubscriptionLogger1=d);c="NONE";switch(b.getName()){case"initial":break;case"preparing":this.$FleetBeaconTestSubscriptionLogger12=Date.now();this.$FleetBeaconTestSubscriptionLogger3=!0;break;case"before_subscribe":this.$FleetBeaconTestSubscriptionLogger13=Date.now();this.$FleetBeaconTestSubscriptionLogger4=!0;break;case"subscribe_issued":this.$FleetBeaconTestSubscriptionLogger5=!0;break;case"waiting_to_publish":a.getName()==="subscribe_issued"&&(this.$FleetBeaconTestSubscriptionLogger6=!0,this.$FleetBeaconTestSubscriptionLogger7=Date.now()-this.$FleetBeaconTestSubscriptionLogger13);a.getName()==="publish_issued"&&this.$FleetBeaconTestSubscriptionLogger17();break;case"publish_issued":this.$FleetBeaconTestSubscriptionLogger9+=1;this.$FleetBeaconTestSubscriptionLogger14=Date.now();break;case"failed":a.getName()==="subscribe_issued"&&(c="SUBSCRIBE_FAILED");a.getName()==="publish_issued"&&(c="RECEIVE_PUBLISH_FAILED");this.$FleetBeaconTestSubscriptionLogger18("FAILURE",c);break;case"succeed":a.getName()==="publish_issued"&&this.$FleetBeaconTestSubscriptionLogger17();this.$FleetBeaconTestSubscriptionLogger18("SUCCESS","NONE");break;case"aborted":a.getName()==="preparing"&&(c="CREATE_TEST_FAILED");a.getName()==="publish_issued"&&(c="MUTATE_FIELD_FAILED");this.$FleetBeaconTestSubscriptionLogger18("ABORT",c);break;default:}};d.$FleetBeaconTestSubscriptionLogger17=function(){this.$FleetBeaconTestSubscriptionLogger10+=1;var a=Date.now()-this.$FleetBeaconTestSubscriptionLogger14;this.$FleetBeaconTestSubscriptionLogger11.push(a)};d.$FleetBeaconTestSubscriptionLogger18=function(a,c){var d,e=this,f=this.$FleetBeaconTestSubscriptionLogger12=Date.now()-this.$FleetBeaconTestSubscriptionLogger12,g=parseInt(this.$FleetBeaconTestSubscriptionLogger11.reduce(function(a,b){return a+b},0)/this.$FleetBeaconTestSubscriptionLogger10,10);d=(d=this.$FleetBeaconTestSubscriptionLogger1)==null?void 0:d.getTestID();if(d==null)return;this.$FleetBeaconTestSubscriptionLogger2.log({client_mutation_id:b("uuid")(),actor_id:b("CurrentUser").getAccountID(),test_id:d,test_name:"Web_Manual",test_result:a,failure_reason:c,subscribe_issued:this.$FleetBeaconTestSubscriptionLogger5,subscribe_success:this.$FleetBeaconTestSubscriptionLogger6,subscribe_latency_ms:this.$FleetBeaconTestSubscriptionLogger7,subscribe_timeout_interval_ms:(d=this.$FleetBeaconTestSubscriptionLogger1)==null?void 0:d.subscribeTimeoutIntervalMS(),publish_success:this.$FleetBeaconTestSubscriptionLogger10>0,publish_latency_ms:g,publish_timeout_interval_ms:(a=this.$FleetBeaconTestSubscriptionLogger1)==null?void 0:a.payloadTimeoutIntervalMS(),test_duration_ms:f,triggering_subscription:(c=this.$FleetBeaconTestSubscriptionLogger15)!=null?c:"manual",app_id:b("RelayRTIUtils").GRAPH_SERVICES_SDK_APP_ID}).then(function(a){e.$FleetBeaconTestSubscriptionLogger16(!0)})["catch"](function(a){e.$FleetBeaconTestSubscriptionLogger16(!1)})};return c}(b("FleetBeaconStateTransitionListener"));e.exports=a}),null); __d("FleetBeaconTestSubscription",["FleetBeaconTestBase","FleetBeaconTestSubscriptionLogger","FleetBeaconTestUIAnnouncer","uuid"],(function(a,b,c,d,e,f){"use strict";a=function(a){babelHelpers.inheritsLoose(c,a);function c(c,d,e){var f;f=a.call(this)||this;f.onCleanUpFleetBeaconFinish=function(a){f.onCleanUpFinish()};f.$FleetBeaconTestSubscription1=c;f.$FleetBeaconTestSubscription3=null;f.$FleetBeaconTestSubscription4=e;f.$FleetBeaconTestSubscription6=new(b("FleetBeaconTestSubscriptionLogger"))(c,d,f.onCleanUpFleetBeaconFinish);f.$FleetBeaconTestSubscription5=new(b("FleetBeaconTestUIAnnouncer"))();a.prototype.addStateTransitionListener.call(babelHelpers.assertThisInitialized(f),f.$FleetBeaconTestSubscription6);a.prototype.addStateTransitionListener.call(babelHelpers.assertThisInitialized(f),f.$FleetBeaconTestSubscription5);f.cleanPreviousFleetBeaconResult();return f}var d=c.prototype;d.cleanPreviousFleetBeaconResult=function(){a.prototype.cleanPreviousFleetBeaconResult.call(this),this.$FleetBeaconTestSubscription2=b("uuid")()};d.getTestID=function(){return this.$FleetBeaconTestSubscription2};d.getFleetBeaconUIAnnouncer=function(){return this.$FleetBeaconTestSubscription5};d.prepareFleetBeaconTest=function(){this.onPrepareFleetBeaconSuccess()};d.subscribe=function(){var a=this,b=this.$FleetBeaconTestSubscription2;if(b==null)return;this.$FleetBeaconTestSubscription3=this.$FleetBeaconTestSubscription1.subscribe(b,{onNext:function(){a.onPayloadReceived()},onError:function(){}});this.onSubscribe()};d.publish=function(){var b=this,c=this.$FleetBeaconTestSubscription2;if(c==null)return;this.$FleetBeaconTestSubscription1.publish(c)["catch"](function(c){a.prototype.onPublishFailed.call(b)})};d.cleanUpFleetBeacon=function(){};d.$FleetBeaconTestSubscription7=function(){var a;(a=this.$FleetBeaconTestSubscription3)==null?void 0:a.dispose()};d.onFleetBeaconStateTransition=function(b,c){a.prototype.onFleetBeaconStateTransition.call(this,b,c);b=c.getName();b==="finish"&&(this.$FleetBeaconTestSubscription4(),this.$FleetBeaconTestSubscription7())};return c}(b("FleetBeaconTestBase"));e.exports=a}),null); __d("FleetBeaconSubscriptionLauncher",["FleetBeaconRunner","FleetBeaconSubscriptionNetwork","FleetBeaconTestSubscription"],(function(a,b,c,d,e,f){"use strict";f.CreateFleetBeaconTestSubscription=a;f.LaunchFleetBeaconTestSubscription=c;function a(a,c,d){a=new(b("FleetBeaconTestSubscription"))(new(b("FleetBeaconSubscriptionNetwork"))(a),c,d);return a}function c(a){var c=new(b("FleetBeaconRunner"))(a);a.setFleetBeaconRunner(c);c.prepareFleetBeaconTest()}}),null); __d("Animation",["BrowserSupport","CSS","DataStore","DOM","Style","clearInterval","clearTimeout","getVendorPrefixedName","requestAnimationFrame","setIntervalAcrossTransitions","setTimeoutAcrossTransitions","shield"],(function(a,b,c,d,e,f){var g=b("requestAnimationFrame"),h=[],i;function j(b){if(a==this)return new j(b);else this.obj=b,this._reset_state(),this.queue=[],this.last_attr=null,this.unit="px",this.behaviorOverrides={ignoreUserScroll:!1}}function k(a){if(b("BrowserSupport").hasCSS3DTransforms())return n(a);else return m(a)}function l(a){return a.toFixed(8)}function m(a){a=[a[0],a[4],a[1],a[5],a[12],a[13]];return"matrix("+a.map(l).join(",")+")"}function n(a){return"matrix3d("+a.map(l).join(",")+")"}function o(a,b){a||(a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);var c=[];for(var d=0;d<4;d++)for(var e=0;e<4;e++){var f=0;for(var g=0;g<4;g++)f+=a[d*4+g]*b[g*4+e];c[d*4+e]=f}return c}var p=0;j.prototype._reset_state=function(){this.state={attrs:{},duration:500}};j.prototype.stop=function(){this._reset_state();this.queue=[];return this};j.prototype._build_container=function(){if(this.container_div){this._refresh_container();return}if(this.obj.firstChild&&this.obj.firstChild.__animation_refs){this.container_div=this.obj.firstChild;this.container_div.__animation_refs++;this._refresh_container();return}var a=document.createElement("div");a.style.padding="0px";a.style.margin="0px";a.style.border="0px";a.__animation_refs=1;var b=this.obj.childNodes;while(b.length)a.appendChild(b[0]);this.obj.appendChild(a);this._orig_overflow=this.obj.style.overflow;this.obj.style.overflow="hidden";this.container_div=a;this._refresh_container()};j.prototype._refresh_container=function(){this.container_div.style.height="auto",this.container_div.style.width="auto",this.container_div.style.height=this.container_div.offsetHeight+this.unit,this.container_div.style.width=this.container_div.offsetWidth+this.unit};j.prototype._destroy_container=function(){if(!this.container_div)return;if(!--this.container_div.__animation_refs){var a=this.container_div.childNodes;while(a.length)this.obj.appendChild(a[0]);this.obj.removeChild(this.container_div)}this.container_div=null;this.obj.style.overflow=this._orig_overflow};var q=1,r=2,s=3;j.prototype._attr=function(a,b,c){a=a.replace(/-[a-z]/gi,function(a){return a.substring(1).toUpperCase()});var d=!1;switch(a){case"background":this._attr("backgroundColor",b,c);return this;case"backgroundColor":case"borderColor":case"color":b=w(b);break;case"opacity":b=parseFloat(b,10);break;case"height":case"width":b=="auto"?d=!0:b=parseInt(b,10);break;case"borderWidth":case"lineHeight":case"fontSize":case"margin":case"marginBottom":case"marginLeft":case"marginRight":case"marginTop":case"padding":case"paddingBottom":case"paddingLeft":case"paddingRight":case"paddingTop":case"bottom":case"left":case"right":case"top":case"scrollTop":case"scrollLeft":b=parseInt(b,10);break;case"rotateX":case"rotateY":case"rotateZ":b=parseInt(b,10)*Math.PI/180;break;case"translateX":case"translateY":case"translateZ":case"scaleX":case"scaleY":case"scaleZ":b=parseFloat(b,10);break;case"rotate3d":this._attr("rotateX",b[0],c);this._attr("rotateY",b[1],c);this._attr("rotateZ",b[2],c);return this;case"rotate":this._attr("rotateZ",b,c);return this;case"scale3d":this._attr("scaleZ",b[2],c);case"scale":this._attr("scaleX",b[0],c);this._attr("scaleY",b[1],c);return this;case"translate3d":this._attr("translateZ",b[2],c);case"translate":this._attr("translateX",b[0],c);this._attr("translateY",b[1],c);return this;default:throw new Error(a+" is not a supported attribute!")}this.state.attrs[a]===void 0&&(this.state.attrs[a]={});d&&(this.state.attrs[a].auto=!0);switch(c){case s:this.state.attrs[a].start=b;break;case r:this.state.attrs[a].by=!0;case q:this.state.attrs[a].value=b;break}};function t(a){var c,d=parseInt((c=b("Style")).get(a,"paddingLeft"),10),e=parseInt(c.get(a,"paddingRight"),10),f=parseInt(c.get(a,"borderLeftWidth"),10);c=parseInt(c.get(a,"borderRightWidth"),10);return a.offsetWidth-(d?d:0)-(e?e:0)-(f?f:0)-(c?c:0)}function u(a){var c,d=parseInt((c=b("Style")).get(a,"paddingTop"),10),e=parseInt(c.get(a,"paddingBottom"),10),f=parseInt(c.get(a,"borderTopWidth"),10);c=parseInt(c.get(a,"borderBottomWidth"),10);return a.offsetHeight-(d?d:0)-(e?e:0)-(f?f:0)-(c?c:0)}j.prototype.setUnit=function(a){this.unit=a;return this};j.prototype.to=function(a,b){b===void 0?this._attr(this.last_attr,a,q):(this._attr(a,b,q),this.last_attr=a);return this};j.prototype.by=function(a,b){b===void 0?this._attr(this.last_attr,a,r):(this._attr(a,b,r),this.last_attr=a);return this};j.prototype.from=function(a,b){b===void 0?this._attr(this.last_attr,a,s):(this._attr(a,b,s),this.last_attr=a);return this};j.prototype.duration=function(a){this.state.duration=a?a:0;return this};j.prototype.checkpoint=function(a,b){a===void 0&&(a=1);this.state.checkpoint=a;this.queue.push(this.state);this._reset_state();this.state.checkpointcb=b;return this};j.prototype.blind=function(){this.state.blind=!0;return this};j.prototype.hide=function(){this.state.hide=!0;return this};j.prototype.show=function(){this.state.show=!0;return this};j.prototype.ease=function(a){this.state.ease=a;return this};j.prototype.CSSAnimation=function(a){var b={duration:this.state.duration};this.state.ondone&&(b.callback=this.state.ondone);a(this.obj,b)};j.prototype.go=function(){var a=Date.now();this.queue.push(this.state);for(var b=0;bc){d=!1;continue}m.checkpointcb&&(this._callback(m.checkpointcb,c-m.start),m.checkpointcb=null);if(m.started===void 0){m.show&&this._show();for(var n in m.attrs){if(m.attrs[n].start!==void 0)continue;switch(n){case"backgroundColor":case"borderColor":case"color":f=w(b("Style").get(this.obj,n=="borderColor"?"borderLeftColor":n));m.attrs[n].by&&(m.attrs[n].value[0]=Math.min(255,Math.max(0,m.attrs[n].value[0]+f[0])),m.attrs[n].value[1]=Math.min(255,Math.max(0,m.attrs[n].value[1]+f[1])),m.attrs[n].value[2]=Math.min(255,Math.max(0,m.attrs[n].value[2]+f[2])));break;case"opacity":f=b("Style").getOpacity(this.obj);m.attrs[n].by&&(m.attrs[n].value=Math.min(1,Math.max(0,m.attrs[n].value+f)));break;case"height":f=u(this.obj);m.attrs[n].by&&(m.attrs[n].value+=f);break;case"width":f=t(this.obj);m.attrs[n].by&&(m.attrs[n].value+=f);break;case"scrollLeft":case"scrollTop":f=h(this.obj,n);m.attrs[n].by&&(m.attrs[n].value+=f);j(this,m);break;case"rotateX":case"rotateY":case"rotateZ":case"translateX":case"translateY":case"translateZ":f=b("DataStore").get(this.obj,n,0);m.attrs[n].by&&(m.attrs[n].value+=f);break;case"scaleX":case"scaleY":case"scaleZ":f=b("DataStore").get(this.obj,n,1);m.attrs[n].by&&(m.attrs[n].value+=f);break;default:f=parseInt(b("Style").get(this.obj,n),10)||0;m.attrs[n].by&&(m.attrs[n].value+=f);break}m.attrs[n].start=f}if(m.attrs.height&&m.attrs.height.auto||m.attrs.width&&m.attrs.width.auto){this._destroy_container();for(var n in{height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1})m.attrs[n]&&(this.obj.style[n]=m.attrs[n].value+(typeof m.attrs[n].value==="number"?this.unit:""));m.attrs.height&&m.attrs.height.auto&&(m.attrs.height.value=u(this.obj));m.attrs.width&&m.attrs.width.auto&&(m.attrs.width.value=t(this.obj))}m.started=!0;m.blind&&this._build_container()}var p=(c-m.start)/m.duration;p>=1?(p=1,m.hide&&this._hide()):d=!1;var q=m.ease?m.ease(p):p;!e&&p!=1&&m.blind&&(e=!0);for(var n in m.attrs)switch(n){case"backgroundColor":case"borderColor":case"color":m.attrs[n].start[3]!=m.attrs[n].value[3]?this.obj.style[n]="rgba("+v(q,m.attrs[n].start[0],m.attrs[n].value[0],!0)+","+v(q,m.attrs[n].start[1],m.attrs[n].value[1],!0)+","+v(q,m.attrs[n].start[2],m.attrs[n].value[2],!0)+","+v(q,m.attrs[n].start[3],m.attrs[n].value[3],!1)+")":this.obj.style[n]="rgb("+v(q,m.attrs[n].start[0],m.attrs[n].value[0],!0)+","+v(q,m.attrs[n].start[1],m.attrs[n].value[1],!0)+","+v(q,m.attrs[n].start[2],m.attrs[n].value[2],!0)+")";break;case"opacity":b("Style").set(this.obj,"opacity",v(q,m.attrs[n].start,m.attrs[n].value));break;case"height":case"width":this.obj.style[n]=q==1&&m.attrs[n].auto?"auto":v(q,m.attrs[n].start,m.attrs[n].value,!0)+this.unit;break;case"scrollLeft":case"scrollTop":var r=this.obj===document.body;if(!this.behaviorOverrides.ignoreUserScroll&&i(this,m))delete m.attrs.scrollTop,delete m.attrs.scrollLeft;else{var s=v(q,m.attrs[n].start,m.attrs[n].value,!0);!r?this.obj[n]=s:n=="scrollLeft"?a.scrollTo(s,g("scrollTop")):a.scrollTo(g("scrollLeft"),s);j(this,m)}break;case"translateX":case"translateY":case"translateZ":case"rotateX":case"rotateY":case"rotateZ":case"scaleX":case"scaleY":case"scaleZ":b("DataStore").set(this.obj,n,v(q,m.attrs[n].start,m.attrs[n].value,!1));break;default:this.obj.style[n]=v(q,m.attrs[n].start,m.attrs[n].value,!0)+this.unit;break}r=null;s=b("DataStore").get(this.obj,"translateX",0);q=b("DataStore").get(this.obj,"translateY",0);var x=b("DataStore").get(this.obj,"translateZ",0);(s||q||x)&&(r=o(r,[1,0,0,0,0,1,0,0,0,0,1,0,s,q,x,1]));s=b("DataStore").get(this.obj,"scaleX",1);q=b("DataStore").get(this.obj,"scaleY",1);x=b("DataStore").get(this.obj,"scaleZ",1);(s-1||q-1||x-1)&&(r=o(r,[s,0,0,0,0,q,0,0,0,0,x,0,0,0,0,1]));s=b("DataStore").get(this.obj,"rotateX",0);s&&(r=o(r,[1,0,0,0,0,Math.cos(s),Math.sin(-s),0,0,Math.sin(s),Math.cos(s),0,0,0,0,1]));q=b("DataStore").get(this.obj,"rotateY",0);q&&(r=o(r,[Math.cos(q),0,Math.sin(q),0,0,1,0,0,Math.sin(-q),0,Math.cos(q),0,0,0,0,1]));x=b("DataStore").get(this.obj,"rotateZ",0);x&&(r=o(r,[Math.cos(x),Math.sin(-x),0,0,Math.sin(x),Math.cos(x),0,0,0,0,1,0,0,0,0,1]));s=b("getVendorPrefixedName")("transform");if(s)if(r){q=k(r);b("Style").set(this.obj,s,q)}else d&&b("Style").set(this.obj,s,null);p==1&&(this.queue.splice(l--,1),this._callback(m.ondone,c-m.start-m.duration))}!e&&this.container_div&&this._destroy_container();return!d};j.prototype.ondone=function(a){this.state.ondone=a;return this};j.prototype._callback=function(a,b){a&&(p=b,a.call(this),p=0)};function v(a,b,c,d){return(d?parseInt:parseFloat)((c-b)*a+b,10)}function w(a){var b=/^#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i.exec(a);if(b)return[parseInt(b[1].length==1?b[1]+b[1]:b[1],16),parseInt(b[2].length==1?b[2]+b[2]:b[2],16),parseInt(b[3].length==1?b[3]+b[3]:b[3],16),1];else{b=/^rgba? *\(([0-9]+), *([0-9]+), *([0-9]+)(?:, *([0-9\.]+))?\)$/.exec(a);if(b)return[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),b[4]?parseFloat(b[4]):1];else if(a=="transparent")return[255,255,255,0];else throw new Error("Named color attributes are not supported.")}}function x(a){h.push(a),h.length===1&&(g?g(z):i=b("setIntervalAcrossTransitions")(z,20)),g&&y(),z(Date.now(),!0)}function y(){if(!g)throw new Error("Ending timer only valid with requestAnimationFrame");var a=0;for(var c=0;ca&&(a=f)}}i&&(b("clearTimeout")(i),i=null);f=Date.now();a>f&&(i=b("setTimeoutAcrossTransitions")(b("shield")(z),a-f))}function z(a,c){a=Date.now();for(var c=c===!0?h.length-1:0;c=u){this.$2.bumpCounter(m+"409_reset");this.$27(new Error("Too many 409 errors"));return}}this.$24(a,b,c,this.$28(d));return}this.$2.bumpCounter(m+"publish_request_success");b=a.map(function(a){return a.topic}).join(",");this.$2.debugTrace("FetchClient","Fetch publish request success. Publishes:"+b+", retry:"+c);this.$22(a);this.$18=!1;this.$21()};c.$21=function(){if(this.$14!="ReceivingData")return;if(this.$18)return;if(this.$15.length==0&&this.$16.length==0)return;this.$18=!0;var a=this.$15.slice(0,t);this.$15=this.$15.slice(t,this.$15.length);clearTimeout(this.$17);this.$17=null;var b=this.$16.slice(0,t);this.$16=this.$16.slice(t,this.$16.length);this.$25(a,b,0)};c.$25=function(a,c,d){var e=this,f=a.map(function(a){return a.topic}).join(",");this.$2.debugTrace("FetchClient","Fetch publish request sent. Publishes:"+f+", retry:"+d);f=b("MqttUtils").endpointWithExtraParameter(this.$1,o,q);var h=a.map(function(a){return{topic:a.topic,payload:a.payload,qos:0,messageId:g.random()}});h=this.$5.gen(this.$3,[],h,c);this.$2.bumpCounter(m+"publish_request");b("MqttUtils").promiseDoneWithTimeout(fetch(f,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",referrer:"no-referrer",body:h,keepalive:!1}),function(b){return e.$26(a,c,d,b)},function(b){return e.$24(a,c,d,b)},n)};c.$29=function(a){a=a.message;this.$2.debugTrace("FetchClient","Fetch request failed with error:"+a);this.$9(a);this.$30(!1,a);this.$2.bumpCounter(m+"error");this.$14="Error"};c.$31=function(a){var b=this;this.$2.debugTrace("FetchClient","Fetch response data received");a=i(new Uint8Array(a));a=a.messages;var c=a.filter(function(a){return a.messageType===j.PINGREQ});a=a.filter(function(a){return a.messageType===j.PUBLISH}).map(function(a){if(!(a instanceof h.Publish))return{};a=a;a.qos===1&&a.messageIdentifier!=null&&(b.$16.push(a.messageIdentifier),b.$17==null&&(b.$17=g.setTimeout(function(){b.$21()},v)));return{topic:a.topic,payload:a.payloadMessage.payloadString,qos:a.qos}});for(var d=a,e=Array.isArray(d),f=0,d=e?d:d[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var k;if(e){if(f>=d.length)break;k=d[f++]}else{f=d.next();if(f.done)break;k=f.value}k=k;this.$2.bumpCounter(m+"response_"+k.topic)}a&&a.length>0&&(this.$13+=a.length,this.$7(a));c&&c.length>0&&this.$32()};c.$32=function(){this.$2.debugTrace("FetchClient","Got server ping request"),this.$2.bumpCounter(m+"ping")};c.$27=function(a){this.$2.debugTrace("FetchClient","Fetch request ended: "+a.toString()),this.$2.bumpCounter(m+"done"),this.$33(a.message),this.$8(),this.$14="Done"};c.$34=function(a,c,d){var e=this;if(d!==null&&d!==void 0)try{this.$31(d)}catch(a){this.$27(a);this.$2.bumpCounter(m+"dataDecodeException");return}if(c){this.$27(new Error("EOF"));return}b("MqttUtils").promiseDone(a.read(),function(c){var b=c.done;c=c.value;return e.$34(a,b,c)},function(a){return e.$27(a)})};c.$35=function(a){if(!a.ok){this.$2.bumpCounter(m+"error.http."+a.status);this.$29(this.$28(a));return}a=a.body;if(!a){this.$29(new Error("Empty body"));return}a=a.getReader();this.$6();this.$2.bumpCounter(m+"success");this.$30(!0,null);this.$11=Date.now();this.$14="ReceivingData";this.$2.debugTrace("FetchClient","Fetch request success");this.$34(a,!1,null)};c.$33=function(a){this.$2.eventLogPullFinish({pullEventName:l,sessionID:this.$3,duration:Date.now()-this.$11,errorMessage:a,publishReceived:this.$13,publishSent:this.$12})};c.$30=function(a,b){this.$2.eventLogPull({pullEventName:k,sessionID:this.$3,status:a,duration:Date.now()-this.$10,hostname:this.$1,errorMessage:b})};c.$20=function(){var a=this;if(this.$14!="Ready")return;this.$2.debugTrace("FetchClient","Sending fetch request");this.$2.bumpCounter(m+"request");this.$10=Date.now();var c=b("MqttUtils").endpointWithExtraParameter(this.$1,p,r);b("MqttUtils").promiseDoneWithTimeout(fetch(c,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",referrer:"no-referrer",body:this.$4,keepalive:!1}),function(b){return a.$35(b)},function(b){return a.$29(b)},n)};c.$28=function(a){return new Error("Http error, status="+a.status)};return a}();e.exports=a}),null); __d("MqttLongPollingClient",["Promise","MqttEnv","MqttProtocolCodec","XHRRequest","getCrossOriginTransport"],(function(a,b,c,d,e,f){"use strict";var g=b("MqttEnv").Env,h=b("MqttProtocolCodec").WireMessage,i=b("MqttProtocolCodec").decodeByteMessages,j=120*1e3,k="simple_pull";a=function(){function a(){this.$3="",this.$4=0,this.$2=g.getLoggerInstance(),this.$1="Ready",this.$5="",this.$7=function(){},this.$8=function(a){},this.$9=function(){},this.$10=function(a){},this.$11=0,this.$12=null,this.$13=new Set(["/t_ms","/messenger_sync_get_diffs","/messenger_sync_create_queue","/webrtc","/rtc_multi"])}var c=a.prototype;c.run=function(a,b,c,d,e,f,g,h){this.$3=a,this.$4=b,this.$5=c,this.$6=d,this.$7=e,this.$8=f,this.$9=g,this.$10=h,this.$14(this.$5)};c.isTopicSupported=function(a){return this.$13.has(a)};c.publish=function(a,c){return b("Promise").reject("not supported")};c.abort=function(){this.$12!=null&&this.$12.abort("Disconnected")};c.$15=function(a,b){if(this.$1===a)return;this.$1=a;a=="Error"&&b!=null&&this.$10(b)};c.$16=function(a){if(this.$1!="RequestSend")return;if(!a){this.$17("EmptyResponse",null);return}this.$7();this.$18(!0,null);this.$15("ResponseReceived");a=i(new Uint8Array(a));a=a.messages.filter(function(a){return a instanceof h.Publish}).map(function(a){if(a instanceof h.Publish){a=a;return{topic:a.topic,payload:a.payloadMessage.payloadString,qos:a.qos}}else return{}});this.$8(a);this.$9()};c.$17=function(a,b){b=b!=null?b.message:"null";this.$2.debugTrace("LongPollingClient Error","Poll failed with error:"+a+", errorMsg:"+b);this.$18(!1,a+":"+b);this.$15("Error",a)};c.$18=function(a,b){this.$2.eventLogPull({pullEventName:k,sessionID:this.$4,status:a,duration:Date.now()-this.$11,hostname:this.$3,errorMessage:b})};c.$14=function(a){var c=this;if(this.$1!="Ready"||this.$12)return;try{this.$11=Date.now(),this.$12=new(b("XHRRequest"))(this.$3).setResponseType("arraybuffer").setRawData(a).setTransportBuilder(b("getCrossOriginTransport").withCredentials).setResponseHandler(function(a){return c.$16(a)}).setNetworkFailureHandler(function(a){c.$17("Network",a)}).setErrorHandler(function(a){c.$17("Error",a)}).setAbortHandler(function(a){c.$17("Abort",null)}).setTimeoutHandler(function(){c.$17("Timeout",null)}).setTimeout(j).send(),this.$15("RequestSend")}catch(a){this.$17("Error",a)}};return a}();e.exports=a}),null); __d("exponentialBackoff",["MqttEnv"],(function(a,b,c,d,e,f){var g=b("MqttEnv").Env;function a(a,b){b===void 0&&(b=null);var c=null,d=0;function e(){for(var e=arguments.length,f=new Array(e),h=0;h=j&&this.$24("LPError")};c.$28=function(){var a=g.genGk(h.mqtt_lp_no_delay),b=g.genGk(h.mqtt_ws_polling_enabled),c=g.genGk(h.mqtt_fast_lp);this.$5.debugTrace("LongPollingRunner","_shouldPoll? pollNow:"+String(a)+" enabled:"+String(b)+" fastPoll:"+String(c)+" hasWSSupport:"+String(this.$4)+" hasSuccess:"+String(this.$1)+" failureCount:"+this.$2+" wsFatal:"+String(this.$3));if(!b)return!1;if(a){this.$5.bumpCounter(m+".nd");return!0}if(!this.$4){this.$5.bumpCounter(m+".na");return!0}if(this.$3){this.$5.bumpCounter(m+".fatal");return!0}if(this.$1)return!1;if(c){b=Date.now()-this.$20;if(this.$21===o){if(this.$2>=1)return!0;if(b>k){this.$5.bumpCounter(m+".fastdelay");return!0}}else if(b>l){this.$5.bumpCounter(m+".regulardelay");return!0}}if(this.$2>=3){this.$5.bumpCounter(m+".failure");return!0}return!1};c.$29=function(){if(this.$14!=null)return!1;var a=this.$28();!this.$13&&a&&(this.$5.bumpCounter("polling_kickin"),this.$13=!0,this.$24("LPActive"),this.$26());this.$13&&!a&&(this.$5.bumpCounter("polling_stopped"),this.$13=!1,this.$24("LPInactive"),this.$26());return a};c.$30=function(){if(this.$22){this.$5.debugTrace("LongPollingRunner","Creating polling client using Fetch API");return new(b("MqttFetchClient"))()}else{this.$5.debugTrace("LongPollingRunner","Creating regular Polling client");return new(b("MqttLongPollingClient"))()}};c.$31=function(){this.$5.debugTrace("LongPollingRunner","Poll success"),this.$19.onPollRequestSuccess(),this.$18.reset(),this.$24("LPActive"),this.$26(),g.configWrite(n,o),this.$25("ReceivingData")};c.$32=function(a){var b=a.map(function(a){return a.topic}).join(",");this.$5.debugTrace("LongPollingRunner","Poll response received, message received:"+b);for(var b=0;b