;/*FB_PKG_DELIM*/

__d("BaseToastContentWrapper.react",["BaseTheme.react","BaseView.react","Dsp2BaseThemeContext.react","Dsp2BaseThemeGated.react","XPlatReactFocusRegion.react","basePushToast","focusScopeQueries","react","react-compiler-runtime","useCurrentDisplayMode"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react")),j=h.useContext,k={dark:"__fb-dark-mode ",light:"__fb-light-mode ",type:"CLASSNAMES"};function a(a){var b=d("react-compiler-runtime").c(12),e=a.ariaLabelledBy,f=a.children,g=a.ref,h=a.role,l=a.testid,m=a.themeConfig,n=a.useInvertedDisplayMode;a=a.xstyle;var o=c("useCurrentDisplayMode")();o=o==="dark"?"light":"dark";var p=j(c("Dsp2BaseThemeContext.react"));b[0]!==e||b[1]!==f||b[2]!==p||b[3]!==o||b[4]!==h||b[5]!==l||b[6]!==m||b[7]!==n||b[8]!==a?(g=n?c("Dsp2BaseThemeGated.react")?i.jsx(c("Dsp2BaseThemeGated.react"),{"aria-labelledby":e,displayMode:o,ref:g,role:h,testid:void 0,themes:p,xstyle:a,children:f}):i.jsx(c("BaseTheme.react"),{"aria-labelledby":e,config:m!=null?m:k,displayMode:o,ref:g,role:h,testid:void 0,xstyle:a,children:f}):i.jsx(c("BaseView.react"),{"aria-labelledby":e,ref:g,role:h,testid:void 0,xstyle:a,children:f}),b[0]=e,b[1]=f,b[2]=p,b[3]=o,b[4]=h,b[5]=l,b[6]=m,b[7]=n,b[8]=a,b[9]=g):g=b[9];e=g;b[10]!==e?(f=d("basePushToast").passesNewToastAPIGK()?i.jsx(c("XPlatReactFocusRegion.react"),{containFocusQuery:d("focusScopeQueries").tabbableScopeQuery,children:e}):e,b[10]=e,b[11]=f):f=b[11];return f}g["default"]=a}),98);
__d("BaseToast.react",["BaseInlinePressable.react","BaseToastContentWrapper.react","BaseView.react","XPlatReactFocusRegion.react","basePushToast","focusScopeQueries","react","react-compiler-runtime"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react"));b=h;var j=b.useId;b.useMemo;var k={item:{display:"x78zum5",flexDirection:"xdt5ytf",paddingBottom:"x19yoh24",paddingStart:"xrxijuk",paddingEnd:"xpowjs8",paddingLeft:null,paddingRight:null,paddingTop:"x6enp1t",$$css:!0},itemText:{flexGrow:"x1iyjqo2",$$css:!0},link:{wordBreak:"xdnwjd9",$$css:!0},root:{alignItems:"x6s0dn4",backgroundColor:"x1wkzo03",borderTopColor:"xlnzwam",borderEndColor:"x12rs7x4",borderBottomColor:"xm9qwu6",borderStartColor:"xup3dfi",borderTopStartRadius:"x1192kqh",borderTopEndRadius:"xjfsc2c",borderBottomEndRadius:"xg8fqjl",borderBottomStartRadius:"x1kdh5me",borderTopStyle:"xhf2mca",borderEndStyle:"xrf2tuc",borderBottomStyle:"x13y0ya8",borderStartStyle:"x1pyzo2z",borderTopWidth:"xmqxc35",borderEndWidth:"x7gbks2",borderBottomWidth:"x21fg80",borderStartWidth:"x1q3d8fi",boxShadow:"xi1c1fh",display:"x78zum5",flexShrink:"x2lah0s",maxWidth:"x1cs6qxi",minWidth:"x1hqenl9",paddingTop:"x192rfv7",paddingBottom:"x13jxccy",paddingStart:"xuv3zuj",paddingEnd:"xd3owfx",paddingLeft:null,paddingRight:null,$$css:!0},rootDense:{minWidth:"xktpd3l",$$css:!0},rootFullWidth:{width:"xh8yej3",$$css:!0}};function a(a){var b=d("react-compiler-runtime").c(45),e=a.action,f=a.addOnStart,g=a.closeButton,h=a.density,l=a.linkWrapper,m=a.message,n=a.offsetStyles,o=a.onDismiss,p=a.size,q=a.testid,r=a.themeConfigOverride,s=a.toastRef,t=a.useInvertedDisplayMode;a=a.variant;p=p===void 0?"full-width":p;t=t===void 0?!0:t;var u=j();bb0:{if(e!=null){var v;b[0]===Symbol["for"]("react.memo_cache_sentinel")?(v={},b[0]=v):v=b[0];v=v;break bb0}var w;b[1]===Symbol["for"]("react.memo_cache_sentinel")?(w={"aria-atomic":!0,role:"alert"},b[1]=w):w=b[1];v=w}w=v;if(b[2]!==e||b[3]!==o||b[4]!==(a==null?void 0:(v=a.xstyleConfig)==null?void 0:v.item)){var x;v=e!=null?i.jsx(c("BaseView.react"),{xstyle:[k.item,a==null?void 0:(v=a.xstyleConfig)==null?void 0:v.item],children:e.element!=null?e.element:e.labelRenderer&&i.jsx(c("BaseInlinePressable.react"),{onPress:function(a){o(),e.onPress(a)},testid:void 0,xstyle:k.link,children:e.labelRenderer(e.label)})}):null;b[2]=e;b[3]=o;b[4]=a==null?void 0:(x=a.xstyleConfig)==null?void 0:x.item;b[5]=v}else v=b[5];x=v;if(b[6]!==f||b[7]!==(a==null?void 0:(v=a.xstyleConfig)==null?void 0:v.item)){v=f!=null&&i.jsx(c("BaseView.react"),{xstyle:[k.item,a==null?void 0:(v=a.xstyleConfig)==null?void 0:v.item],children:f});b[6]=f;b[7]=a==null?void 0:(f=a.xstyleConfig)==null?void 0:f.item;b[8]=v}else v=b[8];f=a==null?void 0:(f=a.xstyleConfig)==null?void 0:f.item;var y;b[9]!==f?(y=[k.item,k.itemText,f],b[9]=f,b[10]=y):y=b[10];b[11]!==m||b[12]!==u?(f=m({toastMessageId:u}),b[11]=m,b[12]=u,b[13]=f):f=b[13];b[14]!==w||b[15]!==y||b[16]!==f?(m=i.jsx(c("BaseView.react"),babelHelpers["extends"]({xstyle:y},w,{children:f})),b[14]=w,b[15]=y,b[16]=f,b[17]=m):m=b[17];b[18]!==x?(w=x!=null&&(d("basePushToast").passesNewToastAPIGK()?x:i.jsx(c("XPlatReactFocusRegion.react"),{autoFocusQuery:d("focusScopeQueries").tabbableScopeQuery,children:x})),b[18]=x,b[19]=w):w=b[19];if(b[20]!==g||b[21]!==(a==null?void 0:(y=a.xstyleConfig)==null?void 0:y.item)){x=Boolean(g)&&i.jsx(c("BaseView.react"),{xstyle:[k.item,a==null?void 0:(f=a.xstyleConfig)==null?void 0:f.item],children:g});b[20]=g;b[21]=a==null?void 0:(y=a.xstyleConfig)==null?void 0:y.item;b[22]=x}else x=b[22];b[23]!==w||b[24]!==x||b[25]!==v||b[26]!==m?(f=i.jsxs(i.Fragment,{children:[v,m,w,x]}),b[23]=w,b[24]=x,b[25]=v,b[26]=m,b[27]=f):f=b[27];y=f;b[28]!==l||b[29]!==y?(w=l!=null?l(y):y,b[28]=l,b[29]=y,b[30]=w):w=b[30];y=w;x=e!=null&&d("basePushToast").passesNewToastAPIGK?u:void 0;v=d("basePushToast").passesNewToastAPIGK()&&(e!=null||Boolean(g))?"dialog":void 0;m=p==="full-width"&&k.rootFullWidth;f=h==="dense"&&k.rootDense;w=a==null?void 0:(l=a.xstyleConfig)==null?void 0:l.container;b[31]!==n||b[32]!==m||b[33]!==f||b[34]!==w?(u=[k.root,m,f,n,w],b[31]=n,b[32]=m,b[33]=f,b[34]=w,b[35]=u):u=b[35];b[36]!==x||b[37]!==v||b[38]!==u||b[39]!==q||b[40]!==r||b[41]!==y||b[42]!==s||b[43]!==t?(g=i.jsx(c("BaseToastContentWrapper.react"),{ariaLabelledBy:x,ref:s,role:v,testid:void 0,themeConfig:r,useInvertedDisplayMode:t,xstyle:u,children:y}),b[36]=x,b[37]=v,b[38]=u,b[39]=q,b[40]=r,b[41]=y,b[42]=s,b[43]=t,b[44]=g):g=b[44];return g}g["default"]=a}),98);
__d("CometSuspenseFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1828945");b=d("FalcoLoggerInternal").create("comet_suspense",a);e=b;g["default"]=e}),98);
__d("CometToast.react",["fbt","ix","BaseToast.react","CometPressable.react","FDSCircleButton.react","FDSText.react","fbicon","react","react-compiler-runtime"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k=j||(j=d("react"));j.useMemo;var l={pressable:{alignItems:"x6s0dn4",display:"x78zum5",flexDirection:"x1q0g3np",width:"xh8yej3",$$css:!0}};function a(a){var b=d("react-compiler-runtime").c(35),e,f,g,j,n,o,p,q,r,s,t;b[0]!==a?(e=a.action,f=a.href,g=a.icon,j=a.impressionLoggingRef,n=a.message,o=a.onDismiss,s=a.target,p=a.testid,q=a.truncateText,r=a.withoutCloseButton,t=babelHelpers.objectWithoutPropertiesLoose(a,["action","href","icon","impressionLoggingRef","message","onDismiss","target","testid","truncateText","withoutCloseButton"]),b[0]=a,b[1]=e,b[2]=f,b[3]=g,b[4]=j,b[5]=n,b[6]=o,b[7]=p,b[8]=q,b[9]=r,b[10]=s,b[11]=t):(e=b[1],f=b[2],g=b[3],j=b[4],n=b[5],o=b[6],p=b[7],q=b[8],r=b[9],s=b[10],t=b[11]);a=p===void 0?"Toast":p;var u=q===void 0?!0:q;p=r===void 0?!1:r;b[12]!==f||b[13]!==s?(q=f!=null?{target:s,url:f}:void 0,b[12]=f,b[13]=s,b[14]=q):q=b[14];r=q;var v=r;b[15]!==e?(f=e!=null?{label:e.label,labelRenderer:m,onPress:e.onPress,testid:e.testid}:void 0,b[15]=e,b[16]=f):f=b[16];b[17]!==o||b[18]!==p?(s=p!==!0&&k.jsx(c("FDSCircleButton.react"),{icon:d("fbicon")._(i("478231"),12),label:h._(/*BTDS*/"Fermer"),onPress:o,size:24,testid:void 0}),b[17]=o,b[18]=p,b[19]=s):s=b[19];b[20]!==v||b[21]!==t?(q=t.onPress!=null||v!=null?function(a){return k.jsx(c("CometPressable.react"),babelHelpers["extends"]({},t,{expanding:!0,linkProps:v,xstyle:l.pressable,children:a}))}:void 0,b[20]=v,b[21]=t,b[22]=q):q=b[22];b[23]!==n||b[24]!==u?(r=function(a){a=a.toastMessageId;return k.jsx(c("FDSText.react"),{color:"primary",id:a,numberOfLines:u?4:void 0,type:"body3",children:n})},b[23]=n,b[24]=u,b[25]=r):r=b[25];b[26]!==g||b[27]!==j||b[28]!==o||b[29]!==f||b[30]!==s||b[31]!==q||b[32]!==r||b[33]!==a?(e=k.jsx(c("BaseToast.react"),{action:f,addOnStart:g,closeButton:s,linkWrapper:q,message:r,onDismiss:o,testid:void 0,toastRef:j}),b[26]=g,b[27]=j,b[28]=o,b[29]=f,b[30]=s,b[31]=q,b[32]=r,b[33]=a,b[34]=e):e=b[34];return e}function m(a){return k.jsx(c("FDSText.react"),{color:"blueLink",numberOfLines:1,type:"bodyLink3",children:a})}m.displayName=m.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("FbtLogging",["cr:1094907","cr:8828"],(function(a,b,c,d,e,f,g){"use strict";a=b("cr:1094907")==null?void 0:b("cr:1094907").logImpression;c=b("cr:8828")==null?void 0:b("cr:8828").logImpressionV2;g.logImpression=a;g.logImpressionV2=c}),98);
__d("IntlQtEventFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1848815");b=d("FalcoLoggerInternal").create("intl_qt_event",a);e=b;g["default"]=e}),98);
__d("MarauderLogger",["Banzai","CacheStorage","MarauderConfig"],(function(a,b,c,d,e,f){var g="client_event",h="navigation",i=18e4,j="marauder",k="marauder_last_event_time",l="marauder_last_session_id",m={},n=[],o=!1,p=null,q=null,r=null,s=0,t,u,v=!1,w=null;function a(){F().set(k,x())}b("Banzai").subscribe(b("Banzai").SHUTDOWN,a);function x(){t=t||F().get(k)||0;return t}function y(){v||(u=F().get(l),v=!0);var a=Date.now();(!u||a-i>x())&&(u=a.toString(16)+"-"+(~~(Math.random()*16777215)).toString(16),F().set(l,u));return u}function z(){return{user_agent:window.navigator.userAgent,screen_height:window.screen.availHeight,screen_width:window.screen.availWidth,density:window.screen.devicePixelRatio||null,platform:window.navigator.platform||null,locale:window.navigator.language||null}}function A(){return{locale:navigator.language}}function B(a,b,c,d,e,f,g){var h=g!=null&&g!=0?g:Date.now();t=g!=null&&g!=0?Date.now():h;g=b!=null&&b!=""?b:p;return{name:a,time:h/1e3,module:g,obj_type:d,obj_id:e,uuid:f,extra:c}}function C(a,b,c){return B("content",null,{flags:b},null,null,a,c)}function D(a){var b=window.__mrdr;if(b)for(var c in b){var d=b[c];if(d[3]!==0){delete b[c];if(c==="1")if(r!==null)c=r;else continue;a.push(C(c,1,d[1]));a.push(C(c,2,d[2]));a.push(C(c,3,d[3]))}}}function E(a,c){D(a);if(a.length===0)return;o&&a.push(B("counters",null,m));var d=b("Banzai").BASIC;c==="vital"&&(d=b("Banzai").VITAL);var e=b("MarauderConfig").gk_enabled;s===0&&e&&(a.push(B("device_status",null,A())),d={delay:5e3});c==="signal"&&(d={signal:!0});e&&Math.random()<.01&&a.push(B("device_info",null,z()));if(r!==null)for(c=0;c<a.length;c++){e=a[c];(e.uuid===null||e.uuid===void 0)&&(e.uuid=r)}e={app_ver:b("MarauderConfig").app_version,data:a,device_id:void 0,log_type:g,seq:s++,session_id:y()};c=F().get("device_id");c&&(e.device_id=c);m={};o=!1;b("Banzai").post(j,e,d)}function F(){w||(w=new(b("CacheStorage"))("localstorage",""));return w}function c(a){m[a]||(m[a]=0),m[a]++,o=!0}function G(b,a,c,d,f,g,h,i){E([B(b,a,c,d,f,g,h)],i)}function H(a,b){p!==b&&(n.push(B(h,p,{dest_module:b,source_url:q,destination_url:a})),p=b,q=a)}function d(a,b){p!==b&&(r=null,H(a,b))}function f(a,b,c){G(b?"show_module":"hide_module",a,c)}function I(a){p=a}function J(){return p}function K(a){r===null&&(r=a,a!==null&&(E(n),n=[]))}e.exports={count:c,log:G,navigateTo:d,navigateWithinSession:H,toggleModule:f,setUUID:K,setNavigationModule:I,getNavigationModule:J}}),null);
__d("PromiseResult",["Promise"],(function(a,b,c,d,e,f){"use strict";var g;a=function(){function a(){var a=this;this.promise=new(g||(g=b("Promise")))(function(b,c){a.$1=b,a.$2=c})}var c=a.prototype;c.resolve=function(a){this.$1(a)};c.reject=function(a){this.$2(a)};return a}();f["default"]=a}),66);
__d("MqttFetchClient",["MqttEnv","MqttProtocolCodec","MqttUserName","MqttUtils","Promise","PromiseResult"],(function(a,b,c,d,e,f,g){"use strict";var h,i="fetch_pull",j="fetch_pull_finish",k="fetch_",l=6e4,m="action",n="chunked",o="send",p="true",q=5,r=20,s=10,t=5e3,u=typeof window!=="undefined"?window:self;a=function(){function a(){this.$1="",this.$2=d("MqttEnv").Env.getLoggerInstance(),this.$3=0,this.$4="",this.$5=new(c("MqttUserName"))("",0,1,"",0,!0),this.$6=function(){},this.$7=function(a){},this.$8=function(){},this.$9=function(a){},this.$10=0,this.$11=0,this.$12=0,this.$13=0,this.$14="Ready",this.$15=[],this.$16=[],this.$17=null,this.$18=!1,this.$19=0}a.isSupported=function(){return typeof u.fetch==="function"};var e=a.prototype;e.run=function(a,b,c,e,f,g,h,i){this.$1=d("MqttUtils").endpointWithSessionId(a,b),this.$3=b,this.$4=c,this.$5=e,this.$6=f,this.$7=g,this.$8=h,this.$9=i,this.$20()};e.isTopicSupported=function(a){return!0};e.publish=function(a,b){return this.$21(a,b)};e.publishBinary=function(a,b){return this.$21(a,b)};e.$21=function(a,d){if(this.$14!=="ReceivingData"){this.$2.bumpCounter(k+"publish."+a+".invalidstate");return(h||(h=b("Promise"))).reject("not connected")}else{this.$2.bumpCounter(k+"publish."+a+".publish");var e=new(c("PromiseResult"))();a={topic:a,payload:d,promiseResult:e};this.$15.push(a);this.$22();return e.promise}};e.abort=function(){this.$6=function(){},this.$7=function(a){},this.$8=function(){},this.$9=function(a){}};e.$23=function(a){var b=this;a.forEach(function(a){b.$2.bumpCounter(k+"publish."+a.topic+".resolved"),a.promiseResult.resolve()});this.$12+=a.length};e.$24=function(a,b){var c=this;a.forEach(function(a){c.$2.bumpCounter(k+"publish."+a.topic+".rejected"),a.promiseResult.reject(b)})};e.$25=function(a,b,c,d){var e=a.map(function(a){return a.topic}).join(",");this.$2.debugTrace("FetchClient","Fetch publish request failed. Publishes:"+e+", retry:"+c);this.$2.bumpCounter(k+"publish_request_failed");this.$14!=="ReceivingData"||c===q?(this.$24(a,d),this.$18=!1,this.$2.bumpCounter(k+"publish_request_failed_final"),this.$22()):this.$26(a,b,c+1)};e.$27=function(a,b,c,d){if(!d.ok){this.$2.bumpCounter(k+"publish_request_failed.http."+d.status);if(d.status===409){this.$19++;if(this.$19>=s){this.$2.bumpCounter(k+"409_reset");this.$28(new Error("Too many 409 errors"));return}}this.$25(a,b,c,this.$29(d));return}this.$2.bumpCounter(k+"publish_request_success");b=a.map(function(a){return a.topic}).join(",");this.$2.debugTrace("FetchClient","Fetch publish request success. Publishes:"+b+", retry:"+c);this.$23(a);this.$18=!1;this.$22()};e.$22=function(){if(this.$14!=="ReceivingData")return;if(this.$18)return;if(this.$15.length===0&&this.$16.length===0)return;this.$18=!0;var a=this.$15.slice(0,r);this.$15=this.$15.slice(r,this.$15.length);this.$17!=null&&d("MqttEnv").Env.clearTimeout(this.$17);this.$17=null;var b=this.$16.slice(0,r);this.$16=this.$16.slice(r,this.$16.length);this.$26(a,b,0)};e.$26=function(a,b,c){var e=this,f=a.map(function(a){return a.topic}).join(",");this.$2.debugTrace("FetchClient","Fetch publish request sent. Publishes:"+f+", retry:"+c);f=d("MqttUtils").endpointWithExtraParameter(this.$1,m,o);var g=a.map(function(a){return{topic:a.topic,payload:a.payload,qos:0,messageId:d("MqttEnv").Env.random()}});g=this.$5.gen(this.$3,[],g,b);this.$2.bumpCounter(k+"publish_request");d("MqttUtils").promiseDoneWithTimeout(u.fetch(f,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",referrer:"no-referrer",body:g,keepalive:!1}),function(d){return e.$27(a,b,c,d)},function(d){return e.$25(a,b,c,d)},l)};e.$30=function(a){a=a.message;this.$2.debugTrace("FetchClient","Fetch request failed with error:"+a);this.$9(a);this.$31(!1,a);this.$2.bumpCounter(k+"error");this.$14="Error"};e.$32=function(a){var b=this;this.$2.debugTrace("FetchClient","Fetch response data received");a=d("MqttProtocolCodec").decodeByteMessages(new Uint8Array(a));a=a.messages;var c=a.filter(function(a){return a.messageType===d("MqttProtocolCodec").MESSAGE_TYPE.PINGREQ});a=a.filter(function(a){return a.messageType===d("MqttProtocolCodec").MESSAGE_TYPE.PUBLISH}).map(function(a){if(!(a instanceof d("MqttProtocolCodec").WireMessage.Publish))return{};a=a;a.qos===1&&a.messageIdentifier!=null&&(b.$16.push(a.messageIdentifier),b.$17==null&&(b.$17=d("MqttEnv").Env.setTimeout(function(){b.$22()},t)));return{topic:a.topic,payload:a.payloadMessage,qos:a.qos}});for(var e of a){var f;this.$2.bumpCounter(k+"response_"+((f=e.topic)!=null?f:"void"))}a&&a.length>0&&(this.$13+=a.length,this.$7(a));c&&c.length>0&&this.$33()};e.$33=function(){this.$2.debugTrace("FetchClient","Got server ping request"),this.$2.bumpCounter(k+"ping")};e.$28=function(a){this.$2.debugTrace("FetchClient","Fetch request ended: "+a.toString()),this.$2.bumpCounter(k+"done"),this.$34(a.message),this.$8(),this.$14="Done"};e.$35=function(a,b,c){var e=this;if(c!=null)try{this.$32(c)}catch(a){this.$28(a);this.$2.bumpCounter(k+"dataDecodeException");return}if(b){this.$28(new Error("EOF"));return}d("MqttUtils").promiseDone(a.read(),function(c){var b=c.done;c=c.value;return e.$35(a,b,c)},function(a){return e.$28(a)})};e.$36=function(a){if(!a.ok){this.$2.bumpCounter(k+"error.http."+a.status);this.$30(this.$29(a));return}a=a.body;if(!a){this.$30(new Error("Empty body"));return}a=a.getReader();this.$6();this.$2.bumpCounter(k+"success");this.$31(!0,null);this.$11=Date.now();this.$14="ReceivingData";this.$2.debugTrace("FetchClient","Fetch request success");this.$35(a,!1,null)};e.$34=function(a){this.$2.eventLogPullFinish({pullEventName:j,sessionID:this.$3,duration:Date.now()-this.$11,errorMessage:a,publishReceived:this.$13,publishSent:this.$12})};e.$31=function(a,b){this.$2.eventLogPull({pullEventName:i,sessionID:this.$3,status:a,duration:Date.now()-this.$10,hostname:this.$1,errorMessage:b})};e.$20=function(){var a=this;if(this.$14!=="Ready")return;this.$2.debugTrace("FetchClient","Sending fetch request");this.$2.bumpCounter(k+"request");this.$10=Date.now();var b=d("MqttUtils").endpointWithExtraParameter(this.$1,n,p);d("MqttUtils").promiseDoneWithTimeout(u.fetch(b,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",referrer:"no-referrer",body:this.$4,keepalive:!1}),function(b){return a.$36(b)},function(b){return a.$30(b)},l)};e.$29=function(a){return new Error("Http error, status="+a.status)};return a}();g["default"]=a}),98);
__d("MqttLongPollingClient",["MqttEnv","MqttProtocolCodec","MqttUserName","Promise","XHRRequest","getCrossOriginTransport"],(function(a,b,c,d,e,f,g){"use strict";var h,i=120*1e3,j="simple_pull",k="longpolling_";a=function(){function a(){this.$3="",this.$4=0,this.$2=d("MqttEnv").Env.getLoggerInstance(),this.$1="Ready",this.$5="",this.$6=new(c("MqttUserName"))("",0,1,"",0,!0),this.$7=function(){},this.$8=function(a){},this.$9=function(){},this.$10=function(a){},this.$11=0,this.$12=null,this.$13=new Set(["/t_ms","/messenger_sync_get_diffs","/messenger_sync_create_queue","/webrtc","/rtc_multi"])}var e=a.prototype;e.run=function(a,b,c,d,e,f,g,h){this.$3=a,this.$4=b,this.$5=c,this.$6=d,this.$7=e,this.$8=f,this.$9=g,this.$10=h,this.$14(this.$5)};e.isTopicSupported=function(a){return this.$13.has(a)};e.publish=function(a,c){return(h||(h=b("Promise"))).reject("not supported")};e.publishBinary=function(a,c){return(h||(h=b("Promise"))).reject("not supported")};e.abort=function(){this.$12!=null&&this.$12.abort("Disconnected")};e.$15=function(a,b){if(this.$1===a)return;this.$1=a;a==="Error"&&b!=null&&this.$10(b);this.$2.debugTrace("LongPollingClient","_changeStatus : "+a)};e.$16=function(a){if(this.$1!=="RequestSend")return;if(!a){this.$17("EmptyResponse",null);return}this.$7();this.$2.bumpCounter(k+"success");this.$18(!0,null);this.$15("ResponseReceived");a=d("MqttProtocolCodec").decodeByteMessages(new Uint8Array(a));a=a.messages.filter(function(a){return a instanceof d("MqttProtocolCodec").WireMessage.Publish}).map(function(a){if(a instanceof d("MqttProtocolCodec").WireMessage.Publish){a=a;return{topic:a.topic,payload:a.payloadMessage,qos:a.qos}}else return{}});this.$8(a);this.$9()};e.$17=function(a,b){b=b!=null?b.message:"null";this.$2.debugTrace("LongPollingClient Error","Poll failed with error:"+a+", errorMsg:"+b);this.$18(!1,a+":"+b);this.$2.bumpCounter(k+"error."+a);this.$15("Error",a)};e.$18=function(a,b){this.$2.eventLogPull({pullEventName:j,sessionID:this.$4,status:a,duration:Date.now()-this.$11,hostname:this.$3,errorMessage:b})};e.$14=function(a){var b=this;if(this.$1!=="Ready"||this.$12)return;this.$2.bumpCounter(k+"request");try{this.$11=Date.now(),this.$12=new(c("XHRRequest"))(this.$3).setResponseType("arraybuffer").setRawData(a).setTransportBuilder(c("getCrossOriginTransport").withCredentials).setResponseHandler(function(a){return b.$16(a)}).setNetworkFailureHandler(function(a){b.$17("Network",a)}).setErrorHandler(function(a){b.$17("Error",a)}).setAbortHandler(function(a){b.$17("Abort",null)}).setTimeoutHandler(function(){b.$17("Timeout",null)}).setTimeout(i).send(),this.$15("RequestSend")}catch(a){this.$17("Error",a)}};return a}();g["default"]=a}),98);
__d("MqttLongPollingHookCollection",[],(function(a,b,c,d,e,f){"use strict";a=function(){function a(){this.$1=new Set()}var b=a.prototype;b.addHook=function(a){this.$1.add(a)};b.removeHook=function(a){this.$1["delete"](a)};b.onPollRequestSent=function(){this.$1.forEach(function(a){a.onPollRequestSent()})};b.onPollRequestSuccess=function(){this.$1.forEach(function(a){a.onPollRequestSuccess()})};b.onPollResponse=function(a){this.$1.forEach(function(b){b.onPollResponse(a)})};b.onPollFinish=function(){this.$1.forEach(function(a){a.onPollFinish()})};b.onPollRequestFailed=function(a){this.$1.forEach(function(b){b.onPollRequestFailed(a)})};b.onPollShutdownAbort=function(){this.$1.forEach(function(a){a.onPollShutdownAbort()})};return a}();f["default"]=a}),66);
__d("exponentialBackoff",["MqttEnv"],(function(a,b,c,d,e,f,g){function a(a,b){b===void 0&&(b=null);var c=null,e=0;function f(){for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];var i=function(){a.apply(b,g)};if(c===null){var j=Math.max(0,Math.pow(2,Math.min(e,6))*(1e3+d("MqttEnv").Env.random()*100)-2e3);c=d("MqttEnv").Env.setTimeout(function(){i(),c=null},j)}e++}f.reset=function(){e=0,c!=null&&(d("MqttEnv").Env.clearTimeout(c),c=null)};f.isPending=function(){return c!=null};return f}g["default"]=a}),98);
__d("MqttLongPollingRunner",["MqttEnv","MqttFetchClient","MqttLongPollingClient","MqttLongPollingHookCollection","MqttTypes","MqttUtils","MqttWebSocketUtils","Promise","exponentialBackoff"],(function(a,b,c,d,e,f,g){"use strict";var h,i=4,j=1e3,k=3e3,l="mqtt_should_longpoll",m="last_lp",n="yes",o="no";a=function(){function a(a,b,e,f,g,h,i,j,k){var l=this;this.$23=function(){try{if(!l.$30())return;l.$5.debugTrace("LongPollingRunner","_startPollingIfNecessary called");var a=l.$31();l.$14=a;var b=l.$9(),c=l.$10();b=b.filter(function(b){return a.isTopicSupported(b)});c=c.filter(function(b){return a.isTopicSupported(b.topic)});if(b.length===0&&c.length===0){l.$5.debugTrace("LongPollingRunner","Poll skipped, nothing to do");l.$14=null;d("MqttEnv").Env.setTimeout(function(){l.$23()},1e3);return}var e=d("MqttUtils").generateSessionId();a.run(l.$6,e,l.$7.gen(e,b,c),l.$7,function(){return l.$32()},function(a){return l.$33(a)},function(){return l.$34()},function(a){return l.$35(a)});l.$19.onPollRequestSent();e=b.join(",");b=c.map(function(a){return a.topic}).join(",");l.$5.debugTrace("LongPollingRunner","Making a poll request to "+l.$6+". SubscribedTopics:"+e+". Publishes:"+b)}catch(a){a&&l.$5.logErrorWarn(a,"lp_js_error"),l.$11(new(d("MqttTypes").MqttChannelError)(!1,"js error lp",a)),l.$35("lp_js_error")}};this.$6=a;this.$7=b;this.$1=f;this.$2=0;this.$3=e;this.$4=d("MqttWebSocketUtils").hasWSSupport();this.$5=d("MqttEnv").Env.getLoggerInstance();this.$8=g;this.$9=h;this.$10=i;this.$11=j;this.$12=k;this.$13=!1;this.$14=null;this.$15="LPInactive";this.$16="NotSent";this.$17=0;this.$19=new(c("MqttLongPollingHookCollection"))();this.$18=c("exponentialBackoff")(this.$23,this);this.$20=0;this.$21=o;a=d("MqttEnv").Env.genGk(d("MqttEnv").MqttGkNames.mqtt_lp_use_fetch);b=c("MqttFetchClient").isSupported();a?this.$5.bumpCounter("fetch_gk_pass"):this.$5.bumpCounter("fetch_gk_fail");b?this.$5.bumpCounter("fetch_api_supported"):this.$5.bumpCounter("fetch_api_not_supported");this.$22=a&&b}var e=a.prototype;e.addHook=function(a){this.$19.addHook(a)};e.start=function(){var a=this;this.$21=d("MqttEnv").Env.configRead(m,o);this.$5.debugTrace("LongPollingRunner","Runner loaded, last status "+this.$21);this.$20=Date.now();this.$23();d("MqttEnv").Env.setTimeout(function(){a.$23()},j+100);d("MqttEnv").Env.setTimeout(function(){a.$23()},k+100)};e.shutdown=function(){this.$5.debugTrace("LongPollingRunner","Shutdown called"),this.$14&&this.$14.abort(),this.$19.onPollShutdownAbort(),this.$14=null};e.canPublish=function(){return this.$15==="LPActive"&&this.$16==="ReceivingData"};e.publish=function(a,b,c){return this.$24(a,b)};e.publishBinary=function(a,b,c){return this.$24(a,b)};e.$24=function(a,c){if(d("MqttEnv").Env.genGk(d("MqttEnv").MqttGkNames.mqtt_enable_publish_over_polling)&&(this.$14&&this.$14.isTopicSupported(a)))if(typeof c==="string")return this.$14.publish(a,c);else return this.$14.publishBinary(a,c);return(h||(h=b("Promise"))).reject()};e.onConnectAttempt=function(){};e.onConnectFailure=function(){this.$2++,this.$23()};e.onConnected=function(){};e.onConnectSuccess=function(){this.$1=!0,d("MqttEnv").Env.configWrite(m,null)};e.onConnectionLost=function(){};e.onConnectionDisconnect=function(){};e.onSubscribe=function(a){};e.onUnsubscribe=function(a){};e.onPublish=function(a){};e.onMessage=function(a){};e.onWSFatal=function(){this.$3=!0,this.$23()};e.getStatus=function(){return this.$15};e.getRequestStatus=function(){return this.$16};e.$25=function(a){a!==this.$15&&(this.$5.debugTrace("LongPollingRunner","status changed to "+a+" from "+this.$15),this.$15=a,this.$12(this.$15,this.$16))};e.$26=function(a){if(!this.$22)return;a!==this.$16&&(this.$5.debugTrace("LongPollingRunner","request status changed to "+a+" from "+this.$16),this.$16=a,this.$12(this.$15,this.$16))};e.$27=function(){this.$17=0};e.$28=function(){this.$17++,this.$17>=i&&this.$25("LPError")};e.$29=function(){var a,b=(a=d("MqttEnv")).Env.genGk(a.MqttGkNames.mqtt_lp_no_delay),c=a.Env.genGk(a.MqttGkNames.mqtt_ws_polling_enabled);a=a.Env.genGk(a.MqttGkNames.mqtt_fast_lp);this.$5.debugTrace("LongPollingRunner","_shouldPoll? pollNow:"+String(b)+" enabled:"+String(c)+" fastPoll:"+String(a)+" hasWSSupport:"+String(this.$4)+" hasWsSuccessBefore:"+String(this.$1)+" failureCount:"+this.$2+" wsFatal:"+String(this.$3));if(!c)return!1;if(b){this.$5.bumpCounter(l+".nd");return!0}if(!this.$4){this.$5.bumpCounter(l+".na");return!0}if(this.$3){this.$5.bumpCounter(l+".fatal");return!0}if(this.$1)return!1;if(a){c=Date.now()-this.$20;if(this.$21===n){if(this.$2>=1)return!0;if(c>j){this.$5.bumpCounter(l+".fastdelay");return!0}}else if(c>k){this.$5.bumpCounter(l+".regulardelay");return!0}}if(this.$2>=3){this.$5.bumpCounter(l+".failure");return!0}return!1};e.$30=function(){if(this.$14!=null)return!1;var a=this.$29();!this.$13&&a&&(this.$5.bumpCounter("polling_kickin"),this.$13=!0,this.$25("LPActive"),this.$27());this.$13&&!a&&(this.$5.bumpCounter("polling_stopped"),this.$13=!1,this.$25("LPInactive"),this.$27());return a};e.$31=function(){if(this.$22){this.$5.debugTrace("LongPollingRunner","Creating polling client using Fetch API");return new(c("MqttFetchClient"))()}else{this.$5.debugTrace("LongPollingRunner","Creating regular Polling client");return new(c("MqttLongPollingClient"))()}};e.$32=function(){this.$5.debugTrace("LongPollingRunner","Poll success"),this.$19.onPollRequestSuccess(),this.$18.reset(),this.$25("LPActive"),this.$27(),d("MqttEnv").Env.configWrite(m,n),this.$26("ReceivingData")};e.$33=function(a){var b=a.map(function(a){return a.topic}).join(",");this.$5.debugTrace("LongPollingRunner","Poll response received, message received:"+b);for(b of a)this.$19.onPollResponse(b.topic),this.$8(b.topic,b.payload,b.qos)};e.$34=function(){this.$5.debugTrace("LongPollingRunner","Poll finish"),this.$19.onPollFinish(),this.$14&&this.$14.abort(),this.$14=null,this.$23(),this.$26("NotSent")};e.$35=function(a){this.$19.onPollRequestFailed(a),this.$14&&this.$14.abort(),this.$14=null,this.$18(),this.$28(),this.$26("NotSent")};return a}();g["default"]=a}),98);