;/*FB_PKG_DELIM*/

__d("Base64",[],(function(t,n,r,o,a,i){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function l(t){var n=t.charCodeAt(0)<<16|t.charCodeAt(1)<<8|t.charCodeAt(2);return String.fromCharCode(e.charCodeAt(n>>>18),e.charCodeAt(n>>>12&63),e.charCodeAt(n>>>6&63),e.charCodeAt(n&63))}var s=">___?456789:;<=_______\0\x07\b	\n\v\f\r______\x1B !\"#$%&'()*+,-./0123";function u(e){var t=s.charCodeAt(e.charCodeAt(0)-43)<<18|s.charCodeAt(e.charCodeAt(1)-43)<<12|s.charCodeAt(e.charCodeAt(2)-43)<<6|s.charCodeAt(e.charCodeAt(3)-43);return String.fromCharCode(t>>>16,t>>>8&255,t&255)}var c={encode:function(t){var e=unescape(encodeURI(t)),n=(e.length+2)%3;return e=(e+"\0\0".slice(n)).replace(/[\s\S]{3}/g,l),e.slice(0,e.length+n-2)+"==".slice(n)},decode:function(t){var e=t.replace(/[^A-Za-z0-9+\/]/g,""),n=e.length+3&3;e=(e+"AAA".slice(n)).replace(/..../g,u),e=e.slice(0,e.length+n-3);try{return decodeURIComponent(escape(e))}catch(e){var r=new Error("Not valid UTF-8");throw r.stack,r}},encodeObject:function(t){return c.encode(JSON.stringify(t))},decodeObject:function(t){return JSON.parse(c.decode(t))},encodeNums:function(n){return String.fromCharCode.apply(String,n.map(function(t){return e.charCodeAt((t|-(t>63?1:0))&-(t>0?1:0)&63)}))}},d=c;i.default=d}),66);
__d("IDGWLoggingContext",["$InternalEnum"],(function(t,n,r,o,a,i){"use strict";var e=n("$InternalEnum")({STREAM_GROUP_COMPONENT:"WebStreamGroup",GROUPED_STREAM_COMPONENT:"GroupedWebStream",WEBSOCKET_TRANSPORT_COMPONENT:"WebSocketTransport",ACK_MANAGER_COMPONENT:"WebStreamAckManager",CODEC_COMPONENT:"WebCodec",RAW_CLIENT:"RAWDGWClient",PINGER:"DGWPinger"}),l=n("$InternalEnum")({STREAM_LIFECYCLE:"stream_lifecycle",STREAM_GROUP_TRANSPORT:"stream_group_transport"}),s=n("$InternalEnum")({SUCCESS:"success",FAIL:"fail"});i.DGWLoggingComponent=e,i.QPLEvent=l,i.QPLResult=s}),66);
__d("DGWAckManager",["IDGWLoggingContext","getErrorSafe"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(e,t,n){var r=this;this.$3=n,this.sendId=e,this.$2=t,this.handleAckReceived=function(){r.stopTracking(!0)},this.$1=window.setTimeout(function(){r.stopTracking(!1)},t)}var t=e.prototype;return t.stopTracking=function(t){window.clearTimeout(this.$1),this.$3(t)},e})(),s=(function(){function t(e){this.$1=new Map,this.$2=e,this.$3=!1}var n=t.prototype;return n.wasTransportClosed=function(){return this.$3},n.waitForAck=async function(n,a){this.$2.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"ack_expected");var t=this.$1;try{var i=await new Promise(function(r,o){t.set(n,new e(n,a,r))});return i===!0?this.$2.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"Received ACK","sendId:"+n,!0):(this.$2.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"ack_timeout"),this.$2.logWarn(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"ACK timeout","Request "+n+" timed out after "+a+"ms")),t.delete(n),i}catch(e){var l=r("getErrorSafe")(e);throw this.$2.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"ack_error"),t.delete(n),l}},n.handleAckReceived=function(t){this.$2.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"ack_received");var e=this.$1.get(t);if(e===void 0){this.$2.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"ack_received.not_tracked"),this.$2.logWarn(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"untracked ACK","Received ACK for ackId "+t+" which was not being tracked");return}e.handleAckReceived()},n.clearPendingAcks=function(){var e=this;this.$3=!0,this.$2.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"Clearing pending acks","ACKs cleared size: "+this.$1.size),this.$1.forEach(function(t,n,r){e.$2.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT,"Clearing pending ACK with ackId "+t.sendId,null,!0),t.stopTracking(!1),r.delete(n)})},t})();l.DGWAckManager=s}),98);
__d("DGWAuth",["$InternalEnum","err"],(function(t,n,r,o,a,i,l){"use strict";var e=n("$InternalEnum")({TEST:"0:0",FACEBOOK:"1:0",INTERNALFB:"2:0",OCULUS:"3:0",ENTERPRISEFB:"7:0",RECRUITINGFB:"8:0",INSTAGRAM:"6:0",HORIZON_WEB:"12:0",SPARK_WEB:"13:0",ABRA:"15:0",GUEST:"19:0",DEV_HUB:"22:0"});function s(t){if(t==="TEST")return e.TEST;if(t==="FACEBOOK")return e.FACEBOOK;if(t==="INTERNALFB")return e.INTERNALFB;if(t==="OCULUS")return e.OCULUS;if(t==="ENTERPRISEFB")return e.ENTERPRISEFB;if(t==="RECRUITINGFB")return e.RECRUITINGFB;if(t==="INSTAGRAM")return e.INSTAGRAM;if(t==="HORIZON_WEB")return e.HORIZON_WEB;if(t==="SPARK_WEB")return e.SPARK_WEB;if(t==="ABRA")return e.ABRA;if(t==="GUEST")return e.GUEST;if(t==="DEV_HUB")return e.DEV_HUB;throw r("err")("failed to convert string to DGWAuth Type")}function u(t){if(t===e.TEST)return"TEST";if(t===e.FACEBOOK)return"FACEBOOK";if(t===e.INTERNALFB)return"INTERNALFB";if(t===e.OCULUS)return"OCULUS";if(t===e.ENTERPRISEFB)return"ENTERPRISEFB";if(t===e.RECRUITINGFB)return"RECRUITINGFB";if(t===e.INSTAGRAM)return"INSTAGRAM";if(t===e.HORIZON_WEB)return"HORIZON_WEB";if(t===e.SPARK_WEB)return"SPARK_WEB";if(t===e.ABRA)return"ABRA";if(t===e.GUEST)return"GUEST";if(t===e.DEV_HUB)return"DEV_HUB";throw r("err")("failed to convert DGWAuth to string")}l.DGWAuth=e,l.fromStringToDGWAuth=s,l.fromDGWAuthToString=u}),98);
__d("DGWGlobalLogger",["gkx","uuidv4"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(){var e=this;this.tabID=r("uuidv4")(),this.isTabClosed=!1,this.otherTabs=new Map,this.thisTab={realtime:0,lightspeed:0},this.broadcastChannel=this.$1("DGWGlobalLogger"),this.broadcastChannel.onmessage=function(t){var n=JSON.parse(String(t.data)),r=!e.otherTabs.has(n.key);n.event==="DELETE"?e.otherTabs.delete(n.key):n.event==="UPDATE"&&n.value!=null&&(e.otherTabs.set(n.key,n.value),r&&e.$2())}}var t=e.prototype;return t.$1=function(t){return window.BroadcastChannel!=null?new BroadcastChannel(t):{onmessage:function(t){},postMessage:function(t){}}},t.streamRequested=function(t){switch(t){case"realtime":this.thisTab.realtime++;break;case"lightspeed":this.thisTab.lightspeed++;break}this.$2()},t.streamClosed=function(t){switch(t){case"realtime":this.thisTab.realtime=Math.max(0,this.thisTab.realtime-1);break;case"lightspeed":this.thisTab.lightspeed=Math.max(0,this.thisTab.lightspeed-1);break}this.$2()},t.tabClosed=function(){if(!this.isTabClosed){this.isTabClosed=!0;var e={key:this.tabID,event:"DELETE"};this.broadcastChannel.postMessage(JSON.stringify(e))}},t.getGlobalState=function(){var e={realtime:this.thisTab.realtime,lightspeed:this.thisTab.lightspeed};return this.otherTabs.forEach(function(t){e.realtime+=t.realtime,e.lightspeed+=t.lightspeed}),e},t.$2=function(){var e={key:this.tabID,event:"UPDATE",value:this.thisTab};this.broadcastChannel.postMessage(JSON.stringify(e))},e})(),s=r("gkx")("4337")?new e:{streamRequested:function(){},streamClosed:function(){},tabClosed:function(){},getGlobalState:function(){return{realtime:-1,lightspeed:-1}}},u=function(){return s};l.getInstance=u}),98);
__d("DgwClientFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(t,n,r,o,a,i,l){"use strict";var e=r("getFalcoLogPolicy_DO_NOT_USE")("1755537"),s=o("FalcoLoggerInternal").create("dgw_client",e),u=s;l.default=u}),98);
__d("DGWLoggingContext",["DGWGlobalLogger","DgwClientFalcoEvent","IDGWLoggingContext","ODS","QuickPerformanceLogger","Random","qpl"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u="dgw_client",c=r("qpl")._(701242292,"2919"),d=r("qpl")._(701238781,"3037"),m={VERBOSE:-1,INFO:0,WARNING:1,ERROR:2,FATAL:3};function p(e){switch(e){case o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT:case o("IDGWLoggingContext").DGWLoggingComponent.ACK_MANAGER_COMPONENT:return!0;default:return!1}}var _=(function(){function t(e,t,n,r,o,a,i){a===void 0&&(a=!1),i===void 0&&(i=!1),this.$5=""+e,this.$1=t,this.$4=n,this.$3=r,this.sgTransportId=o,this.$2=a,this.$6=i}var n=t.prototype;return n.getGlobalLogger=function(){return o("DGWGlobalLogger").getInstance()},t.bumpODSKey=function(t,n,r){if(r===void 0&&(r=1),!!o("Random").coinflip(r)){var e=t+"."+n;(s||(s=o("ODS"))).bumpEntityKey(3589,"dgw_web_client",e,r)}},n.bumpODSKey=function(t,n,r){if(r===void 0&&(r=1),!!o("Random").coinflip(r)){var e=this.$4+"."+t+"."+n;(s||(s=o("ODS"))).bumpEntityKey(3589,"dgw_web_client",e,r)}},n.logEvent=function(t,n,r,o,a){o===void 0&&(o=!1),this.$2||this.$7(t,n,null,m.INFO,r,o,a)},n.$7=function(t,n,o,a,i,l,s){var e=this;l===void 0&&(l=!1),!(l&&!this.$6)&&(p(t)&&this.$1!=null||!p(t)&&this.sgTransportId!=null)&&r("DgwClientFalcoEvent").log(function(){return{event:n,logging_id:s!=null?s:e.$1,dgw_version:e.$5,message:o,severity:a,uuid:e.$3,dgw_component:t,extra_info:i,destination_tier:e.$4,sg_transport_id:e.sgTransportId,source:2}})},n.logError=function(t,n,r,o,a,i){a===void 0&&(a=!1),this.$2||this.$7(t,n,r,m.ERROR,o,a,i)},n.logWarn=function(t,n,r,o,a){a===void 0&&(a=!1),this.$2||this.$7(t,n,r,m.WARNING,o,a)},n.$8=function(t){switch(t){case o("IDGWLoggingContext").QPLEvent.STREAM_LIFECYCLE:return c;case o("IDGWLoggingContext").QPLEvent.STREAM_GROUP_TRANSPORT:return d}},n.qplMarkerStart=function(n,o){(e||(e=r("QuickPerformanceLogger"))).markerStart(this.$8(n),o)},n.qplMarkerEnd=function(n,a,i){var t=a===o("IDGWLoggingContext").QPLResult.SUCCESS?2:3;(e||(e=r("QuickPerformanceLogger"))).markerEnd(this.$8(n),t,i)},n.qplMarkerPoint=function(n,o,a){(e||(e=r("QuickPerformanceLogger"))).markerPoint(this.$8(n),o,{instanceKey:a})},n.qplMarkerAnnotate=function(n,o,a){(e||(e=r("QuickPerformanceLogger"))).markerAnnotate(this.$8(n),o,{instanceKey:a})},t})();l.DGWLoggingComponent=o("IDGWLoggingContext").DGWLoggingComponent,l.QPLEvent=o("IDGWLoggingContext").QPLEvent,l.QPLResult=o("IDGWLoggingContext").QPLResult,l.DGW_MODULE=u,l.DGWLoggingContext=_}),98);
__d("DGWStream",["$InternalEnum"],(function(t,n,r,o,a,i){"use strict";var e=n("$InternalEnum").Mirrored(["ABNORMAL_CLOSURE","GOING_AWAY","SERVER_INTERNAL_ERROR","PREMATURE_CLOSE","UNKNOWN_ERROR","KEEPALIVE_TIMEOUT","TRANSPORT_CLOSED_BEFORE_STREAM_INIT","TRANSPORT_ESTABLISHMENT_ERROR","TRANSPORT_ESTABLISHMENT_TIMEOUT","ESTABLISHMENT_TIMEOUT","UNAUTHENTICATED","UNAUTHORIZED","REJECTED","BAD_REQUEST","DGW_SERVER_ERROR","ESTABLISHMENT_ERROR","ACK_TIMEOUT","ACK_TRANSPORT_CLOSED"]);function l(t){switch(t){case e.UNAUTHENTICATED:case e.UNAUTHORIZED:case e.REJECTED:case e.BAD_REQUEST:case e.UNKNOWN_ERROR:case e.SERVER_INTERNAL_ERROR:return!1;default:return!0}}function s(t){var n=u(t);return n!=null?e.getName(n):String(t)}function u(t){if(t instanceof Error){var n=t.message;if(e.isValid(n))return e.cast(n)}}i.StreamError=e,i.isRetryableError=l,i.streamErrorMessage=s,i.toStreamError=u}),66);
__d("DGWCppBridge",[],(function(t,n,r,o,a,i){var e=(function(){var e=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return(function(t){t=t||{};var t=typeof t!="undefined"?t:{},n=(function(){function e(){}function t(e,t){return function(){e.apply(t,arguments)}}function n(e){if(!(this instanceof n))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function r(e,t){for(;e._state===3;)e=e._value;if(e._state===0){e._deferreds.push(t);return}e._handled=!0,n._immediateFn(function(){var n=e._state===1?t.onFulfilled:t.onRejected;if(n===null){(e._state===1?o:a)(t.promise,e._value);return}var r;try{r=n(e._value)}catch(e){a(t.promise,e);return}o(t.promise,r)})}function o(e,r){try{if(r===e)throw new TypeError("A promise cannot be resolved with itself.");if(r&&(typeof r=="object"||typeof r=="function")){var o=r.then;if(r instanceof n){e._state=3,e._value=r,i(e);return}else if(typeof o=="function"){s(t(o,r),e);return}}e._state=1,e._value=r,i(e)}catch(t){a(e,t)}}function a(e,t){e._state=2,e._value=t,i(e)}function i(e){e._state===2&&e._deferreds.length===0&&n._immediateFn(function(){e._handled||n._unhandledRejectionFn(e._value)});for(var t=0,o=e._deferreds.length;t<o;t++)r(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=n}function s(e,t){var n=!1;try{e(function(e){n||(n=!0,o(t,e))},function(e){n||(n=!0,a(t,e))})}catch(e){if(n)return;n=!0,a(t,e)}}return n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(t,n){var o=new this.constructor(e);return r(this,new l(t,n,o)),o},n.all=function(e){return new n(function(t,n){if(!Array.isArray(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(r.length===0)return t([]);var o=r.length;function a(e,i){try{if(i&&(typeof i=="object"||typeof i=="function")){var l=i.then;if(typeof l=="function"){l.call(i,function(t){a(e,t)},n);return}}r[e]=i,--o===0&&t(r)}catch(e){n(e)}}for(var i=0;i<r.length;i++)a(i,r[i])})},n.resolve=function(e){return e&&typeof e=="object"&&e.constructor===n?e:new n(function(t){t(e)})},n.reject=function(e){return new n(function(t,n){n(e)})},n.race=function(e){return new n(function(t,r){if(!Array.isArray(e))return r(new TypeError("Promise.race accepts an array"));for(var o=0,a=e.length;o<a;o++)n.resolve(e[o]).then(t,r)})},n._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){setTimeout(e,0)},n._unhandledRejectionFn=function(t){},n})(),r,o;t.ready=new n(function(e,t){r=e,o=t});var a={},i;for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(a[i]=t[i]);var l=[],s="./this.program",u=function(t,n){throw n},c=!0,d=!1,m="";function p(e){return t.locateFile?t.locateFile(e,m):m+e}var _,f,g,h;typeof document!="undefined"&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m.indexOf("blob:")!==0?m=m.substr(0,m.lastIndexOf("/")+1):m="",_=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=ge(t);if(n)return pe(n);throw e}},f=function(t,n,r){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){if(e.status==200||e.status==0&&e.response){n(e.response);return}var o=ge(t);if(o){n(o.buffer);return}r()},e.onerror=r,e.send(null)},h=function(t){document.title=t};var y=t.print||console.log.bind(console),C=t.printErr||console.warn.bind(console);for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i]);a=null,t.arguments&&(l=t.arguments),t.thisProgram&&(s=t.thisProgram),t.quit&&(u=t.quit);var b;t.wasmBinary&&(b=t.wasmBinary);var v=t.noExitRuntime||!0,S={Memory:function(t){this.buffer=new ArrayBuffer(t.initial*65536)},Module:function(t){},Instance:function(t,n){this.exports=(function(t){function e(e){return e.set=function(e,t){this[e]=t},e.get=function(e){return this[e]},e}for(var n,r=new Uint8Array(123),o=25;o>=0;--o)r[48+o]=52+o,r[65+o]=o,r[97+o]=26+o;r[43]=62,r[47]=63;function a(e,t,n){for(var o,a,i=0,l=t,s=n.length,u=t+(s*3>>2)-(n[s-2]=="=")-(n[s-1]=="=");i<s;i+=4)o=r[n.charCodeAt(i+1)],a=r[n.charCodeAt(i+2)],e[l++]=r[n.charCodeAt(i)]<<2|o>>4,l<u&&(e[l++]=o<<4|a>>2),l<u&&(e[l++]=a<<6|r[n.charCodeAt(i+3)])}function i(e){a(n,1024,"U3Q5dHlwZV9pbmZvAAAAAOAEAAAABAAATjEwX19jeHhhYml2MTE2X19zaGltX3R5cGVfaW5mb0UAAAAACAUAABgEAAAQBAAATjEwX19jeHhhYml2MTE3X19jbGFzc190eXBlX2luZm9FAAAACAUAAEgEAAA8BAAATjEwX19jeHhhYml2MTE3X19wYmFzZV90eXBlX2luZm9FAAAACAUAAHgEAAA8BAAATjEwX19jeHhhYml2MTE5X19wb2ludGVyX3R5cGVfaW5mb0UACAUAAKgEAACcBAAAAAAAAGwEAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAAAAABQBQAAAQAAAAkAAAADAAAABAAAAAUAAAAKAAAACwAAAAwAAABOMTBfX2N4eGFiaXYxMjBfX3NpX2NsYXNzX3R5cGVfaW5mb0UAAAAACAUAACgFAABsBA=="),a(n,1372,"gAkQ")}function l(t){var r=t.a,o=r.buffer;r.grow=Le;var a=new Int8Array(o),l=new Int16Array(o),s=new Int32Array(o),u=new Uint8Array(o),c=new Uint16Array(o),d=new Uint32Array(o),m=new Float32Array(o),p=new Float64Array(o),_=Math.imul,f=Math.fround,g=Math.abs,h=Math.clz32,y=Math.min,C=Math.max,b=Math.floor,v=Math.ceil,S=Math.trunc,R=Math.sqrt,L=t.abort,E=NaN,k=1/0,I=t.b,T=1051008,D=0;function x(e,t,n,r,o,i){e=e|0,t=t|0,n=n|0,r=r|0,o=o|0,i=i|0;var m=0,p=0,f=0;m=T-80|0,T=m,s[m+72>>2]=e,s[m+68>>2]=t,s[m+64>>2]=n,s[m+60>>2]=r,s[m+56>>2]=o,s[m+52>>2]=i;e:{if(!s[m+52>>2]||!s[m+56>>2]|(!s[m+72>>2]|!s[m+68>>2]|(!s[m+64>>2]|!s[m+60>>2]))){s[m+76>>2]=5;break e}s[s[m+64>>2]>>2]=0,s[s[m+60>>2]>>2]=0,t=s[m+68>>2],n=s[m+56>>2],r=s[m+52>>2],e=T+-64|0,T=e,s[e+56>>2]=s[m+72>>2],s[e+52>>2]=t,s[e+48>>2]=n,s[e+44>>2]=r,s[e+40>>2]=0,s[e+36>>2]=s[e+56>>2];t:{n:{r:{for(;;){if(!s[e+52>>2])break n;if(s[e+32>>2]=s[e+36>>2],a[e+31|0]=u[s[e+36>>2]],s[e+52>>2]=s[e+52>>2]-1,s[e+36>>2]=s[e+36>>2]+1,u[e+31|0]==10||u[e+31|0]==2|u[e+31|0]==4|u[e+31|0]==9){s[e+40>>2]=s[e+40>>2]+1;continue}if(s[e+24>>2]=1,J(u[e+31|0])&1){if(p=e,f=ee(u[e+31|0])&1,a[p+23|0]=f,s[e+16>>2]=a[e+23|0]&1?1:2,d[e+52>>2]<d[e+16>>2]){s[s[e+48>>2]>>2]=s[e+32>>2],s[s[e+44>>2]>>2]=s[e+52>>2]+s[e+24>>2];break t}if(s[e+52>>2]=s[e+52>>2]-s[e+16>>2],s[e+24>>2]=s[e+16>>2]+s[e+24>>2],s[e+36>>2]=s[e+16>>2]+s[e+36>>2],!(u[e+31|0]!=14&&u[e+31|0]!=8)){s[e+40>>2]=s[e+40>>2]+1;continue}}if(d[e+52>>2]<3)break r;if(s[e+12>>2]=0,t=s[e+36>>2],n=u[t|0]|u[t+1|0]<<8,a[e+12|0]=n,a[e+13|0]=n>>>8,a[e+14|0]=u[t+2|0],s[e+52>>2]=s[e+52>>2]-3,s[e+24>>2]=s[e+24>>2]+3,s[e+36>>2]=s[e+36>>2]+3,d[e+12>>2]<=d[e+52>>2]){s[e+40>>2]=s[e+40>>2]+1,s[e+36>>2]=s[e+12>>2]+s[e+36>>2],s[e+52>>2]=s[e+52>>2]-s[e+12>>2];continue}break}s[s[e+48>>2]>>2]=s[e+32>>2],s[s[e+44>>2]>>2]=s[e+52>>2]+s[e+24>>2];break t}s[s[e+48>>2]>>2]=s[e+32>>2],s[s[e+44>>2]>>2]=s[e+52>>2]+s[e+24>>2];break t}s[s[e+44>>2]>>2]=s[e+52>>2]}if(s[e+60>>2]=s[e+40>>2],T=e- -64|0,s[m+48>>2]=s[e+60>>2],!s[m+48>>2]){s[m+76>>2]=0;break e}if(p=m,f=$(_(s[m+48>>2],20)),s[p+44>>2]=f,!s[m+44>>2]){s[m+76>>2]=3;break e}for(s[m+40>>2]=s[m+44>>2],s[m+36>>2]=s[m+72>>2],s[m+32>>2]=s[m+68>>2]-s[s[m+52>>2]>>2],s[m+28>>2]=0;;){if(d[m+28>>2]<d[m+48>>2]){if(d[m+32>>2]<1){V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=1;break e}a[m+27|0]=u[s[m+36>>2]],s[m+36>>2]=s[m+36>>2]+1,s[m+32>>2]=s[m+32>>2]-1;t:{if(!u[m+27|0]|u[m+27|0]==1|(u[m+27|0]==2|u[m+27|0]==3)|(u[m+27|0]==4|u[m+27|0]==9|u[m+27|0]==10)||J(u[m+27|0])&1)break t;V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=6;break e}e=s[m+40>>2],s[e>>2]=u[m+27|0]&15|s[e>>2]&-16;t:{if(u[m+27|0]==10||u[m+27|0]==2|u[m+27|0]==4|u[m+27|0]==9){e=s[m+40>>2],s[e>>2]=s[e>>2]&-268435441,s[m+40>>2]=s[m+40>>2]+20;break t}if(J(u[m+27|0])&1){e=T-48|0,T=e,s[e+40>>2]=s[m+40>>2],s[e+36>>2]=m+36,s[e+32>>2]=m+32;n:{if(!(J(s[s[e+40>>2]>>2]&15)&1)){s[e+44>>2]=1;break n}if(p=e,f=ee(s[s[e+40>>2]>>2]&15)&1,a[p+31|0]=f,s[e+24>>2]=a[e+31|0]&1?1:2,d[s[e+32>>2]>>2]<d[e+24>>2]){s[e+44>>2]=1;break n}if(ae(s[e+40>>2]+4|0,s[s[e+36>>2]>>2],s[e+24>>2]),t=s[e+36>>2],s[t>>2]=s[e+24>>2]+s[t>>2],t=s[e+32>>2],s[t>>2]=s[t>>2]-s[e+24>>2],(s[s[e+40>>2]>>2]&15)==8){t=s[e+40>>2],s[t>>2]=s[t>>2]&-268435441,s[e+44>>2]=0;break n}if((s[s[e+40>>2]>>2]&15)==14){t=s[e+40>>2],s[t>>2]=s[t>>2]&-268435441,s[e+44>>2]=0;break n}if(d[s[e+32>>2]>>2]<3){s[e+44>>2]=11;break n}if(s[e+20>>2]=0,t=s[s[e+36>>2]>>2],n=u[t|0]|u[t+1|0]<<8,a[e+20|0]=n,a[e+21|0]=n>>>8,a[e+22|0]=u[t+2|0],t=s[e+36>>2],s[t>>2]=s[t>>2]+3,t=s[e+32>>2],s[t>>2]=s[t>>2]-3,t=s[e+40>>2],s[t>>2]=s[t>>2]&-268435441|(s[e+20>>2]&16777215)<<4,d[s[e+32>>2]>>2]<d[e+20>>2]){s[e+44>>2]=11;break n}if((s[s[e+40>>2]>>2]&15)==15){if(s[s[e+40>>2]+12>>2]=s[e+20>>2],t=$(s[e+20>>2]),s[s[e+40>>2]+8>>2]=t,!s[s[e+40>>2]+8>>2]){s[e+44>>2]=3;break n}ae(s[s[e+40>>2]+8>>2],s[s[e+36>>2]>>2],s[e+20>>2]),t=s[e+36>>2],s[t>>2]=s[e+20>>2]+s[t>>2],t=s[e+32>>2],s[t>>2]=s[t>>2]-s[e+20>>2],s[e+44>>2]=0;break n}if((s[s[e+40>>2]>>2]&15)==5){if(s[s[e+40>>2]+12>>2]=s[e+20>>2],t=$(s[e+20>>2]),s[s[e+40>>2]+8>>2]=t,!s[s[e+40>>2]+8>>2]){s[e+44>>2]=3;break n}ae(s[s[e+40>>2]+8>>2],s[s[e+36>>2]>>2],s[e+20>>2]),t=s[e+36>>2],s[t>>2]=s[e+20>>2]+s[t>>2],t=s[e+32>>2],s[t>>2]=s[t>>2]-s[e+20>>2],s[e+44>>2]=0;break n}r:{if(!((s[s[e+40>>2]>>2]&15)!=6&&(s[s[e+40>>2]>>2]&15)!=7)){if(p=e,f=G(s[e+36>>2],s[e+32>>2],e+19|0,e+18|0),s[p+12>>2]=f,s[e+12>>2]){s[e+44>>2]=s[e+12>>2];break n}break r}if(!((s[s[e+40>>2]>>2]&15)!=13&&(s[s[e+40>>2]>>2]&15)!=12)){n=s[e+32>>2],t=T-32|0,s[t+24>>2]=s[e+36>>2],s[t+20>>2]=n,s[t+16>>2]=e+19,s[t+12>>2]=e+16,l[t+10>>1]=0;o:{if(d[s[t+20>>2]>>2]<2){s[t+28>>2]=1;break o}n=s[s[t+24>>2]>>2],n=u[n|0]|u[n+1|0]<<8,a[t+10|0]=n,a[t+11|0]=n>>>8,n=s[t+24>>2],s[n>>2]=s[n>>2]+2,n=s[t+20>>2],s[n>>2]=s[n>>2]-2,a[s[t+16>>2]]=(c[t+10>>1]&32768)==32768,l[s[t+12>>2]>>1]=c[t+10>>1]&32767,s[t+28>>2]=0}if(s[e+12>>2]=s[t+28>>2],s[e+12>>2]){s[e+44>>2]=s[e+12>>2];break n}}}if((s[s[e+40>>2]>>2]&15)==12){t=s[e+40>>2],l[t+8>>1]=l[t+8>>1]&1|c[e+16>>1]<<1,s[e+44>>2]=0;break n}if((s[s[e+40>>2]>>2]&15)==7){t=s[e+40>>2],a[t+8|0]=a[t+8|0]&1|u[e+18|0]<<1,s[e+44>>2]=0;break n}if((s[s[e+40>>2]>>2]&15)==13){n=s[e+32>>2],r=s[e+20>>2],o=s[e+40>>2]+12|0,i=s[e+40>>2],t=T-32|0,T=t,s[t+24>>2]=s[e+36>>2],s[t+20>>2]=n,s[t+16>>2]=r,s[t+12>>2]=o,s[t+8>>2]=i+16;r:{if(d[t+16>>2]<2){s[t+28>>2]=9;break r}if(s[s[t+8>>2]>>2]=s[t+16>>2]-2,d[s[t+20>>2]>>2]<d[s[t+8>>2]>>2]){s[t+28>>2]=1;break r}if(n=$(s[s[t+8>>2]>>2]),s[s[t+12>>2]>>2]=n,!s[s[t+12>>2]>>2]){s[t+28>>2]=3;break r}ae(s[s[t+12>>2]>>2],s[s[t+24>>2]>>2],s[s[t+8>>2]>>2]),n=s[t+24>>2],s[n>>2]=s[s[t+8>>2]>>2]+s[n>>2],n=s[t+20>>2],s[n>>2]=s[n>>2]-s[s[t+8>>2]>>2],s[t+28>>2]=0}if(T=t+32|0,s[e+8>>2]=s[t+28>>2],s[e+8>>2]){s[e+44>>2]=s[e+8>>2];break n}t=s[e+40>>2],l[t+8>>1]=a[e+19|0]&1|c[t+8>>1]&65534,t=s[e+40>>2],l[t+8>>1]=l[t+8>>1]&1|c[e+16>>1]<<1,s[e+44>>2]=0;break n}if((s[s[e+40>>2]>>2]&15)==6){if(p=e,f=q(s[e+36>>2],s[e+32>>2],s[e+20>>2],s[e+40>>2]+12|0,s[e+40>>2]+16|0),s[p+4>>2]=f,s[e+4>>2]){s[e+44>>2]=s[e+4>>2];break n}t=s[e+40>>2],a[t+8|0]=a[e+19|0]&1|u[t+8|0]&254,t=s[e+40>>2],a[t+8|0]=a[t+8|0]&1|u[e+18|0]<<1,s[e+44>>2]=0;break n}s[e+44>>2]=1}if(T=e+48|0,s[m+20>>2]=s[e+44>>2],!s[m+20>>2]){s[m+40>>2]=s[m+40>>2]+20;break t}V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=s[m+20>>2];break e}if(s[m+16>>2]=0,d[m+32>>2]<3){V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=1;break e}if(e=s[m+36>>2],t=u[e|0]|u[e+1|0]<<8,a[m+16|0]=t,a[m+17|0]=t>>>8,a[m+18|0]=u[e+2|0],s[m+36>>2]=s[m+36>>2]+3,s[m+32>>2]=s[m+32>>2]-3,!(s[m+16>>2]==1|u[m+27|0]!=1)){V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=7;break e}if(e=s[m+40>>2],s[e>>2]=s[e>>2]&-268435441|(s[m+16>>2]&16777215)<<4,u[m+27|0]==3){if(s[m+16>>2]!=1){V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=10;break e}if(a[m+15|0]=0,d[m+32>>2]<1){O(s[m+44>>2]),s[m+76>>2]=1;break e}a[m+15|0]=u[s[m+36>>2]],s[m+36>>2]=s[m+36>>2]+1,s[m+32>>2]=s[m+32>>2]-1;n:{if(u[m+15|0]<=4){a[s[m+40>>2]+4|0]=u[m+15|0];break n}a[s[m+40>>2]+4|0]=4}s[m+40>>2]=s[m+40>>2]+20;break t}if(p=m,f=G(m+36|0,m+32|0,m+14|0,m+13|0),s[p+8>>2]=f,s[m+8>>2]){V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=s[m+8>>2];break e}if(u[m+27|0]==1){e=s[m+40>>2],a[e+4|0]=a[e+4|0]&1|u[m+13|0]<<1,s[m+40>>2]=s[m+40>>2]+20;break t}if(!u[m+27|0]){if(p=m,f=q(m+36|0,m+32|0,s[m+16>>2],s[m+40>>2]+8|0,s[m+40>>2]+12|0),s[p+4>>2]=f,s[m+4>>2]){V(s[m+44>>2],s[m+28>>2]),s[m+76>>2]=s[m+4>>2];break e}e=s[m+40>>2],a[e+4|0]=a[m+14|0]&1|u[e+4|0]&254,e=s[m+40>>2],a[e+4|0]=a[e+4|0]&1|u[m+13|0]<<1,s[m+40>>2]=s[m+40>>2]+20}}s[m+28>>2]=s[m+28>>2]+1;continue}break}if(s[m+32>>2]){V(s[m+44>>2],s[m+48>>2]),s[m+76>>2]=1;break e}s[s[m+64>>2]>>2]=s[m+44>>2],s[s[m+60>>2]>>2]=s[m+48>>2],s[m+76>>2]=0}return T=m+80|0,s[m+76>>2]}function $(e){var t=0,n=0,r=0,o=0,a=0,i=0,l=0,u=0,c=0,d=0,m=0;c=8;e:{t:{if(e>>>0>4294967239)break t;for(;;){c=c>>>0>8?c:8,n=s[603],a=n,o=s[602],l=o,e=e>>>0>8?e+3&-4:8;n:{if(e>>>0<=127){i=(e>>>3|0)-1|0;break n}if(r=h(e),i=((e>>>29-r^4)-(r<<2)|0)+110|0,e>>>0<=4095)break n;r=((e>>>30-r^2)-(r<<1)|0)+71|0,i=r>>>0<63?r:63}if(t=i,r=t&31,(t&63)>>>0>=32?(t=0,n=n>>>r|0):(t=n>>>r|0,n=((1<<r)-1&n)<<32-r|l>>>r),r=t,n|t){for(;;){a=n,t=r;n:{if(t|n){o=t-1|0,u=o+1|0,l=o,o=n-1|0,l=(o|0)!=-1?u:l,o=h(n^o)+32|0,n=h(t^l),n=(n|0)==32?o:n,t=63-n|0,D=0-(n>>>0>63)|0;break n}D=0,t=64}o=t,t=o,n=t&31,(t&63)>>>0>=32?(t=0,l=r>>>n|0):(t=r>>>n|0,l=((1<<n)-1&r)<<32-n|a>>>n),r=t,i=o+i|0,a=i<<4,t=s[a+1384>>2],o=a+1376|0;n:{if((t|0)!=(o|0)){if(n=F(t,c,e),n)break t;n=s[t+4>>2],s[n+8>>2]=s[t+8>>2],s[s[t+8>>2]+4>>2]=n,s[t+8>>2]=o,n=a+1380|0,s[t+4>>2]=s[n>>2],s[n>>2]=t,s[s[t+4>>2]+8>>2]=t,i=i+1|0,n=(r&1)<<31|l>>>1,r=r>>>1|0;break n}d=s[603],t=i,u=t&63,n=u,a=n&31,n>>>0>=32?(n=0,o=-1>>>a|0):(n=-1>>>a|0,o=(1<<a)-1<<32-a|-1>>>a),o=o&-2,a=u&31,u>>>0>=32?(n=o<<a,u=0):(n=(1<<a)-1&o>>>32-a|n<<a,u=o<<a),a=n,o=0-t&63,n=o,t=n&31,n>>>0>=32?(n=-1<<t,t=0):(n=(1<<t)-1&-1>>>32-t|-1<<t,t=-1<<t),m=t&-2,t=o&31,o>>>0>=32?(o=0,t=n>>>t|0):(o=n>>>t|0,t=((1<<t)-1&n)<<32-t|m>>>t),n=t|u,D=a|o,s[602]=s[602]&n,s[603]=D&d,n=l^1}if(!(n|r))break}o=s[602],a=s[603]}n:{if(a|o){r=h(a),r=63-((r|0)==32?h(o)+32|0:r)<<4,t=r+1376|0,r=s[r+1384>>2];r:{if(!a&o>>>0<1073741824||(i=98,(t|0)==(r|0)))break r;for(;;){if(n=F(r,c,e),n)break t;if(r=s[r+8>>2],!i)break r;if(i=i-1|0,(t|0)==(r|0))break}}if(M(e+48|0))break n;if(!r|(t|0)==(r|0))break e;for(;;){if(n=F(r,c,e),n)break t;if(r=s[r+8>>2],(t|0)==(r|0))break}break e}if(!M(e+48|0))break e}if(n=0,e>>>0>4294967239)break t;for(r=c,t=0;;){if(i=t,r){r=r-1&r,t=t+1|0;continue}break}if(!(i>>>0<=1))break}}return n}return 0}function P(e,t,n,r,o,i,m){e=e|0,t=t|0,n=n|0,r=r|0,o=o|0,i=i|0,m=m|0;var p=0,_=0,f=0;p=T-32|0,T=p,l[p+26>>1]=e,s[p+20>>2]=t,s[p+16>>2]=n,a[p+15|0]=r,l[p+12>>1]=o,s[p+8>>2]=i,s[p+4>>2]=m;e:{if(!(!(a[p+15|0]&1)|c[p+12>>1]<=32767)){s[p+28>>2]=4;break e}t=s[p+20>>2],n=s[p+16>>2],r=s[p+8>>2],o=s[p+4>>2],i=a[p+15|0]&1,e=T+-64|0,T=e,s[e+56>>2]=p+26,s[e+52>>2]=t,s[e+48>>2]=n,s[e+44>>2]=r,s[e+40>>2]=o,a[e+39|0]=2,a[e+38|0]=13,s[e+32>>2]=p+12,a[e+31|0]=i,a[e+30|0]=2;t:{n:{if(!(!s[e+52>>2]|(!s[e+44>>2]|!s[e+40>>2]))&&d[e+48>>2]<=16777215)break n;s[e+60>>2]=5;break t}if(s[e+24>>2]=s[e+48>>2]+(u[e+39|0]+(u[e+30|0]+4|0)|0),_=e,f=$(s[e+24>>2]),s[_+20>>2]=f,!s[e+20>>2]){s[e+60>>2]=3;break t}if(s[e+16>>2]=s[e+20>>2],a[s[e+16>>2]]=u[e+38|0],s[e+16>>2]=s[e+16>>2]+1,ae(s[e+16>>2],s[e+56>>2],u[e+30|0]),s[e+16>>2]=u[e+30|0]+s[e+16>>2],s[e+12>>2]=u[e+39|0]+s[e+48>>2],d[e+12>>2]<d[e+48>>2]){O(s[e+20>>2]),s[e+60>>2]=9;break t}if(t=s[e+16>>2],n=u[e+12|0]|u[e+13|0]<<8,a[t|0]=n,a[t+1|0]=n>>>8,a[t+2|0]=u[e+14|0],s[e+16>>2]=s[e+16>>2]+3,a[e+31|0]&1)n:{if(u[e+38|0]==6){t=s[e+32>>2],a[t|0]=u[t|0]|128;break n}r:{if(u[e+38|0]==13){t=s[e+32>>2],l[t>>1]=c[t>>1]|32768;break r}O(s[e+20>>2]),s[e+60>>2]=1;break t}}ae(s[e+16>>2],s[e+32>>2],u[e+39|0]),s[e+16>>2]=u[e+39|0]+s[e+16>>2],ae(s[e+16>>2],s[e+52>>2],s[e+48>>2]),s[s[e+44>>2]>>2]=s[e+20>>2],s[s[e+40>>2]>>2]=s[e+24>>2],s[e+60>>2]=0}T=e- -64|0,s[p+28>>2]=s[e+60>>2]}return T=p+32|0,s[p+28>>2]}function N(e,t,n,r,o){e=e|0,t=t|0,n=n|0,r=r|0,o=o|0;var i=0,c=0,m=0;i=T-32|0,T=i,l[i+30>>1]=e,s[i+24>>2]=t,s[i+20>>2]=n,s[i+16>>2]=r,s[i+12>>2]=o,t=s[i+24>>2],n=s[i+20>>2],r=s[i+16>>2],o=s[i+12>>2],e=T-48|0,T=e,s[e+40>>2]=i+30,s[e+36>>2]=t,s[e+32>>2]=n,s[e+28>>2]=r,s[e+24>>2]=o,a[e+23|0]=2,a[e+22|0]=15;e:{if(!(s[e+24>>2]&&s[e+28>>2])){s[e+44>>2]=5;break e}if(s[s[e+28>>2]>>2]=0,s[s[e+24>>2]>>2]=0,!(d[e+32>>2]<=16777215&&s[e+36>>2])){s[e+44>>2]=5;break e}if(s[e+16>>2]=s[e+32>>2]+(u[e+23|0]+4|0),c=e,m=$(s[e+16>>2]),s[c+12>>2]=m,!s[e+12>>2]){s[e+44>>2]=3;break e}s[e+8>>2]=s[e+12>>2],a[s[e+8>>2]]=u[e+22|0],s[e+8>>2]=s[e+8>>2]+1,ae(s[e+8>>2],s[e+40>>2],u[e+23|0]),s[e+8>>2]=u[e+23|0]+s[e+8>>2],t=s[e+8>>2],n=u[e+32|0]|u[e+33|0]<<8,a[t|0]=n,a[t+1|0]=n>>>8,a[t+2|0]=u[e+34|0],s[e+8>>2]=s[e+8>>2]+3,ae(s[e+8>>2],s[e+36>>2],s[e+32>>2]),s[e+8>>2]=s[e+32>>2]+s[e+8>>2],s[s[e+28>>2]>>2]=s[e+12>>2],s[s[e+24>>2]>>2]=s[e+16>>2],s[e+44>>2]=0}return T=e+48|0,T=i+32|0,s[e+44>>2]}function M(e){var t=0,n=0,r=0,o=0,i=0,l=0;r=s[343],n=e+3&-4,t=r+n|0;e:{t:{if(t>>>0<=r>>>0&&n||t>>>0>Re()<<16>>>0&&!(I(t|0)|0))break t;s[343]=t;break e}s[604]=48,r=-1}if((r|0)!=-1){n=e+r|0,t=n-16|0,s[t+12>>2]=16,s[t>>2]=16,e=s[600],e?l=s[e+8>>2]:l=0;e:{t:{if((l|0)==(r|0)){if(o=r-(s[r-4>>2]&-2)|0,i=s[o-4>>2],s[e+8>>2]=n,e=o-(i&-2)|0,n=-16,!(a[(e+s[e>>2]|0)-4|0]&1))break t;n=s[e+4>>2],s[n+8>>2]=s[e+8>>2],s[s[e+8>>2]+4>>2]=n,t=t-e|0,s[e>>2]=t;break e}s[r+12>>2]=16,s[r>>2]=16,s[r+8>>2]=n,s[r+4>>2]=e,s[600]=r,n=16}e=r+n|0,t=t-e|0,s[e>>2]=t}s[((t&-4)+e|0)-4>>2]=t|1,l=e,o=s[e>>2]-8|0;e:{if(o>>>0<=127){t=(o>>>3|0)-1|0;break e}if(i=h(o),t=((o>>>29-i^4)-(i<<2)|0)+110|0,o>>>0<=4095)break e;t=((o>>>30-i^2)-(i<<1)|0)+71|0,t=t>>>0<63?t:63}n=t<<4,s[l+4>>2]=n+1376,n=n+1384|0,s[e+8>>2]=s[n>>2],s[n>>2]=e,s[s[e+8>>2]+4>>2]=e,n=s[603],e=t&31,(t&63)>>>0>=32?(t=1<<e,e=0):(t=(1<<e)-1&1>>>32-e,e=1<<e),s[602]=e|s[602],s[603]=t|n}return(r|0)!=-1}function w(e,t,n,r){e=e|0,t=t|0,n=n|0,r=r|0;var o=0,i=0,d=0;o=T-16|0,T=o,l[o+10>>1]=e,l[o+8>>1]=t,s[o+4>>2]=n,s[o>>2]=r;e:{if(c[o+8>>1]>32767){s[o+12>>2]=4;break e}t=s[o+4>>2],n=s[o>>2],e=T-48|0,T=e,s[e+40>>2]=o+10,s[e+36>>2]=t,s[e+32>>2]=n,a[e+31|0]=2,a[e+30|0]=12,s[e+24>>2]=o+8,a[e+23|0]=2;t:{if(!(s[e+32>>2]&&s[e+36>>2])){s[e+44>>2]=5;break t}if(s[e+16>>2]=u[e+31|0]+(u[e+23|0]+4|0),i=e,d=$(s[e+16>>2]),s[i+12>>2]=d,!s[e+12>>2]){s[e+44>>2]=3;break t}s[e+8>>2]=s[e+12>>2],a[s[e+8>>2]]=u[e+30|0],s[e+8>>2]=s[e+8>>2]+1,ae(s[e+8>>2],s[e+40>>2],u[e+23|0]),s[e+8>>2]=u[e+23|0]+s[e+8>>2],s[e+4>>2]=u[e+31|0],t=s[e+8>>2],n=u[e+4|0]|u[e+5|0]<<8,a[t|0]=n,a[t+1|0]=n>>>8,a[t+2|0]=u[e+6|0],s[e+8>>2]=s[e+8>>2]+3,ae(s[e+8>>2],s[e+24>>2],u[e+31|0]),s[s[e+32>>2]>>2]=s[e+16>>2],s[s[e+36>>2]>>2]=s[e+12>>2],s[e+44>>2]=0}T=e+48|0,s[o+12>>2]=s[e+44>>2]}return T=o+16|0,s[o+12>>2]}function A(e,t,n){e=e|0,t=t|0,n=n|0;var r=0,o=0,a=0,i=0,l=0;a=T+-64|0,T=a,o=1;e:{if(j(e,t,0)||(o=0,!t))break e;r=T+-64|0,T=r,o=s[t>>2],i=s[o-4>>2],l=s[o-8>>2],s[r+20>>2]=0,s[r+16>>2]=1084,s[r+12>>2]=t,s[r+8>>2]=1132,o=0,ie(r+24|0,39),t=t+l|0;t:{if(j(i,1132,0)){s[r+56>>2]=1,Se[s[s[i>>2]+20>>2]](i,r+8|0,t,t,1,0),o=s[r+32>>2]==1?t:0;break t}Se[s[s[i>>2]+24>>2]](i,r+8|0,t,1,0);n:switch(s[r+44>>2]){case 0:o=s[r+48>>2]==1&&s[r+36>>2]==1&&s[r+40>>2]==1?s[r+28>>2]:0;break t;case 1:break n;default:break t}if(s[r+48>>2]|s[r+36>>2]!=1|s[r+40>>2]!=1&&s[r+32>>2]!=1)break t;o=s[r+24>>2]}if(T=r- -64|0,t=o,o=0,!t)break e;ie(a+8|4,52),s[a+56>>2]=1,s[a+20>>2]=-1,s[a+16>>2]=e,s[a+8>>2]=t,Se[s[s[t>>2]+28>>2]](t,a+8|0,s[n>>2],1),e=s[a+32>>2],(e|0)==1&&(s[n>>2]=s[a+24>>2]),o=(e|0)==1}return e=o,T=a- -64|0,e|0}function F(e,t,n){var r=0,o=0,a=0,i=0;if(r=e+4|0,o=(r+t|0)-1&0-t,t=s[e>>2],o+n>>>0<=(t+e|0)-4>>>0){a=s[e+4>>2],s[a+8>>2]=s[e+8>>2],s[s[e+8>>2]+4>>2]=a,(r|0)!=(o|0)&&(o=o-r|0,a=e-(s[e-4>>2]&-2)|0,r=o+s[a>>2]|0,s[a>>2]=r,s[(a+(r&-4)|0)-4>>2]=r,e=e+o|0,t=t-o|0,s[e>>2]=t);e:{if(n+24>>>0<=t>>>0){r=(e+n|0)+8|0,t=(t-n|0)-8|0,s[r>>2]=t,s[(r+(t&-4)|0)-4>>2]=t|1,i=r,a=s[r>>2]-8|0;t:{if(a>>>0<=127){o=(a>>>3|0)-1|0;break t}if(t=h(a),o=((a>>>29-t^4)-(t<<2)|0)+110|0,a>>>0<=4095)break t;t=((a>>>30-t^2)-(t<<1)|0)+71|0,o=t>>>0<63?t:63}t=o,o=t<<4,s[i+4>>2]=o+1376,o=o+1384|0,s[r+8>>2]=s[o>>2],s[o>>2]=r,s[s[r+8>>2]+4>>2]=r,o=s[603],r=t&31,(t&63)>>>0>=32?(t=1<<r,i=0):(t=(1<<r)-1&1>>>32-r,i=1<<r),s[602]=i|s[602],s[603]=t|o,t=n+8|0,s[e>>2]=t,s[((t&-4)+e|0)-4>>2]=t;break e}s[(e+t|0)-4>>2]=t}e=e+4|0}else e=0;return e}function O(e){var t=0,n=0,r=0,o=0,a=0;if(e){n=e-4|0,o=s[n>>2],r=o,t=n,a=s[e-8>>2],e=a&-2,(e|0)!=(a|0)&&(t=n-e|0,r=s[t+4>>2],s[r+8>>2]=s[t+8>>2],s[s[t+8>>2]+4>>2]=r,r=e+o|0),e=n+o|0,n=s[e>>2],(n|0)!=s[(e+n|0)-4>>2]&&(o=s[e+4>>2],s[o+8>>2]=s[e+8>>2],s[s[e+8>>2]+4>>2]=o,r=r+n|0),s[t>>2]=r,s[((r&-4)+t|0)-4>>2]=r|1,a=t,r=s[t>>2]-8|0;e:{if(r>>>0<=127){e=(r>>>3|0)-1|0;break e}if(o=h(r),e=((r>>>29-o^4)-(o<<2)|0)+110|0,r>>>0<=4095)break e;e=((r>>>30-o^2)-(o<<1)|0)+71|0,e=e>>>0<63?e:63}n=e<<4,s[a+4>>2]=n+1376,n=n+1384|0,s[t+8>>2]=s[n>>2],s[n>>2]=t,s[s[t+8>>2]+4>>2]=t,n=s[603],t=e&31,(e&63)>>>0>=32?(e=1<<t,t=0):(e=(1<<t)-1&1>>>32-t,t=1<<t),s[602]=t|s[602],s[603]=e|n}}function B(e,t,n){e=e|0,t=t|0,n=n|0;var r=0,o=0,i=0;r=T-48|0,T=r,s[r+40>>2]=e,s[r+36>>2]=t,s[r+32>>2]=n;e:{if(!(s[r+32>>2]&&s[r+36>>2])){s[r+44>>2]=5;break e}if(d[r+40>>2]>4){s[r+44>>2]=8;break e}if(s[r+28>>2]=5,o=r,i=$(s[r+28>>2]),s[o+24>>2]=i,!s[r+24>>2]){s[r+44>>2]=3;break e}s[r+20>>2]=s[r+24>>2],a[r+19|0]=3,a[s[r+20>>2]]=u[r+19|0],s[r+20>>2]=s[r+20>>2]+1,s[r+12>>2]=1,e=s[r+20>>2],t=u[r+12|0]|u[r+13|0]<<8,a[e|0]=t,a[e+1|0]=t>>>8,a[e+2|0]=u[r+14|0],s[r+20>>2]=s[r+20>>2]+3,a[r+11|0]=s[r+40>>2],a[s[r+20>>2]]=u[r+11|0],s[s[r+36>>2]>>2]=s[r+24>>2],s[s[r+32>>2]>>2]=s[r+28>>2],s[r+44>>2]=0}return T=r+48|0,s[r+44>>2]}function W(e,t,n,r,o){if(e=e|0,t=t|0,n=n|0,r=r|0,o=o|0,j(e,s[t+8>>2],o)){se(t,n,r);return}e:{if(j(e,s[t>>2],o)){if(!(s[t+20>>2]!=(n|0)&&s[t+16>>2]!=(n|0))){if((r|0)!=1)break e;s[t+32>>2]=1;return}s[t+32>>2]=r;t:{if(s[t+44>>2]==4)break t;if(l[t+52>>1]=0,e=s[e+8>>2],Se[s[s[e>>2]+20>>2]](e,t,n,n,1,o),u[t+53|0]){if(s[t+44>>2]=3,!u[t+52|0])break t;break e}s[t+44>>2]=4}if(s[t+20>>2]=n,s[t+40>>2]=s[t+40>>2]+1,s[t+36>>2]!=1|s[t+24>>2]!=2)break e;a[t+54|0]=1;return}e=s[e+8>>2],Se[s[s[e>>2]+24>>2]](e,t,n,r,o)}}function q(e,t,n,r,o){var a=0;a=T-32|0,T=a,s[a+24>>2]=e,s[a+20>>2]=t,s[a+16>>2]=n,s[a+12>>2]=r,s[a+8>>2]=o;e:{if(d[a+16>>2]<1){s[a+28>>2]=9;break e}if(s[s[a+8>>2]>>2]=s[a+16>>2]-1,d[s[a+20>>2]>>2]<d[s[a+8>>2]>>2]){s[a+28>>2]=1;break e}if(e=$(s[s[a+8>>2]>>2]),s[s[a+12>>2]>>2]=e,!s[s[a+12>>2]>>2]){s[a+28>>2]=3;break e}ae(s[s[a+12>>2]>>2],s[s[a+24>>2]>>2],s[s[a+8>>2]>>2]),e=s[a+24>>2],s[e>>2]=s[s[a+8>>2]>>2]+s[e>>2],e=s[a+20>>2],s[e>>2]=s[e>>2]-s[s[a+8>>2]>>2],s[a+28>>2]=0}return T=a+32|0,s[a+28>>2]}function U(e,t,n){e=e|0,t=t|0,n=n|0;var r=0,o=0,i=0;r=T-32|0,T=r,l[r+26>>1]=e,s[r+20>>2]=t,s[r+16>>2]=n,s[s[r+16>>2]>>2]=3,o=r,i=$(s[s[r+16>>2]>>2]),s[o+12>>2]=i;e:{if(!s[r+12>>2]){s[r+28>>2]=3;break e}s[s[r+20>>2]>>2]=s[r+12>>2],a[r+11|0]=14,a[s[r+12>>2]]=u[r+11|0],s[r+12>>2]=s[r+12>>2]+1,e=s[r+12>>2],t=u[r+26|0]|u[r+27|0]<<8,a[e|0]=t,a[e+1|0]=t>>>8,s[r+28>>2]=0}return T=r+32|0,s[r+28>>2]}function V(e,t){var n=0;for(n=T-16|0,T=n,s[n+12>>2]=e,s[n+8>>2]=t,s[n+4>>2]=0;;){if(d[n+4>>2]<d[n+8>>2]){s[n>>2]=s[n+12>>2]+_(s[n+4>>2],20);e:{if(!(s[s[n>>2]>>2]&15)){O(s[s[n>>2]+8>>2]);break e}t:{if((s[s[n>>2]>>2]&15)==5){O(s[s[n>>2]+8>>2]);break t}(s[s[n>>2]>>2]&15)==6&&O(s[s[n>>2]+12>>2])}}s[n+4>>2]=s[n+4>>2]+1;continue}break}O(s[n+12>>2]),T=n+16|0}function H(e,t,n,r){a[e+53|0]=1;e:{if(s[e+4>>2]!=(n|0))break e;if(a[e+52|0]=1,n=s[e+16>>2],!n){if(s[e+36>>2]=1,s[e+24>>2]=r,s[e+16>>2]=t,(r|0)!=1|s[e+48>>2]!=1)break e;a[e+54|0]=1;return}if((t|0)==(n|0)){if(n=s[e+24>>2],(n|0)==2&&(s[e+24>>2]=r,n=r),s[e+48>>2]!=1|(n|0)!=1)break e;a[e+54|0]=1;return}a[e+54|0]=1,s[e+36>>2]=s[e+36>>2]+1}}function G(e,t,n,r){var o=0;o=T-32|0,s[o+24>>2]=e,s[o+20>>2]=t,s[o+16>>2]=n,s[o+12>>2]=r,a[o+11|0]=0;e:{if(d[s[o+20>>2]>>2]<1){s[o+28>>2]=1;break e}a[o+11|0]=u[s[s[o+24>>2]>>2]],e=s[o+24>>2],s[e>>2]=s[e>>2]+1,e=s[o+20>>2],s[e>>2]=s[e>>2]-1,a[s[o+16>>2]]=(u[o+11|0]&128)==128,a[s[o+12>>2]]=u[o+11|0]&127,s[o+28>>2]=0}return s[o+28>>2]}function z(e,t,n,r,o){if(e=e|0,t=t|0,n=n|0,r=r|0,o=o|0,j(e,s[t+8>>2],o)){se(t,n,r);return}e:{if(!j(e,s[t>>2],o))break e;if(!(s[t+20>>2]!=(n|0)&&s[t+16>>2]!=(n|0))){if((r|0)!=1)break e;s[t+32>>2]=1;return}s[t+20>>2]=n,s[t+32>>2]=r,s[t+40>>2]=s[t+40>>2]+1,s[t+36>>2]!=1|s[t+24>>2]!=2||(a[t+54|0]=1),s[t+44>>2]=4}}function j(e,t,n){var r=0;if(!n)return s[e+4>>2]==s[t+4>>2];if((e|0)==(t|0))return 1;n=s[e+4>>2],e=u[n|0],t=s[t+4>>2],r=u[t|0];e:{if(!e|(r|0)!=(e|0))break e;for(;;){if(r=u[t+1|0],e=u[n+1|0],!e)break e;if(t=t+1|0,n=n+1|0,(e|0)!=(r|0))break}}return(e|0)==(r|0)}function K(e,t){e=e|0,t=t|0;var n=0,r=0,o=0;n=T-32|0,T=n,s[n+24>>2]=e,s[n+20>>2]=t,r=n,o=$(1),s[r+16>>2]=o;e:{if(!s[n+16>>2]){s[n+28>>2]=3;break e}a[n+15|0]=9,a[s[n+16>>2]]=u[n+15|0],s[s[n+24>>2]>>2]=s[n+16>>2],s[s[n+20>>2]>>2]=1,s[n+28>>2]=0}return T=n+32|0,s[n+28>>2]}function Q(e,t){e=e|0,t=t|0;var n=0,r=0,o=0;n=T-32|0,T=n,s[n+24>>2]=e,s[n+20>>2]=t,r=n,o=$(1),s[r+16>>2]=o;e:{if(!s[n+16>>2]){s[n+28>>2]=3;break e}a[n+15|0]=10,a[s[n+16>>2]]=u[n+15|0],s[s[n+24>>2]>>2]=s[n+16>>2],s[s[n+20>>2]>>2]=1,s[n+28>>2]=0}return T=n+32|0,s[n+28>>2]}function X(e,t){e=e|0,t=t|0;var n=0,r=0,o=0;n=T-32|0,T=n,s[n+24>>2]=e,s[n+20>>2]=t,r=n,o=$(1),s[r+16>>2]=o;e:{if(!s[n+16>>2]){s[n+28>>2]=3;break e}a[n+15|0]=2,a[s[n+16>>2]]=u[n+15|0],s[s[n+24>>2]>>2]=s[n+16>>2],s[s[n+20>>2]>>2]=1,s[n+28>>2]=0}return T=n+32|0,s[n+28>>2]}function Y(e,t){e=e|0,t=t|0;var n=0,r=0,o=0;n=T-32|0,T=n,s[n+24>>2]=e,s[n+20>>2]=t,r=n,o=$(1),s[r+16>>2]=o;e:{if(!s[n+16>>2]){s[n+28>>2]=3;break e}a[n+15|0]=4,a[s[n+16>>2]]=u[n+15|0],s[s[n+24>>2]>>2]=s[n+16>>2],s[s[n+20>>2]>>2]=1,s[n+28>>2]=0}return T=n+32|0,s[n+28>>2]}function J(e){var t=0;t=T-16|0,T=t,s[t+12>>2]=e,e=1;e:{if(ee(s[t+12>>2])&1||(e=1,s[t+12>>2]==15)||(e=1,s[t+12>>2]==13)||(e=1,s[t+12>>2]==12))break e;e=s[t+12>>2]==14}return T=t+16|0,e}function Z(e,t,n){var r=0;if(r=s[e+16>>2],!r){s[e+36>>2]=1,s[e+24>>2]=n,s[e+16>>2]=t;return}e:{if((t|0)==(r|0)){if(s[e+24>>2]!=2)break e;s[e+24>>2]=n;return}a[e+54|0]=1,s[e+24>>2]=2,s[e+36>>2]=s[e+36>>2]+1}}function ee(e){var t=0;t=T-16|0,s[t+12>>2]=e,e=1;e:{if(s[t+12>>2]==5||(e=1,s[t+12>>2]==6)||(e=1,s[t+12>>2]==7))break e;e=s[t+12>>2]==8}return e}function te(e,t,n,r,o,a){if(e=e|0,t=t|0,n=n|0,r=r|0,o=o|0,a=a|0,j(e,s[t+8>>2],a)){H(t,n,r,o);return}e=s[e+8>>2],Se[s[s[e>>2]+20>>2]](e,t,n,r,o,a)}function ne(){for(var e=0,t=0,n=0;t=e<<4,n=t+1376|0,s[t+1380>>2]=n,s[t+1384>>2]=n,e=e+1|0,(e|0)!=64;);M(48)}function re(e,t,n,r){if(e=e|0,t=t|0,n=n|0,r=r|0,j(e,s[t+8>>2],0)){Z(t,n,r);return}e=s[e+8>>2],Se[s[s[e>>2]+28>>2]](e,t,n,r)}function oe(e,t,n,r,o,a){e=e|0,t=t|0,n=n|0,r=r|0,o=o|0,a=a|0,j(e,s[t+8>>2],a)&&H(t,n,r,o)}function ae(e,t,n){if(n)for(;a[e|0]=u[t|0],e=e+1|0,t=t+1|0,n=n-1|0,!!n;);}function ie(e,t){if(t)for(;a[e|0]=0,e=e+1|0,t=t-1|0,!!t;);}function le(e,t,n,r){e=e|0,t=t|0,n=n|0,r=r|0,j(e,s[t+8>>2],0)&&Z(t,n,r)}function se(e,t,n){s[e+28>>2]==1|s[e+4>>2]!=(t|0)||(s[e+28>>2]=n)}function ue(e,t){return e=e|0,t=t|0,_(t,20)+e|0}function ce(e){return e=e|0,c[e+8>>1]>>>1|0}function de(e){return e=e|0,l[e+8>>1]&1}function me(e){return e=e|0,s[e+12>>2]}function pe(e){return e=e|0,s[e>>2]&15}function _e(e){return e=e|0,s[e+16>>2]}function fe(e){return e=e|0,c[e+4>>1]}function ge(e){return e=e|0,s[e+8>>2]}function he(e){return e=e|0,u[e+4|0]}function ye(e){return e=e|0,e|0}function Ce(e){return $(e)}function be(e){e=e|0,O(e)}function ve(e){e=e|0}n=u,i(t);var Se=e([null,ye,be,ve,ve,A,oe,z,le,be,te,W,re]);function Re(){return o.byteLength/65536|0}function Le(e){e=e|0;var t=Re()|0,i=t+e|0;if(t<i&&i<65536){var f=new ArrayBuffer(_(i,65536)),g=new Int8Array(f);g.set(a),a=new Int8Array(f),l=new Int16Array(f),s=new Int32Array(f),u=new Uint8Array(f),c=new Uint16Array(f),d=new Uint32Array(f),m=new Float32Array(f),p=new Float64Array(f),o=f,r.buffer=o,n=u}return t}return{c:ne,d:Ce,e:be,f:X,g:Y,h:B,i:N,j:U,k:P,l:w,m:K,n:Q,o:x,p:pe,q:he,r:ue,s:fe,t:ge,u:me,v:me,w:_e,x:ce,y:de,z:ce,A:Se}}return l(t)})(he)},instantiate:function(t,n){return{then:function(n){var e=new S.Module(t);n({instance:new S.Instance(e)})}}},RuntimeError:Error};b=[],typeof S!="object"&&ne("no native wasm support detected");var R,L=!1,E;function k(e,t){e||ne("Assertion failed: "+t)}function I(e,t){return e%t>0&&(e+=t-e%t),e}var T,D,x,$,P,N,M,w,A;function F(e){T=e,t.HEAP8=D=new Int8Array(e),t.HEAP16=$=new Int16Array(e),t.HEAP32=N=new Int32Array(e),t.HEAPU8=x=new Uint8Array(e),t.HEAPU16=P=new Uint16Array(e),t.HEAPU32=M=new Uint32Array(e),t.HEAPF32=w=new Float32Array(e),t.HEAPF64=A=new Float64Array(e)}var O=t.INITIAL_MEMORY||2097152;t.wasmMemory?R=t.wasmMemory:R=new S.Memory({initial:O/65536,maximum:32768}),R&&(T=R.buffer),O=T.byteLength,F(T);var B,W=[],q=[],U=[],V=!1;function H(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)j(t.preRun.shift());ue(W)}function G(){V=!0,ue(q)}function z(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Q(t.postRun.shift());ue(U)}function j(e){W.unshift(e)}function K(e){q.unshift(e)}function Q(e){U.unshift(e)}if((!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function(t,n){var e=t>>>16,r=t&65535,o=n>>>16,a=n&65535;return r*a+(e*a+r*o<<16)|0}),!Math.fround){var X=new Float32Array(1);Math.fround=function(e){return X[0]=e,X[0]}}Math.clz32||(Math.clz32=function(e){var t=32,n=e>>16;return n&&(t-=16,e=n),n=e>>8,n&&(t-=8,e=n),n=e>>4,n&&(t-=4,e=n),n=e>>2,n&&(t-=2,e=n),n=e>>1,n?t-2:t-e}),Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)});var Y=0,J=null,Z=null;function ee(e){Y++,t.monitorRunDependencies&&t.monitorRunDependencies(Y)}function te(e){if(Y--,t.monitorRunDependencies&&t.monitorRunDependencies(Y),Y==0&&(J!==null&&(clearInterval(J),J=null),Z)){var n=Z;Z=null,n()}}t.preloadedImages={},t.preloadedAudios={};function ne(e){t.onAbort&&t.onAbort(e),e+="",C(e),L=!0,E=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var n=new S.RuntimeError(e);throw o(n),n}var re="data:application/octet-stream;base64,";function oe(e){return e.startsWith(re)}var ae="dgwcppbridge.wasm";oe(ae)||(ae=p(ae));function ie(e){try{if(e==ae&&b)return new Uint8Array(b);var t=ge(e);if(t)return t;if(g)return g(e);throw"both async and sync fetching of the wasm failed"}catch(e){ne(e)}}function le(){return!b&&(c||d)&&typeof fetch=="function"?fetch(ae,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+ae+"'";return e.arrayBuffer()}).catch(function(){return ie(ae)}):n.resolve().then(function(){return ie(ae)})}function se(){var e={a:he};function n(e,n){var r=e.exports;t.asm=r,B=t.asm.A,K(t.asm.c),te("wasm-instantiate")}ee("wasm-instantiate");function r(e){n(e.instance)}function a(t){return le().then(function(t){var n=S.instantiate(t,e);return n}).then(t,function(e){C("failed to asynchronously prepare wasm: "+e),ne(e)})}function i(){return!b&&typeof S.instantiateStreaming=="function"&&!oe(ae)&&typeof fetch=="function"?fetch(ae,{credentials:"same-origin"}).then(function(t){var n=S.instantiateStreaming(t,e);return n.then(r,function(e){return C("wasm streaming compile failed: "+e),C("falling back to ArrayBuffer instantiation"),a(r)})}):a(r)}if(t.instantiateWasm)try{var l=t.instantiateWasm(e,n);return l}catch(e){return C("Module.instantiateWasm callback failed with error: "+e),!1}return i().catch(o),{}}function ue(e){for(;e.length>0;){var n=e.shift();if(typeof n=="function"){n(t);continue}var r=n.func;typeof r=="number"?n.arg===void 0?B.get(r)():B.get(r)(n.arg):r(n.arg===void 0?null:n.arg)}}function ce(e){try{return R.grow(e-T.byteLength+65535>>>16),F(R.buffer),1}catch(e){}}function de(e){var t=x.length;e=e>>>0;var n=2147483648;if(e>n)return!1;for(var r=1;r<=4;r*=2){var o=t*(1+.2/r);o=Math.min(o,e+100663296);var a=Math.min(n,I(Math.max(e,o),65536)),i=ce(a);if(i)return!0}return!1}var me=!1;function pe(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}var _e=typeof atob=="function"?atob:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="",r,o,a,i,l,s,u,c=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do i=t.indexOf(e.charAt(c++)),l=t.indexOf(e.charAt(c++)),s=t.indexOf(e.charAt(c++)),u=t.indexOf(e.charAt(c++)),r=i<<2|l>>4,o=(l&15)<<4|s>>2,a=(s&3)<<6|u,n=n+String.fromCharCode(r),s!==64&&(n=n+String.fromCharCode(o)),u!==64&&(n=n+String.fromCharCode(a));while(c<e.length);return n};function fe(e){try{for(var t=_e(e),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}catch(e){throw new Error("Converting base64 string to bytes failed.")}}function ge(e){if(oe(e))return fe(e.slice(re.length))}var he={b:de,a:R},ye=se(),Ce=t.___wasm_call_ctors=function(){return(Ce=t.___wasm_call_ctors=t.asm.c).apply(null,arguments)},be=t.__malloc=function(){return(be=t.__malloc=t.asm.d).apply(null,arguments)},ve=t.__free=function(){return(ve=t.__free=t.asm.e).apply(null,arguments)},Se=t.__DgwCodecEncodeEmpty=function(){return(Se=t.__DgwCodecEncodeEmpty=t.asm.f).apply(null,arguments)},Re=t.__DgwCodecEncodeDeauth=function(){return(Re=t.__DgwCodecEncodeDeauth=t.asm.g).apply(null,arguments)},Le=t.__DgwCodecEncodeDrain=function(){return(Le=t.__DgwCodecEncodeDrain=t.asm.h).apply(null,arguments)},Ee=t.__DgwCodecEncodeStreamGroup_EstabStream=function(){return(Ee=t.__DgwCodecEncodeStreamGroup_EstabStream=t.asm.i).apply(null,arguments)},ke=t.__DgwCodecEncodeStreamGroup_EndOfData=function(){return(ke=t.__DgwCodecEncodeStreamGroup_EndOfData=t.asm.j).apply(null,arguments)},Ie=t.__DgwCodecEncodeStreamGroup_Data=function(){return(Ie=t.__DgwCodecEncodeStreamGroup_Data=t.asm.k).apply(null,arguments)},Te=t.__DgwCodecEncodeStreamGroup_Ack=function(){return(Te=t.__DgwCodecEncodeStreamGroup_Ack=t.asm.l).apply(null,arguments)},De=t.__DgwCodecEncodePing=function(){return(De=t.__DgwCodecEncodePing=t.asm.m).apply(null,arguments)},xe=t.__DgwCodecEncodePong=function(){return(xe=t.__DgwCodecEncodePong=t.asm.n).apply(null,arguments)},$e=t.__DgwCodecDecode=function(){return($e=t.__DgwCodecDecode=t.asm.o).apply(null,arguments)},Pe=t.__getFrameType=function(){return(Pe=t.__getFrameType=t.asm.p).apply(null,arguments)},Ne=t.__getDrainReasonFromDrainFrame=function(){return(Ne=t.__getDrainReasonFromDrainFrame=t.asm.q).apply(null,arguments)},Me=t.__getDGWFramePtr=function(){return(Me=t.__getDGWFramePtr=t.asm.r).apply(null,arguments)},we=t.__getStreamIdFromStreamGroupFrame=function(){return(we=t.__getStreamIdFromStreamGroupFrame=t.asm.s).apply(null,arguments)},Ae=t.__getEncodedParamsFromEstablishStreamFrame=function(){return(Ae=t.__getEncodedParamsFromEstablishStreamFrame=t.asm.t).apply(null,arguments)},Fe=t.__getEncodedParamsSizeFromEstablishStreamFrame=function(){return(Fe=t.__getEncodedParamsSizeFromEstablishStreamFrame=t.asm.u).apply(null,arguments)},Oe=t.__getDataFromGroupedStreamDataFrame=function(){return(Oe=t.__getDataFromGroupedStreamDataFrame=t.asm.v).apply(null,arguments)},Be=t.__getDataSizeFromGroupedStreamDataFrame=function(){return(Be=t.__getDataSizeFromGroupedStreamDataFrame=t.asm.w).apply(null,arguments)},We=t.__getAckIdFromGroupedStreamDataFrame=function(){return(We=t.__getAckIdFromGroupedStreamDataFrame=t.asm.x).apply(null,arguments)},qe=t.__getRequiresAckFromGroupedStreamDataFrame=function(){return(qe=t.__getRequiresAckFromGroupedStreamDataFrame=t.asm.y).apply(null,arguments)},Ue=t.__getAckIdFromGroupedStreamAckFrame=function(){return(Ue=t.__getAckIdFromGroupedStreamAckFrame=t.asm.z).apply(null,arguments)},Ve;Z=function e(){Ve||He(),Ve||(Z=e)};function He(e){if(e=e||l,Y>0||(H(),Y>0))return;function n(){Ve||(Ve=!0,t.calledRun=!0,!L&&(G(),r(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),z()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),n()},1)):n()}if(t.run=He,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return He(),t.ready})})();typeof i=="object"&&typeof a=="object"?a.exports=e:typeof define=="function"&&define.amd?define([],function(){return e}):typeof i=="object"&&(i.Module=e)}),null);
__d("DGWUtils",["Base64","DGWConstants","DGWCppBridge","IDGWLoggingContext","Random","URI","getErrorSafe","justknobx"],(function(t,n,r,o,a,i,l){"use strict";var e,s=4;function u(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=o("Random").random()*16|0,n=e==="x"?t:t&3|8;return n.toString(16)})}function c(e){var t=new TextDecoder,n=t.decode(e),o=r("Base64").encode(n),a=o.replace(/\+/gi,"-").replace(/\//gi,"_").replace(/=/gi,"");return a}var d=null,m=null;function p(){return m==null&&(m=Promise.resolve().then(function(){return r("DGWCppBridge")()}).then(function(e){d=e}).catch(function(e){throw r("justknobx")._("5404")&&(m=null),e})),m}var _=(function(){function t(){}return t.initialize=async function(){return p()},t.constructConnectUrl=function(n){var t,a,i=n.appId,l=n.appVersion,s=n.authToken,u=n.authType,d=n.deviceId,m=n.dgwVersion,p=n.endpoint,_=n.establishStreamFrame,f=n.fbId,g=n.headers,h=n.loggingId,y=n.regionHint,C=n.serviceId,b=n.tier,v=n.trafficTracing,S=(t={},t[(a=o("DGWConstants")).HEADER_CONSTANTS.HEADER_APPID]=i,t[a.HEADER_CONSTANTS.HEADER_APPVERSION]=l,t[a.HEADER_CONSTANTS.HEADER_AUTHTYPE]=u,t[a.HEADER_CONSTANTS.HEADER_DGW_VERSION]=""+m,t[a.HEADER_CONSTANTS.HEADER_UUID]=f,t[a.HEADER_CONSTANTS.HEADER_TARGET_TIER]=b,t);_!==void 0&&(S[o("DGWConstants").HEADER_CONSTANTS.HEADER_ESTABLISH_STREAM_FRAME_BASE64]=c(_)),h!==void 0&&(S[o("DGWConstants").HEADER_CONSTANTS.HEADER_LOGGING_ID]=h),y!==void 0&&(S[o("DGWConstants").HEADER_CONSTANTS.HEADER_REGIONHINT]=y),d!==void 0&&(S[o("DGWConstants").HEADER_CONSTANTS.HEADER_DEVICE_ID]=d),v!==void 0&&(S[o("DGWConstants").HEADER_CONSTANTS.TRAFFIC_TRACING]="debug:"+v),s!==void 0&&(S[o("DGWConstants").HEADER_CONSTANTS.HEADER_AUTHTOKEN]=s),Object.keys(g).forEach(function(e){var t=o("DGWConstants").HEADER_CONSTANTS.APPHEADER_PREFIX+e;Object.prototype.hasOwnProperty.call(S,t)||(S[t]=g[e])});var R=new(e||(e=r("URI")))(p);return R.setQueryData(S),R.setPath(R.getPath()+"/"+C),R.toString().length>2e3&&(delete S[o("DGWConstants").HEADER_CONSTANTS.HEADER_ESTABLISH_STREAM_FRAME_BASE64],R.setQueryData(S)),R.toStringRawQuery()},t})(),f=(function(){function e(e,t,n){this.$1=null,this.$2=e,this.$3=t,this.$4=n}e.initialize=async function(){return p()};var t=e.prototype;return t.malloc=function(t){try{var e=d.__malloc(t);if(e===0){var n;return(n=this.$2)==null||n.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"wasm malloc failure","malloc returned 0"),-1}return e}catch(e){var a;return(a=this.$2)==null||a.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"wasm malloc failure","exception during malloc",r("getErrorSafe")(e).message),-1}},t.free=function(t){d.__free(t)},t.append=function(t){if(this.$1==null){this.$1=t;return}var e=this.$1.length,n=new Uint8Array(e+t.length);n.set(this.$1,0),n.set(t,e),this.$1=n},t.processData=function(){var e=this;if(this.$1!=null){var t=this.$1.length,n=this.malloc(t);if(n!==-1){var r=d.HEAPU8.subarray(n,n+t);if(this.$1)for(var a=0;a<r.length;++a)r[a]=this.$1[a];var i=this.malloc(s*4);if(i!==-1){var l=i,u=l+s,c=u+s,m=c+s,p=d.__DgwCodecDecode(n,t,l,u,c,m);if(this.free(n),p!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var _;this.free(i),(_=this.$2)==null||_.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"Codec Decode Failure","Failed to decode Frame(s). Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(p));return}var f=d.HEAPU32.subarray(m/s,m/s+1)[0];if(this.$1==null){this.free(i);return}var g=this.$1.length-f;if(this.$1&&this.$1.length>g){var h;this.$1=new Uint8Array(((h=this.$1)==null?void 0:h.subarray(g))||[])}else this.$1=null;for(var y=d.HEAPU32.subarray(u/s,u/s+1)[0],C=d.HEAPU32.subarray(l/s,l/s+1)[0],b=[],v=function(){var t=d.__getDGWFramePtr(C,S),n=d.__getFrameType(t);switch(n){case o("DGWConstants").DgwFrameType.DgwFrameType_Drain:{var r,a=d.__getDrainReasonFromDrainFrame(t),i=o("DGWConstants").drainReasonToDrainReasonString(a);(r=e.$2)==null||r.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"Received Drain Frame from server","DrainReason: "+i),b.push(function(){var t;return(t=e.$3)==null?void 0:t.receivedDrainSignal(i)});break}case o("DGWConstants").DgwFrameType.DgwFrameType_StreamGroup_EstabStream:{var l=d.__getStreamIdFromStreamGroupFrame(t),s=d.__getEncodedParamsFromEstablishStreamFrame(t),u=new Uint8Array(d.HEAPU8.subarray(s,s+d.__getEncodedParamsSizeFromEstablishStreamFrame(t)));e.free(s),b.push(function(){var t;return(t=e.$3)==null?void 0:t.onGroupedStreamEstablishStreamReceived(l,u)});break}case o("DGWConstants").DgwFrameType.DgwFrameType_StreamGroup_Data:{var c=d.__getStreamIdFromStreamGroupFrame(t),m=d.__getDataFromGroupedStreamDataFrame(t),p=new Uint8Array(d.HEAPU8.subarray(m,m+d.__getDataSizeFromGroupedStreamDataFrame(t)));e.free(m);var _=d.__getRequiresAckFromGroupedStreamDataFrame(t)?d.__getAckIdFromGroupedStreamDataFrame(t):null;b.push(function(){var t;return(t=e.$3)==null?void 0:t.onGroupedStreamDataReceived(c,p,_)});break}case o("DGWConstants").DgwFrameType.DgwFrameType_StreamGroup_Ack:{var f=d.__getStreamIdFromStreamGroupFrame(t),g=d.__getAckIdFromGroupedStreamAckFrame(t);b.push(function(){var t;return(t=e.$3)==null?void 0:t.onGroupedStreamAckReceived(f,g)});break}case o("DGWConstants").DgwFrameType.DgwFrameType_StreamGroup_EndOfData:{var h=d.__getStreamIdFromStreamGroupFrame(t);b.push(function(){var t;return(t=e.$3)==null?void 0:t.onGroupedStreamEndOfDataReceived(h)});break}case o("DGWConstants").DgwFrameType.DgwFrameType_Ping:{b.push(function(){var t;return(t=e.$3)==null?void 0:t.onPingReceived()});break}case o("DGWConstants").DgwFrameType.DgwFrameType_Pong:{b.push(function(){var t;return(t=e.$3)==null?void 0:t.onPongReceived()});break}default:break}e.free(t)},S=0;S<y;++S)v();this.free(i);for(var R=0;R<b.length;R++)b[R]()}}}},t.encodeData=function(t,n,r,a){var e=this.malloc(t.length);if(e===-1)return null;for(var i=d.HEAPU8.subarray(e,e+t.length),l=0;l<i.length;++l)i[l]=t[l];var u=this.malloc(s*2),c=u,m=u+s,p=d.__DgwCodecEncodeStreamGroup_Data(a,e,i.length,n,r,c,m);if(this.free(e),p!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var _;return(_=this.$2)==null||_.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"Data Frame encode failure","Failed to decode DGW Data Frame. Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(p)),null}var f=d.HEAPU32.subarray(c/s,c/s+1)[0],g=d.HEAPU32.subarray(m/s,m/s+1)[0],h=new Uint8Array(d.HEAPU8.subarray(f,f+g));return this.free(f),this.free(u),h},t.encodeAck=function(t,n){var e=this.malloc(s*2);if(e===-1)return null;var r=e,a=e+s,i=d.__DgwCodecEncodeStreamGroup_Ack(n,t,r,a);if(i!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var l;return(l=this.$2)==null||l.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"ACK Frame encode failure","Failed to encode ACK Frame. Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(i)),null}var u=d.HEAPU32.subarray(r/s,r/s+1)[0],c=d.HEAPU32.subarray(a/s,a/s+1)[0],m=new Uint8Array(d.HEAPU8.subarray(u,u+c));return this.free(u),this.free(e),m},t.encodeDrain=function(t){var e=this.malloc(s*2);if(e===-1)return null;var n=e,r=e+s,a=d.__DgwCodecEncodeDrain(t,n,r);if(a!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var i;return(i=this.$2)==null||i.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"Drain Frame encode failure","Failed to encode Drain Frame. Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(a)),null}var l=d.HEAPU32.subarray(n/s,n/s+1)[0],u=d.HEAPU32.subarray(r/s,r/s+1)[0],c=new Uint8Array(d.HEAPU8.subarray(l,l+u));return this.free(l),this.free(e),c},t.encodeEstablishStream=function(t,n){var e=this.malloc(n.length);if(e===-1)return null;for(var r=d.HEAPU8.subarray(e,e+n.length),a=0;a<n.length;++a)r[a]=n[a];var i=this.malloc(s*2),l=i,u=i+s,c=d.__DgwCodecEncodeStreamGroup_EstabStream(t,e,n.length,l,u);if(this.free(e),c!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var m;return(m=this.$2)==null||m.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"EstablishStream Frame encode failure","Failed to encode EstablishStream Frame. Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(c)+" for StreamId "+t),null}var p=d.HEAPU32.subarray(l/s,l/s+1)[0],_=d.HEAPU32.subarray(u/s,u/s+1)[0],f=new Uint8Array(d.HEAPU8.subarray(p,p+_));return this.free(p),this.free(i),f},t.encodeEndOfData=function(t){var e=this.malloc(s*2);if(e===-1)return null;var n=e,r=e+s,a=d.__DgwCodecEncodeStreamGroup_EndOfData(t,n,r);if(a!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var i;return(i=this.$2)==null||i.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"EndOfData Frame encode failure","Failed to encode EndOfData Frame. Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(a)),null}var l=d.HEAPU32.subarray(n/s,n/s+1)[0],u=d.HEAPU32.subarray(r/s,r/s+1)[0],c=new Uint8Array(d.HEAPU8.subarray(l,l+u));return this.free(l),this.free(e),c},t.encodePing=function(){var e=this.malloc(s*2);if(e===-1)return null;var t=e,n=e+s,r=d.__DgwCodecEncodePing(t,n);if(r!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var a;return(a=this.$2)==null||a.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"Ping Frame encode failure","Failed to encode Ping Frame. Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(r)),null}var i=d.HEAPU32.subarray(t/s,t/s+1)[0],l=d.HEAPU32.subarray(n/s,n/s+1)[0],u=new Uint8Array(d.HEAPU8.subarray(i,i+l));return this.free(i),this.free(e),u},t.encodePong=function(){if(this.$5!=null)return this.$5;var e=this.malloc(s*2);if(e===-1)return null;var t=e,n=e+s,r=d.__DgwCodecEncodePong(t,n);if(r!==o("DGWConstants").DgwCodecReturnCode.DgwCodecReturnCode_Success){var a;return(a=this.$2)==null||a.logError(o("IDGWLoggingContext").DGWLoggingComponent.CODEC_COMPONENT,"Pong Frame encode failure","Failed to encode Pong Frame. Received error code "+o("DGWConstants").DgwCodecReturnCodeToString(r)),null}var i=d.HEAPU32.subarray(t/s,t/s+1)[0],l=d.HEAPU32.subarray(n/s,n/s+1)[0],u=new Uint8Array(d.HEAPU8.subarray(i,i+l));return this.free(i),this.free(e),this.$5=u,u},e})();l.uuidv4=u,l.Uint8ArrayToBase64UrlStr=c,l.DGWUtils=_,l.DGWCodec=f}),98);
__d("DGWExponentialBackoff",[],(function(t,n,r,o,a,i){"use strict";var e={maxRetries:5,baseRetryInterval:1e3,backoffFactor:Math.sqrt(2)},l=(function(e){function t(t,n){var r;return r=e.call(this,t)||this,r.errors=n,r}return babelHelpers.inheritsLoose(t,e),t})(babelHelpers.wrapNativeSuper(Error));async function s(t,n){n===void 0&&(n=e);try{return await u(t,n)}catch(e){throw e.errors[e.errors.length-1]}}async function u(e,t){for(var n=0,r=[],o=t.baseRetryInterval,a=t.backoffFactor;n<=t.maxRetries;){try{var i=await e();return i}catch(e){r.push(e)}await c(o*Math.pow(a,n)),++n}throw new l("Max call count exceeded",r)}async function c(e){await new Promise(function(t){return window.setTimeout(t,e)})}i.callWithExponentialBackoff=s}),66);
__d("DGWPinger",["IDGWLoggingContext"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(e,t,n,r){this.$1=e,this.$4=t,this.$5=n,this.$6=r,this.$3=!1}var t=e.prototype;return t.$7=function(){var e=this;this.$3?(this.$6.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.PINGER,"timeout_fired.reset"),this.$3=!1,this.$4(),this.$6.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.PINGER,"timeout.newtimeout"),this.$2=window.setTimeout(function(){e.$7()},this.$1)):(this.$6.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.PINGER,"timeout_fired.disconnect"),this.$5())},t.reset=function(){var e=this;this.$3=!0,this.$2&&(this.$6.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.PINGER,"reset"),window.clearTimeout(this.$2),this.$2=null),this.$1>0&&(this.$6.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.PINGER,"reset.newtimeout"),this.$2=window.setTimeout(function(){e.$7()},this.$1))},t.cancel=function(){this.$2&&(this.$6.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.PINGER,"canceled"),window.clearTimeout(this.$2),this.$2=null)},e})();l.DGWPinger=e}),98);
__d("DGWStreamGroupCallbacks",["$InternalEnum"],(function(t,n,r,o,a,i){"use strict";var e=n("$InternalEnum")({TRANSPORT_SERVER_INTERNAL_ERROR:0,TRANSPORT_ABNORMAL_CLOSURE:1,TRANSPORT_GOING_AWAY:2,TRANSPORT_UNKNOWN_ERROR:3,TRANSPORT_KEEPALIVE_TIMEOUT:4,TRANSPORT_UNAUTHORIZED:5,TRANSPORT_REJECTED:6,TRANSPORT_BAD_REQUEST:7,TRANSPORT_DGW_SERVER_ERROR:8,TRANSPORT_NORMAL_CLOSURE:9});function l(t){switch(t){case e.TRANSPORT_SERVER_INTERNAL_ERROR:return"TRANSPORT_SERVER_INTERNAL_ERROR";case e.TRANSPORT_ABNORMAL_CLOSURE:return"TRANSPORT_ABNORMAL_CLOSURE";case e.TRANSPORT_GOING_AWAY:return"TRANSPORT_GOING_AWAY";case e.TRANSPORT_UNKNOWN_ERROR:return"TRANSPORT_UNKNOWN_ERROR";case e.TRANSPORT_KEEPALIVE_TIMEOUT:return"TRANSPORT_KEEPALIVE_TIMEOUT";case e.TRANSPORT_UNAUTHORIZED:return"TRANSPORT_UNAUTHORIZED";case e.TRANSPORT_REJECTED:return"TRANSPORT_REJECTED";case e.TRANSPORT_BAD_REQUEST:return"TRANSPORT_BAD_REQUEST";case e.TRANSPORT_DGW_SERVER_ERROR:return"TRANSPORT_DGW_SERVER_ERROR";case e.TRANSPORT_NORMAL_CLOSURE:return"TRANSPORT_NORMAL_CLOSURE"}}function s(t){switch(t){case e.TRANSPORT_UNAUTHORIZED:return!1;default:return!0}}var u=(function(){function e(){}var t=e.prototype;return t.onStreamGroupError=function(){},t.onStreamGroupMustDrain=function(){},t.onStreamGroupTransportClose=function(){},e})();i.DGWStreamGroupError=e,i.dgwStreamGroupErrorToString=l,i.isRetryableError=s,i.NoOpDGWStreamGroupCallbacks=u}),66);
__d("DGWTransportEvents",["IDGWLoggingContext"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(e){this.$3=e}var t=e.prototype;return t.transportEstablished=function(t){this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"open",t),this.$2=Date.now(),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"stream_group_establishment_success")},t.transportPingSent=function(t){this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Ping Frame Sent",t,!0)},t.transportPongReceived=function(t){this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Pong Frame Received",t,!0)},t.transportEstablishmentPending=function(){this.$1=Date.now(),this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"transportPending",null,!0),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"stream_group_establishment_pending")},t.transportClosed=function(t,n,r){this.$4=Date.now(),t?(this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"transport_close_graceful"),this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Transport closed gracefully",null,!0)):(this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"transport_close_with_error"),this.$3.logError(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Transport closed abnormally",n,r))},t.transportEstablishmentFailure=function(t){this.$3.logError(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"WebSocket transport establishment failure","WebSocket close code: "+t.code+" reason: "+t.reason+" wasClean: "+String(t.wasClean)),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"stream_group_establishment_failure")},t.internalCertPrimingRetryAttempt=function(t){this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"internal_cert_priming_retry_attempt",t),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"internal_cert_priming_retry_attempt")},t.internalCertPrimingRetrySuccess=function(t){this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"internal_cert_priming_retry_success",t),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"internal_cert_priming_retry_success")},t.internalCertPrimingRetryFailure=function(t,n){this.$3.logError(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"internal_cert_priming_retry_failure",t,n),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"internal_cert_priming_retry_failure")},t.streamEstablishmentTimeout=function(t,n,r){this.$3.logError(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Grouped Stream establishment timeout",t,"streamId:"+n,!1,r),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"stream_establishment_timeout")},t.streamEstablishmentPending=function(t,n){this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Grouped Stream establishment pending","streamId:"+t,!0,n),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"stream_establishment_pending")},t.streamEstablishmentSuccess=function(t,n){this.$3.logEvent(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Grouped Stream establishment success","streamId:"+t,!0,n),this.$3.bumpODSKey(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"stream_establishment_success")},t.transportError=function(t,n,r){this.$3.logError(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,t,n,r)},t.receivedFrameForInactiveStream=function(t,n,r){this.$3.logWarn(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Frame received for inactive stream","frameType: "+t+", streamID: "+n,r)},t.ranOutOfStreamIds=function(t){this.$3.logWarn(o("IDGWLoggingContext").DGWLoggingComponent.WEBSOCKET_TRANSPORT_COMPONENT,"Hit max StreamId limit","Hit max StreamId limit",t)},e})();l.DGWTransportEvents=e}),98);
__d("DGWWebSocketTransport",[],(function(t,n,r,o,a,i){"use strict";var e=new Set(["gateway.internalfb.com"]),l=new Set;function s(e){try{return new URL(e).hostname}catch(e){return null}}async function u(t){var n=s(t);if(n==null||!e.has(n)||l.has(n))return!1;l.add(n);var r=t.replace(/^wss:/i,"https:");return await new Promise(function(e){var t=new XMLHttpRequest;t.onloadend=function(){return e()};try{t.open("GET",r),t.withCredentials=!0,t.send()}catch(t){e()}}),!0}function c(e){var t=new WebSocket(e);return t.binaryType="arraybuffer",t.onopen=function(){},t.onclose=function(){},t.onerror=function(){},t}i.primeInternalCertOnce=u,i.getWebSocketConnection=c}),66);
__d("DGWStreamEvents",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){function e(e,t,n){this.$4=new Map,this.$5=new Map,this.$6=e,this.$1=t,n!=null&&(this.$8="streamId:"+n+"::")}var t=e.prototype;return t.dataSent=function(t,n,r){var e,o=n?"sendWithAckRequested":"sendWithoutAckRequested";this.$6.logEvent(this.$1,o,((e=this.$8)!=null?e:"")+"sendId:"+r+", payloadSize:"+t,!0),this.$4.set(r,{ackRequested:n,payloadSize:t,sendTimestamp:Date.now()})},t.ackReceived=function(t){var e;this.$6.logEvent(this.$1,"AckReceived",((e=this.$8)!=null?e:"")+"sendId:"+t,!0),this.$6.bumpODSKey(this.$1,"ack_received");var n=this.$4.get(t);n!=null&&(n.ackReceivedTimestamp=Date.now())},t.ackSent=function(t){var e;this.$6.bumpODSKey(this.$1,"ack_sent"),this.$6.logEvent(this.$1,"ACK sent",((e=this.$8)!=null?e:"")+"ackId:"+t,!0)},t.drainSent=function(t){var e;this.$6.logEvent(this.$1,"Drain sent",((e=this.$8)!=null?e:"")+"drainReason: "+t)},t.dataReceived=function(t,n,r){var e;this.$6.bumpODSKey(this.$1,"data_received"),this.$6.logEvent(this.$1,"Data received",((e=this.$8)!=null?e:"")+"sendId:"+(r!=null?r:"null")+", ackRequested:"+n.toString()+", payloadSize:"+t,!0),r!=null&&this.$5.set(r,{ackRequested:n,payloadSize:t,receiveTimestamp:Date.now()})},t.endOfDataReceived=function(){this.$6.bumpODSKey(this.$1,"end_of_data_received"),this.$6.logEvent(this.$1,"EndOfDataReceived",this.$8,!0)},t.endOfDataSent=function(){this.$6.bumpODSKey(this.$1,"end_of_data_sent"),this.$6.logEvent(this.$1,"EndOfDataSent",this.$8,!0)},t.streamClosed=function(t,n){this.$7=Date.now();var e=this.$9();if(t){var r;this.$6.bumpODSKey(this.$1,"stream_closed_gracefully"),this.$6.logEvent(this.$1,"Stream closed gracefully",""+((r=this.$8)!=null?r:"")+e)}else{var o;this.$6.bumpODSKey(this.$1,"stream_closed_with_error"),this.$6.logError(this.$1,"Stream closed abnormally",n,""+((o=this.$8)!=null?o:"")+e)}},t.connectionEstablishmentFailure=function(t){this.$6.logEvent(this.$1,"WebSocket connection establishment failure","WebSocket close code: "+t)},t.streamEstablishmentFailure=function(t,n){var e;this.$6.logError(this.$1,"Failed to establish DGW Stream","Last seen error: "+t.toString(),""+((e=this.$8)!=null?e:"")+n),this.$6.bumpODSKey(this.$1,"stream_establishment_failure")},t.error=function(t,n){var e={msg:n,state:this.$9()};this.$6.logError(this.$1,t,JSON.stringify(e),this.$8)},t.$9=function(){var e={currentNetworkCondition:window.navigator&&window.navigator.onLine===!0,establishRequestTimestamp:this.$2,establishedTimestamp:this.$3,streamClosedTimestamp:this.$7,sendHistory:JSON.stringify(Array.from(this.$4.entries())),receiveHistory:JSON.stringify(Array.from(this.$5.entries()))};return JSON.stringify(e)},e})();i.DGWStreamEvents=e}),66);
__d("GroupedStream",["DGWAckManager","DGWConstants","DGWStream","DGWStreamEvents","IDGWLoggingContext","Random","err"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(e,t,n,r,a,i,l){this.$1=e,this.$3=!1,this.$4=!1,this.$5=!1,this.$6=t,this.$7=n,this.$8=r,this.$2=i,this.$9=a,this.$10=new(o("DGWAckManager")).DGWAckManager(this.$9),this.$12=new(o("DGWStreamEvents")).DGWStreamEvents(this.$9,o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT,this.$1),this.$11=0,this.$13=l,this.$14=Date.now()+(Math.round(o("Random").random()*1e4)+1e4),this.$15=!1,this.$9.qplMarkerStart(o("IDGWLoggingContext").QPLEvent.STREAM_LIFECYCLE,this.$14)}var t=e.prototype;return t.send=async function(t,n){var e=this.$11++%o("DGWConstants").MAX_ACK_ID,r=this.$16(t,!0,e);if(!this.$17(r,!0,e))return!1;var a=await this.$10.waitForAck(e,n!=null?n:o("DGWConstants").DEFAULT_ACK_TIMEOUT_MS);return a},t.sendFrame=async function(t,n,a){var e=this.$11++%o("DGWConstants").MAX_ACK_ID,i=this.$16(n,!0,e);if(i==null)return!1;var l=new Uint8Array(t.length+i.length);if(l.set(t),l.set(i,t.length),!this.$17(l,!0,e))return!1;var s=await this.$10.waitForAck(e,a!=null?a:o("DGWConstants").DEFAULT_ACK_TIMEOUT_MS);if(this.__markerPoint(s?"ack_recevied":"ack_timeout"),!s){this.__endMarker(o("IDGWLoggingContext").QPLResult.FAIL);var u=this.$10.wasTransportClosed()?o("DGWStream").StreamError.ACK_TRANSPORT_CLOSED:o("DGWStream").StreamError.ACK_TIMEOUT;return Promise.reject(r("err")(u))}return s},t.sendAndForget=function(t){var e=this.$16(t,!1,0);return this.$17(e,!1,0)},t.sendFrameAndForget=function(t,n){var e=this.$16(n,!1,0);if(e==null)return!1;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),this.$17(r,!1,0)},t.close=function(){var e=this.$2.encodeEndOfData(this.$1);if(e==null){this.$9.logError(o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT,"Failed to encode EndOfData","streamId: "+this.$1);return}var t=this.$8.send(e);if(!t){this.$9.logError(o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT,"Failed to send EndOfData","streamId: "+this.$1+". StreamGroupTransport not open during send");return}this.$12.endOfDataSent(),this.$5=!0,this.$4&&this.$18()},t.loggingContext=function(){return this.$9},t.__sendDrain=function(t){var e=o("DGWConstants").drainReasonToDrainReasonString(t);if(this.$5)return!1;var n=this.$2.encodeDrain(t);if(n==null)return!1;this.$12.drainSent(e);var r=this.$8.send(n);return r},t.__transportCloseHook=function(t){this.$13(),this.$10.clearPendingAcks(),t?(this.$12.error("Received StreamError","StreamErrorType: "+t),this.$6.onError(t)):this.$5&&this.$4?this.$18():(this.$12.streamClosed(!1,"Stream closed: ClosedLocally: "+this.$5.toString()+", EndOfDataReceived: "+this.$4.toString()),this.$6.onError(o("DGWStream").StreamError.PREMATURE_CLOSE))},t.$18=function(){this.$13(),this.$12.streamClosed(!0,"Graceful close"),this.$6.onClose(this)},t.__dataReceivedHook=function(t,n){this.$12.dataReceived(t.length,n!=null,n),n!=null&&this.$19(n),this.$6.onDataReceived(t)},t.__ackReceivedHook=function(t){this.$12.ackReceived(t),this.$10.handleAckReceived(t)},t.__drainReceivedHook=function(t){this.$3===!1&&(this.$6.onStreamMustDrain(this,t),this.$3=!0)},t.__endOfDataHook=function(){this.$12.endOfDataReceived(),this.$4=!0,this.$5?this.$18():this.$6.onServerHasFinishedSendingData(this)},t.__markerPoint=function(t){this.$15||this.$9.qplMarkerPoint(o("IDGWLoggingContext").QPLEvent.STREAM_LIFECYCLE,t,this.$14)},t.__markerAnnotate=function(t){this.$15||this.$9.qplMarkerAnnotate(o("IDGWLoggingContext").QPLEvent.STREAM_LIFECYCLE,t,this.$14)},t.__endMarker=function(t){this.$15||(this.$15=!0,this.$9.qplMarkerEnd(o("IDGWLoggingContext").QPLEvent.STREAM_LIFECYCLE,t,this.$14))},t.$16=function(t,n,r){return this.$2.encodeData(t,n,r,this.$1)},t.$17=function(t,n,r){if(this.__markerPoint("send_data_start"),this.$5)return this.$9.logError(o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT,"Failed to send data","Stream closed locally"),!1;if(t==null)return!1;var e=this.$8.send(t);return e?(this.__markerPoint("send_data_end"),this.$12.dataSent(t.length,n,r),!0):(this.$9.logError(o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT,"Failed to send data","ClosedLocally: "+this.$5.toString()),!1)},t.$19=function(t){var e=this.$2.encodeAck(t,this.$1);if(e==null)return this.$9.logError(o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT,"Failed to encode ACK","ackId: "+t),!1;var n=this.$8.send(e);return n?(this.$12.ackSent(t),!0):(this.$9.logError(o("IDGWLoggingContext").DGWLoggingComponent.GROUPED_STREAM_COMPONENT,"Failed to send ACK","ackId: "+t),!1)},e})();l.GroupedStream=e}),98);
__d("NoOpDGWLoggingContext",["IDGWLoggingContext"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(){}var t=e.prototype;return t.streamRequested=function(t){},t.streamClosed=function(t){},t.tabClosed=function(){},t.getGlobalState=function(){return{realtime:0,lightspeed:0}},e})(),s=new e,u=(function(){function e(){this.sgTransportId=null}var t=e.prototype;return t.getGlobalLogger=function(){return s},e.bumpODSKey=function(t,n,r){},t.bumpODSKey=function(t,n,r){},t.logEvent=function(t,n,r,o,a){},t.logError=function(t,n,r,o,a,i){},t.logWarn=function(t,n,r,o,a){},t.qplMarkerStart=function(t,n){},t.qplMarkerEnd=function(t,n,r){},t.qplMarkerPoint=function(t,n,r){},t.qplMarkerAnnotate=function(t,n,r){},e})();l.DGWLoggingComponent=o("IDGWLoggingContext").DGWLoggingComponent,l.QPLEvent=o("IDGWLoggingContext").QPLEvent,l.QPLResult=o("IDGWLoggingContext").QPLResult,l.NoOpDGWLoggingContext=u,l.DGWLoggingContext=u}),98);
__d("StreamIdGenerator",["err"],(function(t,n,r,o,a,i,l){"use strict";var e=65535,s=(function(){function t(){this.$1=new Set,this.$2=0}var n=t.prototype;return n.getNextStreamId=function(){var t;if(!this.streamIdAvailable())throw r("err")("Max number of stream IDs reached");if(this.$2<=e)return this.$2++;var n=(t=this.$1.values().next().value)!=null?t:0;return this.$1.delete(n),n},n.putBackStreamId=function(t){this.$1.add(t)},n.streamIdAvailable=function(){return this.$1.size>0||this.$2<=e},t})();l.MAX_STREAM_ID=e,l.StreamIdGeneratorImpl=s}),98);
__d("StreamGroupWebSocketTransport",["DGWConstants","DGWExponentialBackoff","DGWPinger","DGWStream","DGWStreamGroupCallbacks","DGWTransportEvents","DGWUtils","DGWWebSocketTransport","GroupedStream","IDGWLoggingContext","NoOpDGWLoggingContext","Random","Run","StreamIdGenerator","err","getErrorSafe"],(function(t,n,r,o,a,i,l){"use strict";var e=!1,s=function(t,n,a,i,l){var e=this;this.groupedStream=t,this.$1=window.setTimeout(function(){a(r("err")(o("DGWStream").StreamError.ESTABLISHMENT_TIMEOUT))},i),this.handleEstablishFrameReceived=function(){window.clearTimeout(e.$1),n(e.groupedStream)},this.abortStream=function(e){l(),a(r("err")(e))}},u=(function(){function e(t,n,a,i,l,s,u,c,d){var m=this,p;this.$18=-1,this.$15=l,this.$17=this.__getStreamIdGenerator(),this.$5=new Map,this.$6=new Map,this.$7=i.keepAliveMs,this.$8=!1,this.$9=!1,this.$3=!0,this.$4=!1,this.$20=!1,this.$21=!1,this.$13=a,this.$11=new TextEncoder,this.$12=new TextDecoder,this.$14=i;var _={onDataReceived:function(){},handleAckReceived:function(){},receivedDrainSignal:function(t){m.$9||(m.$9=!0,m.$15(),m.$13.transportClosed(!0,""),m.$14.streamGroupCallbacks.onStreamGroupMustDrain(t),m.$5.forEach(function(e){e.__drainReceivedHook(t)}),m.onClose(o("DGWConstants").WebsocketCloseCodes.GRACEFUL_CLOSE))},onGroupedStreamDataReceived:function(t,n,r){if(m.$5.has(t)){var e=m.$5.get(t);e==null||e.__dataReceivedHook(n,r)}else m.$13.receivedFrameForInactiveStream("Data",t,"sendAckID: "+(r!=null?r:"null"))},onGroupedStreamAckReceived:function(t,n){if(m.$5.has(t)){var e=m.$5.get(t);e==null||e.__ackReceivedHook(n)}else m.$13.receivedFrameForInactiveStream("ACK",t,"ackId: "+(n!=null?n:"null"))},onGroupedStreamEndOfDataReceived:function(t){if(m.$5.has(t)){var e=m.$5.get(t);e==null||e.__endOfDataHook()}else m.$13.receivedFrameForInactiveStream("EndOfData",t)},onGroupedStreamEstablishStreamReceived:function(t,n){if(m.$6.has(t)){var e=m.$6.get(t);m.$6.delete(t);var r=JSON.parse(m.$12.decode(n));(r.code===void 0||r.code!==200)&&(e==null||e.abortStream(o("DGWStream").StreamError.ABNORMAL_CLOSURE)),e==null||e.handleEstablishFrameReceived()}else m.$13.receivedFrameForInactiveStream("EstablishStream",t,"EstablishStream received for non-inflight stream")},onPingReceived:function(){var e=m.$2.encodePing();e!=null&&m.send(e)},onPongReceived:function(){m.$3=!1,m.$21||(m.$21=!0,m.__markerPoint("auth_success")),m.$13.transportPongReceived("readyState:"+m.$1.readyState+", bufferedAmount:"+m.$1.bufferedAmount)}};this.$2=new(o("DGWUtils")).DGWCodec(s,_,i.dgwVersion),this.$19=Date.now()+(Math.round(o("Random").random()*1e4)+1e4),this.$22=s.getGlobalLogger(),this.$23=(p=i.connectTimeoutMs)!=null?p:2e4,this.$24=s,this.$25=d;var f=o("Run").onUnload(function(){m.$22.tabClosed()});if(i.enableFirstStreamOnWsHandshake){var g,h,y,C;if(u===void 0)throw r("err")("Missing grouped stream options");if(c===void 0)throw r("err")("Missing grouped stream callbacks");var b=this.$17.getNextStreamId(),v=this.createEstablishStreamFrame(b,u),S=o("DGWUtils").DGWUtils.constructConnectUrl({appId:i.appId,appVersion:i.appVersion,authType:i.authType,deviceId:(g=i.deviceId)!=null?g:void 0,dgwVersion:i.dgwVersion,fbId:i.fbId,tier:i.tier,loggingId:(h=i.loggingId)!=null?h:void 0,headers:e.__prefixAppHeaders(i.headers),endpoint:i.connectEndpoint,serviceId:i.serviceId,regionHint:(y=i.regionHint)!=null?y:void 0,establishStreamFrame:v,authToken:(C=i.authToken)!=null?C:void 0});if(this.$1=n(S),!S.includes(o("DGWConstants").HEADER_CONSTANTS.HEADER_ESTABLISH_STREAM_FRAME_BASE64))return;var R=this.$25!=null?this.$25(u.loggingId,u.disableFalcoLogging):new(o("NoOpDGWLoggingContext")).NoOpDGWLoggingContext,L=this.__createGroupedStream(b,c,u,R);this.$16=this.waitForEstablishStream(b,L,u,function(e){m.$5.set(b,e)},function(){m.$17.putBackStreamId(b)})}else this.$1=n(t);this.$22.streamRequested(i.serviceId),this.$24.qplMarkerStart(o("IDGWLoggingContext").QPLEvent.STREAM_GROUP_TRANSPORT,this.$19),this.__markerAnnotate({string:{serviceId:this.$14.serviceId,streamGroupId:this.$14.loggingId}})}var t=e.prototype;return t.send=function(t){try{return this.$1.send(t),!0}catch(e){return this.$13.transportError("Failed to send over transport","readyState: "+this.$1.readyState,r("getErrorSafe")(e).message),!1}},t.close=function(){var e;this.$22.streamClosed(this.$14.serviceId),this.__markerPoint("teardown"),this.$8=!0,(e=this.$10)==null||e.cancel(),this.$1.onopen=function(e){},this.$1.onmessage=function(e){},this.$1.onerror=function(e){},this.$15(),this.$1.close()},t.onClose=function(t){var e;this.$22.streamClosed(this.$14.serviceId),this.__markerPoint("abort"),this.__markerAnnotate({int:{abort_code:t}}),this.$8=!0,(e=this.$10)==null||e.cancel(),this.$1.close(t)},t.abort=function(t,n,r,o,a){this.$8||(this.$22.streamClosed(this.$14.serviceId),this.$8=!0,this.$13.transportClosed(!1,o,a),this.$5.forEach(function(e){e.__transportCloseHook(n)}),this.$6.forEach(function(e){e.abortStream(n)}),this.$14.streamGroupCallbacks.onStreamGroupError(t),this.$5.clear(),this.$6.clear(),this.$15(),this.onClose(r))},e.getTransportWithInitialStream=async function(n,r,a,i,l,s,u){await o("DGWUtils").DGWCodec.initialize();var t=new(o("DGWTransportEvents")).DGWTransportEvents(i);t.transportEstablishmentPending();var c=function(){return e.$26("",a,t,l,i,n,r,u)};try{var d=await o("DGWExponentialBackoff").callWithExponentialBackoff(c,s),m=u!=null?u(n.loggingId,n.disableFalcoLogging):new(o("NoOpDGWLoggingContext")).NoOpDGWLoggingContext,p=d.$16!=null?d.$16:d.establishGroupedStream(r,n,m);return{transport:d,streamPromise:p}}catch(e){throw e}},e.getTransport_DEPRECATED=async function(n,r,a,i,l,s){await o("DGWUtils").DGWCodec.initialize();var t=new(o("DGWTransportEvents")).DGWTransportEvents(a);t.transportEstablishmentPending();var u=function(){return e.$26(n,r,t,i,a,void 0,void 0,s)};try{return await o("DGWExponentialBackoff").callWithExponentialBackoff(u,l)}catch(e){throw e}},t.establishGroupedStream=async function(t,n,a,i,l,s){var e=this;l===void 0&&(l=!0);var u=this.getStreamId(),c=this.createEstablishStreamFrame(u,n),d=this.__createGroupedStream(u,t,n,a);d.__markerAnnotate({string:{serviceId:this.$14.serviceId,streamGroupId:this.$14.loggingId,streamId:n.streamTraceId}}),s!=null&&d.__markerAnnotate(s);var m=this.waitForEstablishStream(u,d,n,function(t){e.$5.set(u,t)},function(){e.$17.putBackStreamId(u)});if(i!=null){var p;d.__markerPoint("send_payload_start"),d.__markerAnnotate({int:{establishStreamPayloadSize:i.byteLength}});var _=(p=n.ackTimeoutMs)!=null?p:3e4,f=l?await d.sendFrame(c,i,_):d.sendFrameAndForget(c,i);return f?(d.__markerPoint("send_payload_end"),d.__endMarker(o("IDGWLoggingContext").QPLResult.SUCCESS),Promise.resolve(d)):(d.__endMarker(o("IDGWLoggingContext").QPLResult.FAIL),Promise.reject(r("err")("Failed to send data when establishing stream")))}if(d.__markerPoint("send_establish_stream_start"),!this.send(c))throw d.__endMarker(o("IDGWLoggingContext").QPLResult.FAIL),r("err")("Websocket connection closed before stream established");d.__markerPoint("send_establish_stream_end");var g=await m;return d.__endMarker(o("IDGWLoggingContext").QPLResult.SUCCESS),g},e.__prefixAppHeaders=function(t){return Object.keys(t).reduce(function(e,n){return e[""+o("DGWConstants").HEADER_CONSTANTS.APPHEADER_PREFIX+n]=t[n],e},{})},t.waitForEstablishStream=async function(t,n,r,o,a){var e=this;this.$13.streamEstablishmentPending(t,r.loggingId);try{var i=await new Promise(function(r,o){e.$6.set(t,new s(n,r,o,3e4,function(){e.streamEndCallback(t)}))});return o(n),this.$13.streamEstablishmentSuccess(t,r.loggingId),i}catch(e){throw a(),this.$13.streamEstablishmentTimeout("Stream establishment timeout. readyState: "+this.$1.readyState,t,r.loggingId),e}},e.$26=async function(n,a,i,l,s,u,c,d){var t=new e(n,o("DGWWebSocketTransport").getWebSocketConnection,i,a,l,s,u,c,d);t.$1.onmessage=e.$27(t),t.$1.onopen=function(){t.__markerPoint("onopen"),i.transportEstablished(n),t.$10!=null&&t.$10.cancel(),t.$7!=null&&(t.$10=new(o("DGWPinger")).DGWPinger(t.$7,function(){t.$28()},function(){t.abort(o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_KEEPALIVE_TIMEOUT,o("DGWStream").StreamError.KEEPALIVE_TIMEOUT,o("DGWConstants").WebsocketCloseCodes.KEEPALIVE_TIMEOUT,"Aborting transport because of keepalive timeout","readyState:"+t.$1.readyState+", bufferedAmount:"+t.$1.bufferedAmount)},s))},t.$1.onerror=function(){t.__markerPoint("onerror"),t.$13.transportError("onerror","readyState: "+t.$1.readyState)},t.$1.onclose=e.$29(t);try{return await e.getTransportPromise(t)}catch(f){if(t.$3){var m=await o("DGWWebSocketTransport").primeInternalCertOnce(t.$1.url);if(m){var p="url:"+t.$1.url;t.__markerPoint("internal_cert_priming_retry_attempt"),i.internalCertPrimingRetryAttempt(p);try{var _=await e.$26(n,a,i,l,s,u,c,d);return t.__markerPoint("internal_cert_priming_retry_success"),i.internalCertPrimingRetrySuccess(p),_}catch(e){throw t.__markerPoint("internal_cert_priming_retry_failure"),i.internalCertPrimingRetryFailure(r("getErrorSafe")(e).message,p),e}}}throw f}},e.getTransportPromise=async function(t){var e,n=t.$1.onerror,a=t.$1.onmessage,i=t.$1.onclose,l=new Promise(function(n,a){e=window.setTimeout(function(){t.$15(),t.$13.transportClosed(!1,"TIMEOUT"),t.__markerPoint("connect_timeout"),t.close(),a(r("err")(o("DGWStream").StreamError.TRANSPORT_ESTABLISHMENT_TIMEOUT))},t.$23)}),s=new Promise(function(e,l){t.$1.onerror=function(){n(),t.close(),l(r("err")(o("DGWStream").StreamError.ESTABLISHMENT_ERROR))},t.$1.onclose=function(e){i(e),e.code===o("DGWConstants").WebsocketCloseCodes.UNAUTHORIZED?l(r("err")(o("DGWStream").StreamError.UNAUTHORIZED)):l(r("err")(e.code+":"+e.reason))},t.$1.onmessage=function(n){a(n),t.$3||(t.__markerPoint("connect_success"),e(t))}});try{return await Promise.race([s,l])}finally{e!=null&&window.clearTimeout(e),t.$1.onerror=n,t.$1.onmessage=a,t.$1.onclose=i}},e.$27=function(t){return function(e){var n;if(t.$2==null){var r;(r=t.$13)==null||r.transportError("Codec Not Ready","Received message before codec was initialized or after close");return}if(t.$20||(t.$20=!0,t.__markerPoint("onmessage")),(n=t.$10)==null||n.reset(),!(e.data instanceof ArrayBuffer)){var o;(o=t.$13)==null||o.transportError("Incorrect Data Protocol","Received "+typeof e.data+" instead of ArrayBuffer");return}t.$2.append(new Uint8Array(e.data)),t.$2.processData()}},e.$29=function(t){return function(e){var n,r=t.$22.getGlobalState();if(t.__markerPoint("onclose"),t.__markerAnnotate({string:{reason:e.reason},int:{code:e.code,realtimeWebSockets:r.realtime,lightspeedWebSockets:r.lightspeed}}),t.__endMarker(e.code===o("DGWConstants").WebsocketCloseCodes.GRACEFUL_CLOSE?o("IDGWLoggingContext").QPLResult.SUCCESS:o("IDGWLoggingContext").QPLResult.FAIL),(n=t.$10)==null||n.cancel(),!(t.$8===!0||t.$4)){if(t.$22.streamClosed(t.$14.serviceId),t.$8=!0,t.$3===!0){t.$13.transportEstablishmentFailure(e),t.$5.clear(),t.$15();return}if(t.$15(),t.$3=!0,e.code!==o("DGWConstants").WebsocketCloseCodes.GRACEFUL_CLOSE){t.$13.transportClosed(!1,"Websocket connection failure with code: "+e.code+" reason: "+e.reason+" wasClean: "+String(e.wasClean));var a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_UNKNOWN_ERROR,i=o("DGWStream").StreamError.UNKNOWN_ERROR;switch(e.code){case o("DGWConstants").WebsocketCloseCodes.NORMAL_CLOSURE:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_NORMAL_CLOSURE,i=o("DGWStream").StreamError.ABNORMAL_CLOSURE;break;case o("DGWConstants").WebsocketCloseCodes.ABNORMAL_CLOSURE:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_ABNORMAL_CLOSURE,i=o("DGWStream").StreamError.ABNORMAL_CLOSURE;break;case o("DGWConstants").WebsocketCloseCodes.SERVER_INTERNAL_ERROR:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_SERVER_INTERNAL_ERROR,i=o("DGWStream").StreamError.SERVER_INTERNAL_ERROR;break;case o("DGWConstants").WebsocketCloseCodes.GOING_AWAY:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_GOING_AWAY,i=o("DGWStream").StreamError.GOING_AWAY;break;case o("DGWConstants").WebsocketCloseCodes.UNAUTHORIZED:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_UNAUTHORIZED,i=o("DGWStream").StreamError.UNAUTHORIZED;break;case o("DGWConstants").WebsocketCloseCodes.REJECTED:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_REJECTED,i=o("DGWStream").StreamError.REJECTED;break;case o("DGWConstants").WebsocketCloseCodes.BAD_REQUEST:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_BAD_REQUEST,i=o("DGWStream").StreamError.BAD_REQUEST;break;case o("DGWConstants").WebsocketCloseCodes.DGW_SERVER_ERROR:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_SERVER_INTERNAL_ERROR,i=o("DGWStream").StreamError.DGW_SERVER_ERROR,a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_DGW_SERVER_ERROR;break;default:a=o("DGWStreamGroupCallbacks").DGWStreamGroupError.TRANSPORT_UNKNOWN_ERROR,i=o("DGWStream").StreamError.UNKNOWN_ERROR;break}t.$14.streamGroupCallbacks.onStreamGroupError(a),t.$5.forEach(function(e){e.__transportCloseHook(i)}),t.$6.forEach(function(e){e.abortStream(i)})}else t.$13.transportClosed(!0,""),t.$14.streamGroupCallbacks.onStreamGroupTransportClose(),t.$5.forEach(function(e){e.__transportCloseHook()}),t.$6.forEach(function(e){e.abortStream(o("DGWStream").StreamError.TRANSPORT_CLOSED_BEFORE_STREAM_INIT)});t.$5.clear(),t.$6.clear()}}},t.$28=function(){var e=this.$2.encodePing();if(e==null)throw r("err")("Failed to encode Ping Frame");var t=this.send(e);this.$18=this.$1.bufferedAmount,this.$13.transportPingSent("readyState:"+this.$1.readyState+", bufferedAmount:"+this.$18+", payloadSize:"+(e==null?void 0:e.byteLength)+", sent:"+String(t))},t.isClosedLocally=function(){return this.$3||this.$8||this.$4},t.streamEndCallback=function(t){this.$5.delete(t),this.$6.delete(t),this.$17.putBackStreamId(t)},t.canCreateGroupedStream=function(){return this.$17.streamIdAvailable()},t.createEstablishStreamFrame=function(n,a){var t=e.__prefixAppHeaders(a.groupedStreamHeaders);a.streamTraceId!=null&&(t[o("DGWConstants").HEADER_CONSTANTS.HEADER_STREAM_TRACE_ID]=a.streamTraceId);var i=this.$2.encodeEstablishStream(n,new Uint8Array(this.$11.encode(JSON.stringify(t))));if(i==null)throw this.$17.putBackStreamId(n),r("err")("Failed to encode EstablishStreamFrame");return i},t.getStreamId=function(){try{return this.$17.getNextStreamId()}catch(e){throw this.$13.ranOutOfStreamIds("inFlightGroupedStreamSize: "+this.$6.size+" groupedStreamSize: "+this.$5.size),e}},t.__createGroupedStream=function(t,n,r,a){var e=this;return new(o("GroupedStream")).GroupedStream(t,n,r,this,a,this.$2,function(){e.streamEndCallback(t)})},t.__getStreamIdGenerator=function(){return new(o("StreamIdGenerator")).StreamIdGeneratorImpl},t.__markerPoint=function(t){this.$24.qplMarkerPoint(o("IDGWLoggingContext").QPLEvent.STREAM_GROUP_TRANSPORT,t,this.$19)},t.__markerAnnotate=function(t){this.$24.qplMarkerAnnotate(o("IDGWLoggingContext").QPLEvent.STREAM_GROUP_TRANSPORT,t,this.$19)},t.__endMarker=function(t){this.$24.qplMarkerEnd(o("IDGWLoggingContext").QPLEvent.STREAM_GROUP_TRANSPORT,t,this.$19)},e})();l.StreamGroupWebSocketTransport=u}),98);
__d("StreamGroup",["DGWConstants","DGWLoggingContext","DGWUtils","StreamGroupWebSocketTransport"],(function(t,n,r,o,a,i,l){"use strict";var e={maxRetries:0,baseRetryInterval:1e3,backoffFactor:Math.sqrt(2)},s=(function(){function t(e,t,n,r,a,i,l,s,u,c){var d,m,p,_,f,g,h,y,C;this.$2=u,this.$1=u.getNewStreamGroupId();var b=(d=l.overrideUrl)!=null?d:a;this.$6=null,this.$3={appId:e,appVersion:t,authType:(m=l.authType)!=null?m:n,deviceId:l.deviceId,dgwVersion:r,headers:l.streamGroupAppHeaders,tier:(p=l.serviceTier)!=null?p:o("DGWConstants").DEFAULT_SERVICE_TIER,connectEndpoint:b,fbId:i,loggingId:l.loggingId,serviceId:l.serviceId,streamGroupCallbacks:s,keepAliveMs:l.keepAliveMs,regionHint:l.regionHint,enableFirstStreamOnWsHandshake:!1,authToken:l.authToken,connectTimeoutMs:l.connectTimeoutMs},this.$4=l,this.$5=c,this.streamGroupLoggingContext=this.$5(null,!1,(_=l.verboseLoggingEnabled)!=null?_:!1),this.$7=o("DGWUtils").DGWUtils.constructConnectUrl({appId:this.$3.appId,appVersion:this.$3.appVersion,authType:this.$3.authType,deviceId:(f=this.$3.deviceId)!=null?f:void 0,dgwVersion:this.$3.dgwVersion,fbId:this.$3.fbId,headers:babelHelpers.extends({},this.$3.headers),loggingId:(g=this.$3.loggingId)!=null?g:void 0,tier:this.$3.tier,serviceId:this.$3.serviceId,endpoint:this.$3.connectEndpoint,regionHint:(h=this.$3.regionHint)!=null?h:void 0,trafficTracing:(y=this.$4.trafficTracing)!=null?y:void 0,authToken:(C=this.$4.authToken)!=null?C:void 0})}var n=t.prototype;return n.initTransport=async function(){var e=this,t={maxRetries:0,baseRetryInterval:1e3,backoffFactor:Math.sqrt(2)};this.$6=this.$6||o("StreamGroupWebSocketTransport").StreamGroupWebSocketTransport.getTransport_DEPRECATED(this.$7,this.$3,this.streamGroupLoggingContext,function(){e.$2.removeStreamGroupAndTransport(e.$1)},t,this.$5);var n;try{n=await this.$6,this.$6=null}catch(e){throw this.$6=null,e}return this.$2.containsStreamGroup(this.$1)||this.$2.setStreamGroupAndTransport(this.$1,n),n},n.establishStream=async function(n,r,a,i,l){var t=this;if(this.$2.containsStreamGroup(this.$1)===!1)if(this.streamGroupLoggingContext.logEvent(o("DGWLoggingContext").DGWLoggingComponent.STREAM_GROUP_COMPONENT,"createTransportWhenEstablishStream"),this.$3.enableFirstStreamOnWsHandshake){var u=await o("StreamGroupWebSocketTransport").StreamGroupWebSocketTransport.getTransportWithInitialStream(n,r,this.$3,this.streamGroupLoggingContext,function(){t.$2.removeStreamGroupAndTransport(t.$1)},e,this.$5);return this.$2.setStreamGroupAndTransport(this.$1,u.transport),u.streamPromise}else{this.$6=this.$6||o("StreamGroupWebSocketTransport").StreamGroupWebSocketTransport.getTransport_DEPRECATED(this.$7,this.$3,this.streamGroupLoggingContext,function(){t.$2.removeStreamGroupAndTransport(t.$1)},e,this.$5);var s;try{s=await this.$6,this.$6=null}catch(e){throw this.$6=null,e}this.$2.containsStreamGroup(this.$1)||this.$2.setStreamGroupAndTransport(this.$1,s)}return this.establishStreamWithTransport(n,r,a,i,l)},n.establishStreamWithTransport=async function(t,n,r,a,i){var e,l=t.loggingId;this.streamGroupLoggingContext.logEvent(o("DGWLoggingContext").DGWLoggingComponent.STREAM_GROUP_COMPONENT,"Establishing Grouped Stream","initialData:"+String(r!=null),!0,l);var s=this.$5(l,t.disableFalcoLogging,(e=t.verboseLoggingEnabled)!=null?e:!1),u=await this.$2.getStreamGroupTransport(this.$1).establishGroupedStream(n,t,s,r,a,i);return u},n.canCreateGroupedStream=function(){var e=!0;if(this.$2.containsStreamGroup(this.$1)!==!1){var t=this.$2.getStreamGroupTransport(this.$1);e=t.canCreateGroupedStream()}return o("DGWLoggingContext").DGWLoggingContext.bumpODSKey(o("DGWLoggingContext").DGWLoggingComponent.STREAM_GROUP_COMPONENT,e?"can_create":"cannot_create"),e},n.close=function(){if(this.$2.containsStreamGroup(this.$1)){var e=this.$2.getStreamGroupTransport(this.$1);e.close()}},t})();l.StreamGroup=s}),98);
__d("StreamGroupRegistry",["Random","err"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(){this.$1=new Map,this.$2=new Set}var t=e.prototype;return t.setStreamGroupAndTransport=function(t,n){this.$1.set(t,n)},t.containsStreamGroup=function(t){return this.$1.has(t)},t.removeStreamGroupAndTransport=function(t){this.$1.delete(t)},t.getStreamGroupTransport=function(t){var e=this.$1.get(t);if(e==null)throw r("err")("No stream group transport");return e},t.getNewStreamGroupId=function(){for(var e=o("Random").uint32();this.$2.has(e);)e=o("Random").uint32();return this.$2.add(e),e},e})();l.StreamGroupRegistry=e}),98);
__d("isFastRefreshEnabledForCurrentDomain",[],(function(t,n,r,o,a,i){"use strict";function e(){return!1}i.default=e}),66);
__d("RawDGWClient",["DGWAuth","DGWLoggingContext","DGWStream","StreamGroup","StreamGroupRegistry","err","isFastRefreshEnabledForCurrentDomain","justknobx"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(){function e(e){var t=e.appId,n=e.appVersion,r=e.authToken,a=e.authType,i=e.dgwVersion,l=e.endpoint,s=e.fbId,u=e.isUserLoggedIn;this.$1=t,this.$2=n,this.$3=a,this.$5=i,this.$6=l,this.$7=s,this.$8=new(o("StreamGroupRegistry")).StreamGroupRegistry,this.$4=r,this.$9=u}var t=e.prototype;return t.$10=function(t,n){var e=this.$5,r=this.$7;return function(a,i,l){return new(o("DGWLoggingContext")).DGWLoggingContext(e,a,t,r,n!=null?n:null,i!=null?i:!1,l!=null?l:!1)}},t.createStreamGroup=function(t,n){var e,a,i;this.handleUserChecks((e=n.authType)!=null?e:this.$3);var l=(a=n.authToken)!=null?a:this.$4,s=r("justknobx")._("443")?(i=n.authType)!=null?i:this.$3:this.$3;l!=null&&s===o("DGWAuth").DGWAuth.GUEST&&(n.authToken=l);var u=this.$10(n.serviceId,n.loggingId);return new(o("StreamGroup")).StreamGroup(this.$1,this.$2,this.$3,this.$5,this.$6,this.$7,n,t,this.$8,u)},t.handleUserChecks=function(t){if(!this.$9()&&o("DGWAuth").fromDGWAuthToString(t)!=="GUEST"&&!r("isFastRefreshEnabledForCurrentDomain")())throw r("err")(o("DGWStream").StreamError.UNAUTHENTICATED)},e})();l.RawDGWClient=e}),98);
__d("DGWClient",["CurrentUser","DGWAuth","DGWEnvUtil","DGWWebConfig","ExecutionEnvironment","RawDGWClient","err"],(function(t,n,r,o,a,i,l){"use strict";var e,s=null;function u(){if(!r("DGWEnvUtil").isDGWEnvCompatible())throw r("err")("unsupported_environment_retry_with_mqtt");if(s==null){var t=(e||(e=r("ExecutionEnvironment"))).isInWorker;s=new(o("RawDGWClient")).RawDGWClient({appId:r("DGWWebConfig").appId,appVersion:r("DGWWebConfig").appVersion,authType:o("DGWAuth").fromStringToDGWAuth(r("DGWEnvUtil").getDGWAuthType()),dgwVersion:r("DGWEnvUtil").getDGWVersion(),endpoint:r("DGWEnvUtil").getDGWEndpoint(),fbId:r("DGWWebConfig").fbId!=="0"?r("DGWWebConfig").fbId:r("CurrentUser").getPossiblyNonFacebookUserID(),authToken:r("DGWEnvUtil").getDGWAuthToken(),isUserLoggedIn:t?function(){return r("CurrentUser").isLoggedIn()}:function(){return r("CurrentUser").isLoggedInNow()}})}return s}l.default=u}),98);
__d("DGWStreamGroupHandler",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){function e(e,t,n){this.$1=e,this.$2=t,this.$3=n}var t=e.prototype;return t.onStreamGroupError=function(t){this.$1(t)},t.onStreamGroupMustDrain=function(t){this.$2(t)},t.onStreamGroupTransportClose=function(){this.$3()},e})();i.default=e}),66);
__d("MqttConnectionHookCollection",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){function e(){this.$1=new Set}var t=e.prototype;return t.addHook=function(t){this.$1.add(t)},t.removeHook=function(t){this.$1.delete(t)},t.onConnectAttempt=function(){this.$1.forEach(function(e){e.onConnectAttempt==null||e.onConnectAttempt()})},t.onConnectFailure=function(){this.$1.forEach(function(e){e.onConnectFailure==null||e.onConnectFailure()})},t.onConnected=function(){this.$1.forEach(function(e){e.onConnected==null||e.onConnected()})},t.onConnectSuccess=function(){this.$1.forEach(function(e){e.onConnectSuccess==null||e.onConnectSuccess()})},t.onConnectionLost=function(){this.$1.forEach(function(e){e.onConnectionLost==null||e.onConnectionLost()})},t.onConnectionDisconnect=function(){this.$1.forEach(function(e){e.onConnectionDisconnect==null||e.onConnectionDisconnect()})},t.onSubscribe=function(t){this.$1.forEach(function(e){e.onSubscribe==null||e.onSubscribe(t)})},t.onUnsubscribe=function(t){this.$1.forEach(function(e){e.onUnsubscribe==null||e.onUnsubscribe(t)})},t.onPublish=function(t){this.$1.forEach(function(e){e.onPublish==null||e.onPublish(t)})},t.onMessage=function(t){this.$1.forEach(function(e){e.onMessage==null||e.onMessage(t)})},t.onWSFatal=function(){this.$1.forEach(function(e){e.onWSFatal==null||e.onWSFatal()})},e})();i.default=e}),66);
__d("SharedWorkerStatusLock",[],(function(t,n,r,o,a,i){"use strict";var e="sw-lock",l="sw-ds-lock";function s(t){return e+"-"+t}function u(e){return l+"-"+e}function c(t,n){return e+"-"+t+"-"+n}function d(){var e=null,t;function n(n){var r=self,o=r.navigator.locks;r.LockManager!=null&&o instanceof r.LockManager&&(t==null&&(t=new r.Promise(function(t){e=t})),o.request(s(r.name),function(e){if(e!=null)return t}),n.requestDynamicStringLockToo===!0&&o.request(u(r.name),function(e){if(e!=null)return t}),n.requestWorkerIdStatusLockToo===!0&&o.request(c(r.name,r.worker_id),function(e){if(e!=null)return n.onUniqueLockAckquired==null||n.onUniqueLockAckquired(),t}))}function r(){e==null||e(),t=null,e=null}return{init:n,release:r}}i.getStatusLockName=s,i.getDynamicStringInitLockName=u,i.getWorkerIdStatusLockName=c,i.getStatusLock=d}),66);
__d("TWriteBuffer",[],(function(t,n,r,o,a,i){var e=(function(){function e(t){t===void 0&&(t=e.DEFAULT_BYTE_BUFFER_SIZE),this.$1=new DataView(new ArrayBuffer(t)),this.$2=0}var t=e.prototype;return t.write=function(t){this.$2+t.length>this.$1.byteLength&&this.$3(this.$2+t.length);for(var e=0;e<t.length;e++)this.$1.setUint8(this.$2+e,t[e]);return this.$2+=t.length,t.length},t.writeByte=function(t){return this.$2+1>this.$1.byteLength&&this.$3(this.$2+1),this.$1.setUint8(this.$2,t),this.$2++,1},t.writeFloatBE=function(t){return this.$2+Float32Array.BYTES_PER_ELEMENT>this.$1.byteLength&&this.$3(this.$2+Float32Array.BYTES_PER_ELEMENT),this.$1.setFloat32(this.$2,t),this.$2+=Float32Array.BYTES_PER_ELEMENT,Float32Array.BYTES_PER_ELEMENT},t.writeDoubleBE=function(t){return this.$2+Float64Array.BYTES_PER_ELEMENT>this.$1.byteLength&&this.$3(this.$2+Float64Array.BYTES_PER_ELEMENT),this.$1.setFloat64(this.$2,t),this.$2+=Float64Array.BYTES_PER_ELEMENT,Float64Array.BYTES_PER_ELEMENT},t.toByteArray=function(){var e=new Uint8Array(this.$1.buffer,0,this.$2);return e},t.currentSize=function(){return this.$2},t.getUnderlyingDataView=function(){return this.$1},t.$3=function(t){var e=t*2;if(!Number.isSafeInteger(e)){var n=new Error("unable to resize");throw n.stack,n}for(var r=new DataView(new ArrayBuffer(e)),o=0;o<this.$2;o++)r.setUint8(o,this.$1.getUint8(o));this.$1=r},t.readByte=function(){var e=new Error("operation not supported");throw e.stack,e},t.readBytes=function(t){var e=new Error("operation not supported");throw e.stack,e},t.readFloatBE=function(){var e=new Error("operation not supported");throw e.stack,e},t.readDoubleBE=function(){var e=new Error("operation not supported");throw e.stack,e},e})();e.DEFAULT_BYTE_BUFFER_SIZE=16,i.default=e}),66);
__d("StringToUtf8",["TWriteBuffer"],(function(t,n,r,o,a,i,l){var e=function(t){for(var e=new(r("TWriteBuffer"))(t.length),n,o=0;o<t.length;o++)if(n=t.charCodeAt(o),n<128)e.writeByte(n);else if(n<2048)e.writeByte(n>>6|192),e.writeByte(n&63|128);else if((n&64512)==55296){if(o+1>=t.length){var a=new Error("UTF-16 string is truncated: ["+n.toString(16)+"]");throw a.stack,a}if((t.charCodeAt(o+1)&64512)!==56320){var i=new Error("Invalid UTF-16 string: ["+n.toString(16)+", "+t.charCodeAt(o+1).toString(16)+"]");throw i.stack,i}n=65536+((n&1023)<<10)+(t.charCodeAt(++o)&1023),e.writeByte(n>>18|240),e.writeByte(n>>12&63|128),e.writeByte(n>>6&63|128),e.writeByte(n&63|128)}else e.writeByte(n>>12|224),e.writeByte(n>>6&63|128),e.writeByte(n&63|128);return e.toByteArray()};l.StringToUtf8=e}),98);
__d("TNoOpWriteBuffer",[],(function(t,n,r,o,a,i){var e=(function(){function e(){this.$1=0}var t=e.prototype;return t.write=function(t){return this.$1+=t.length,t.length},t.writeByte=function(t){return this.$1++,1},t.writeFloatBE=function(t){return this.$1+=Float32Array.BYTES_PER_ELEMENT,Float32Array.BYTES_PER_ELEMENT},t.writeDoubleBE=function(t){return this.$1+=Float64Array.BYTES_PER_ELEMENT,Float64Array.BYTES_PER_ELEMENT},t.toByteArray=function(){var e=new Error("operation not supported");throw e.stack,e},t.currentSize=function(){return this.$1},t.readByte=function(){var e=new Error("operation not supported");throw e.stack,e},t.readBytes=function(t){var e=new Error("operation not supported");throw e.stack,e},t.readFloatBE=function(){var e=new Error("operation not supported");throw e.stack,e},t.readDoubleBE=function(){var e=new Error("operation not supported");throw e.stack,e},e})();i.default=e}),66);
__d("TReadBuffer",[],(function(t,n,r,o,a,i){var e=(function(){function e(e){this.$1=e,this.$2=0}var t=e.prototype;return t.readByte=function(){if(this.$2<this.$1.length)return this.$1[this.$2++];var e=new Error("no available byte to read");throw e.stack,e},t.readBytes=function(t){if(t<0){var e=new Error("cannot readBytes of negative length: "+t);throw e.stack,e}if(t+this.$2>this.$1.length){var n=new Error("not enough bytes to read");throw n.stack,n}var r=new Uint8Array(this.$1.buffer,this.$3(),t);return this.$2+=t,r},t.readFloatBE=function(){if(Float32Array.BYTES_PER_ELEMENT+this.$2>this.$1.length){var e=new Error("not enough bytes to read");throw e.stack,e}var t=new DataView(this.$1.buffer).getFloat32(this.$3());return this.$2+=Float32Array.BYTES_PER_ELEMENT,t},t.readDoubleBE=function(){if(Float64Array.BYTES_PER_ELEMENT+this.$2>this.$1.length){var e=new Error("not enough bytes to read");throw e.stack,e}var t=new DataView(this.$1.buffer).getFloat64(this.$3());return this.$2+=Float64Array.BYTES_PER_ELEMENT,t},t.$3=function(){return this.$2+this.$1.byteOffset},t.getCurrentCursor=function(){return this.$2},t.writeByte=function(t){var e=new Error("operation not supported");throw e.stack,e},t.write=function(t){var e=new Error("operation not supported");throw e.stack,e},t.toByteArray=function(){var e=new Error("operation not supported");throw e.stack,e},t.writeFloatBE=function(t){var e=new Error("operation not supported");throw e.stack,e},t.writeDoubleBE=function(t){var e=new Error("operation not supported");throw e.stack,e},e})();i.default=e}),66);
__d("ThriftTypes",[],(function(t,n,r,o,a,i){var e=Object.freeze({STOP:0,VOID:1,BOOL:2,BYTE:3,I08:3,DOUBLE:4,I16:6,I32:8,I64:10,STRING:11,STRUCT:12,MAP:13,SET:14,LIST:15,FLOAT:19}),l=e;i.default=l}),66);
__d("Utf8ToString",[],(function(t,n,r,o,a,i){var e=function(t,n){var e=new Error(t+": ["+n.map(function(e){return e.toString(16)}).toString()+"]");throw e.stack,e},l=function(n){e("Invalid UTF-8 sequence",n)},s=function(n,r){e("Not enough bytes for "+n+"-byte sequence",r)},u=function(t){for(var e=0,n=[];e<t.length;){var r=t[e++];if(r<128)n.push(String.fromCharCode(r));else if(r>=128&&r<194)l([r]);else if(r>=194&&r<224){e>=t.length&&s(2,[r]);var o=t[e++];(o&192)!==128&&l([r,o]),n.push(String.fromCharCode((r&31)<<6|o&63))}else if(r>=240&&r<245){e+2>=t.length&&s(4,[r]);var a=t[e++],i=t[e++],u=t[e++];(r==240&&(!(a>=144&&a<192)||(i&192)!==128||(u&192)!==128)||r>=241&&r<244&&((a&192)!==128||(i&192)!==128||(u&192)!==128)||r==244&&(!(a>=128&&a<144)||(i&192)!==128||(u&192)!==128))&&l([r,a,i,u]);var c=((r&7)<<18|(a&63)<<12|(i&63)<<6|u&63)-65536;n.push(String.fromCharCode(55296+(c>>10))),n.push(String.fromCharCode(56320+(c&1023)))}else if(r>=245)l([r]);else{e+1>=t.length&&s(3,[r]);var d=t[e++],m=t[e++];r==224?d>=160&&d<192||l([r,d,m]):r>=225&&r<237?d>=128&&d<192||l([r,d,m]):r==237?d>=128&&d<160||l([r,d,m]):r>=238&&r<240&&(d>=128&&d<192||l([r,d,m])),m>=128&&m<192||l([r,d,m]),n.push(String.fromCharCode((r&15)<<12|(d&63)<<6|m&63))}}return n.join("")};i.Utf8ToString=u}),66);
__d("ZenonSignalingProtocol",["$InternalEnum"],(function(t,n,r,o,a,i){"use strict";var e=n("$InternalEnum")({MW:"mw",MWPP:"mw++",ULLC:"ullc"}),l=e;i.default=l}),66);