if (self.CavalryLogger) { CavalryLogger.start_js(["3mj+U"]); } __d("MessagingTag",[],(function(a,b,c,d,e,f){e.exports={GROUPS:"groups",UNREAD:"unread",FLAGGED:"flagged",ACTION_ARCHIVED:"action:archived",INBOX:"inbox",MARKETPLACE_FOLDER:"marketplace_folder",OTHER:"other",PENDING:"pending",MONTAGE:"montage",PAGES:"pages",PAGE_BACKGROUND:"page_background",ACTION_COPIED_MESSAGE:"action:copy_message",ACTION_COPIED_SELF_MESSAGE:"copy_self_message",ACTION_COPIED_ATTACHMENT:"action:copy_attachment",ACTION_COPIED_SELF_ATTACHMENT:"copy_self_attachment",EVENT:"event",SENT:"sent",SPAM:"spam",UPDATES:"broadcasts_inbox",BCC:"header:bcc",FILTERED_CONTENT:"filtered_content",FILTERED_CONTENT_BH:"filtered_content_bh",FILTERED_CONTENT_ACCOUNT:"filtered_content_account",FILTERED_CONTENT_QUASAR:"filtered_content_quasar",FILTERED_CONTENT_INVALID_APP:"filtered_content_invalid_app",ONE_WAY_MESSAGE:"one_way_message",UNAVAILABLE_ATTACHMENT:"unavailable_attachment",ARCHIVED:"archived",EMAIL:"email",VOICEMAIL:"voicemail",SPAM_SPOOFING:"spam:spoofing",SPOOF_WARNING:"MTA:spoof_warning",SMS_TAG_ROOT:"SMSShortcode:",APP_ID_ROOT:"app_id:",DOMAIN_AUTH_PASS:"MTA:dmarc:pass",DOMAIN_AUTH_FAIL:"MTA:dmarc:fail",MTA_SYSTEM_MESSAGE:"MTA:system_message",EMAIL_MESSAGE:"source:email",ONE_CLICK_MESSAGE:"page_one_click_message",MARKETPLACE:"marketplace",ROOM:"room",PAGE_FOLLOWUP:"page_followup",MESSAGE_REQUEST_AGGREGATION_UNIT:"message_request_aggregation_unit",IRIS_MAPPING:{FOLDER_INVALID:null,FOLDER_INBOX:"inbox",FOLDER_OTHER:"other",FOLDER_SPAM:"spam",FOLDER_PENDING:"pending",FOLDER_MONTAGE:"montage",FOLDER_HIDDEN:"hidden",FOLDER_DISABLED:"disabled",FOLDER_PAGE_BACKGROUND:"page_background",FOLDER_PAGE_DONE:"page_done",FOLDER_BLOCKED:"blocked"}}}),null); __d("CallbackManagerController",["ErrorGuard"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(a){this.$1=[],this.$2=[void 0],this.$3=a}var c=a.prototype;c.executeOrEnqueue=function(a,b,c){c=c||{};var d=this.$4(b,a,c);if(d)return 0;this.$2.push({fn:b,request:a,options:c});d=this.$2.length-1;this.$1.push(d);return d};c.unsubscribe=function(a){delete this.$2[a]};c.reset=function(){this.$2=[]};c.getRequest=function(a){return this.$2[a]};c.runPossibleCallbacks=function(a){__p&&__p();var b=this,c=this.$1;this.$1=[];var d=[];c.forEach(function(c){var e=b.$2[c];if(!e)return;e=b.$3(e.request,babelHelpers["extends"]({},e.options,a));e?d.push({args:e,id:c}):b.$1.push(c)});d.forEach(function(a){var c=a.args;a=a.id;var d=b.$2[a];if(!d)return;delete b.$2[a];b.$5(d.fn,c,d.request)})};c.$4=function(a,b,c){c=this.$3(b,c);c&&this.$5(a,c,b);return!!c};c.$5=function(a,c,d){d={ids:d};b("ErrorGuard").applyWithGuard(a,d,c)};return a}();e.exports=a}),null); __d("KeyedCallbackManager",["CallbackManagerController","ErrorGuard"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(){this.$1={},this.$2=new(b("CallbackManagerController"))(this.$3.bind(this))}var c=a.prototype;c.executeOrEnqueue=function(a,c){__p&&__p();if(!(a instanceof Array)){var d=a,e=c;a=[a];c=function(a){e(a[d])}}a=a.filter(function(a){var c=a!==null&&a!==void 0;c||b("ErrorGuard").applyWithGuard(function(){throw new Error("KeyedCallbackManager.executeOrEnqueue: key "+JSON.stringify(a)+" is invalid")},null,[]);return c});return this.$2.executeOrEnqueue(a,c)};c.unsubscribe=function(a){this.$2.unsubscribe(a)};c.reset=function(){this.$2.reset(),this.$1={}};c.getUnavailableResources=function(a){var b=this;a=this.$2.getRequest(a);var c=[];a&&(c=a.request.filter(function(a){return!b.$1[a]}));return c};c.getUnavailableResourcesFromRequest=function(a){a=Array.isArray(a)?a:[a];return a.filter(function(a){if(a!==null&&a!==void 0)return!this.$1[a]},this)};c.addResourcesAndExecute=function(a){Object.assign(this.$1,a),this.$2.runPossibleCallbacks()};c.setResource=function(a,b){this.$1[a]=b,this.$2.runPossibleCallbacks()};c.getResource=function(a){return this.$1[a]};c.getAllResources=function(){return this.$1};c.dumpResources=function(){var a={};for(var b in this.$1){var c=this.$1[b];typeof c==="object"&&(c=babelHelpers["extends"]({},c));a[b]=c}return a};c.$3=function(a){var b={};for(var c=0;c0){var c={};for(var d=0;d0){a=s.shift();B(a.request,a.data)}}function G(a,c){if(b("PresenceUtil")!=null){var d=a.getData();d.window_id=b("PresenceUtil").getSessionID();a.setData(d)}a.setHandler(D.bind(this,c)).setErrorHandler(E.bind(this,c)).setTransportErrorHandler(E.bind(this,c)).setFinallyHandler(F.bind(this)).setAllowCrossPageTransition(!0);return a}function H(a,c,d){return G(new(b("AsyncRequest"))(a).setData(c),d)}function a(a,c){__p&&__p();var d=c.obj;if(d.viewer_id!=b("CurrentUser").getID()){u().error("invalid_viewer_for_channel_message",{type:a,data:c});throw new Error("Viewer got from the channel is not the real viewer")}if(d.window_id===b("PresenceUtil").getSessionID())return;var e=d.data;if(d.event=="access_control_entry")e.target_ids.forEach(function(a){x(a,e.setting),o[a]=e.setting});else{if(d.event=="visibility_update"){a=e.visibility?v.ONLINE:v.OFFLINE;z(a);p=a}else d.event=="online_policy_update"&&(A(e.online_policy),r=e.online_policy);v.inform("privacy-user-presence-response")}u().log("channel_message_received",{data:c.obj})}v.inform("privacy-changed");v.inform("privacy-user-presence-changed","state");u().log("initialized",{visibility:n,policy:q});b("Arbiter").subscribe(b("JSLogger").DUMP_EVENT,function(a,c){c.presence_privacy={initial:b("PresencePrivacyInitialData").privacyData,current:m}});b("Arbiter").subscribe(b("ChannelConstants").getArbiterType("privacy_changed"),a.bind(this));b("Arbiter").subscribe(b("ChannelConstants").ON_CONFIG,function(a,b){a=b.getConfig("visibility",null);if(a!==null&&typeof a!=="undefined"){b=a?v.ONLINE:v.OFFLINE;z(b);u().log("config_visibility",{vis:b})}}.bind(this));e.exports=v}),null); __d("ChatVisibility",["Arbiter","JSLogger","PresencePrivacy"],(function(a,b,c,d,e,f){var g={isOnline:function(){return b("PresencePrivacy").getVisibility()===b("PresencePrivacy").ONLINE},hasBlackbirdEnabled:function(){return this.isVisibleToMostFriends()||this.isVisibleToSomeFriends()},isVisibleToMostFriends:function(){return b("PresencePrivacy").getOnlinePolicy()===b("PresencePrivacy").ONLINE_TO_BLACKLIST&&b("PresencePrivacy").getBlacklist().length>0},isVisibleToSomeFriends:function(){return b("PresencePrivacy").getOnlinePolicy()===b("PresencePrivacy").ONLINE_TO_WHITELIST&&b("PresencePrivacy").getWhitelist().length>0},goOnline:function(a){b("PresencePrivacy").getVisibility()===b("PresencePrivacy").OFFLINE&&(b("JSLogger").create("blackbird").log("chat_go_online"),b("PresencePrivacy").setVisibility(b("PresencePrivacy").ONLINE),b("Arbiter").inform("chat-visibility/go-online")),a&&a()},goOffline:function(a){b("PresencePrivacy").getVisibility()===b("PresencePrivacy").ONLINE&&(b("JSLogger").create("blackbird").log("chat_go_offline"),b("PresencePrivacy").setVisibility(b("PresencePrivacy").OFFLINE),b("Arbiter").inform("chat-visibility/go-offline")),a&&a()},toggleVisibility:function(){g.isOnline()?g.goOffline():g.goOnline()}};e.exports=g}),null); __d("FBIDCheck",[],(function(a,b,c,d,e,f){"use strict";var g=/^[1-9]\d*$/;a={isUser_deprecated:function(a){if(!a||typeof a==="string"&&!g.test(a))return!1;a=parseInt(a,10);return!a?!1:a>0&&a<22e8||a>=1e14&&a<=100099999989999||a>=89e12&&a<=89999999999999||a>=6000001e7&&a<=60000019999999}};e.exports=a}),null); __d("PresenceConfig",["PresenceConfigInitialData"],(function(a,b,c,d,e,f){var g=Object.assign({},b("PresenceConfigInitialData"));a={get:function(a,b){return a in g?g[a]:b}};e.exports=a}),null); __d("PresenceStatus",["ArbiterMixin","AvailableListConstants","AvailableListInitialData","BanzaiODS","Bootloader","ChatVisibility","CurrentUser","FBIDCheck","FBLogger","LastActiveTimes","PresenceConfig","PresencePrivacy","ServerTime","createObjectFrom","debounceAcrossTransitions","gkx"],(function(a,b,c,d,e,f){__p&&__p();b("BanzaiODS").setEntitySample("presence",1e-4);var g={},h={},i={},j={},k=Object.assign({},b("ArbiterMixin")),l=b("debounceAcrossTransitions")(function(){return k.inform("change")},0);function m(a){var c,d=parseInt(a.topic.match(/\d+$/),10);a=parseInt(JSON.parse(a.payload).lat,10);var e=Date.now()-a*1e3;e=b("PresenceConfig").get("active_cutoff")*1e3-e;b("LastActiveTimes").update((c={},c[d]=a,c));k.checkPresence(d);k.get(d)===b("AvailableListConstants").ACTIVE&&(window.clearTimeout(j[d].timeout),j[d].timeout=window.setTimeout(function(){k.checkPresence(d)},e))}function n(a){return/^\d+$/.test(a)}Object.assign(k,{resetPresenceData:function(){g={},h={}},reset:function(){k.resetPresenceData(),i={}},get:function(a){!n(a)&&b("PresenceConfig").get("presence_throw_for_malformed_id")&&b("FBLogger")("presence").warn("received malformed id '%s'",a);if(a==b("CurrentUser").getID())return b("ChatVisibility").isOnline()?b("AvailableListConstants").ACTIVE:b("AvailableListConstants").OFFLINE;n(a)&&!b("FBIDCheck").isUser_deprecated(a)&&!j[a]&&(b("BanzaiODS").bumpEntityKey(2966,"presence","page_subscribe"),j[a]={},b("PresenceConfig").get("presence_page_green_dot_sub")&&b("Bootloader").loadModules(["SkywalkerManager"],function(b){return b.subscribe("presence_push/fb/"+a,m)},"PresenceStatus"));var c=b("AvailableListConstants").OFFLINE;a in g&&(c=g[a]);b("PresencePrivacy").allows(a)||(c=b("AvailableListConstants").OFFLINE);return c},getCapabilities:function(a){a=h[a];return a?a:0},isPlayingCanvasGameUser:function(a){return!!i[a]},getGroup:function(a){return a.some(function(a){return a==b("CurrentUser").getID()?!1:k.get(a)===b("AvailableListConstants").ACTIVE})?b("AvailableListConstants").ACTIVE:b("AvailableListConstants").OFFLINE},set:function(a,c,d,e,f,i){__p&&__p();if(a==b("CurrentUser").getID())return!1;var j;if(c!==null&&c!==void 0){c=c==b("AvailableListConstants").ACTIVE?b("AvailableListConstants").ACTIVE:b("AvailableListConstants").OFFLINE;d=k.get(a);j=d!=c;if((j||c==b("AvailableListConstants").ACTIVE)&&b("FBIDCheck").isUser_deprecated(a)){b("LastActiveTimes").update((e={},e[a]=b("ServerTime").get()/1e3,e))}g[a]=c}d=!1;f!==void 0&&f!==null&&(d=k.getCapabilities(a)!=f,h[a]=f);e=j||d;e&&!i&&l();return e},setPlayingCanvasGameFriends:function(a){if(!b("gkx")("678262"))return;i=b("createObjectFrom")(a)},getOnlineIDs:function(){var a,c=[];for(a in g)k.get(a)===b("AvailableListConstants").ACTIVE&&c.push(a);return c},getAllIDs:function(){return Object.keys(g)},getOnlineCount:function(){return k.getOnlineIDs().length},getPresenceStats:function(){__p&&__p();var a=0,c=0,d=0;for(var e in g){a+=1;switch(k.get(e)){case b("AvailableListConstants").OFFLINE:c+=1;break;case b("AvailableListConstants").ACTIVE:d+=1;break;default:break}}return{total:a,offline:c,active:d}},getAllDebugInfo:function(){var a={};for(var b in g)a[b]={p:g[b],vc:h[b]};return a},setMultiFromMQTT:function(a){var c={};Array.isArray(a)&&a.forEach(function(a){a.l&&(c[a.u]=a.l),k.set(a.u,a.p,!1,"mqtt",a.c,!0)});b("LastActiveTimes").update(c);l()},setMultiChatproxy:function(a){var c={};for(var d in a){a[d].lat&&(c[d]=a[d].lat);var e=a[d].p;k.set(d,e,!1,"chatproxy",a[d].vc,!0)}b("LastActiveTimes").update(c);l()},setMultiActive:function(a,c){var d=!1;a.forEach(function(a){k.set(a,b("AvailableListConstants").ACTIVE,!1,c,null,!0)&&(d=!0)});d&&l()},checkPresence:function(a){var c=!1,d=Math.ceil(Date.now()/1e3)-b("LastActiveTimes").get(a);k.set(a,d0&&k.setMultiActive(b("AvailableListInitialData").activeList,"available_list_active");b("AvailableListInitialData").playingNow&&b("AvailableListInitialData").playingNow.length>0&&k.setPlayingCanvasGameFriends(b("AvailableListInitialData").playingNow);b("AvailableListInitialData").lastActiveTimes&&Object.keys(b("AvailableListInitialData").lastActiveTimes).length>0&&b("LastActiveTimes").update(b("AvailableListInitialData").lastActiveTimes);e.exports=k}),null); __d("ChatproxyPresence",["Arbiter","AvailableListConstants","AvailableListInitialData","BanzaiODS","ChannelConstants","ChatReliabilityEvents","ChatReliabilityInstrumentation","LastActiveTimes","PresenceStatus","debounceAcrossTransitions","gkx"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(a){this.$1=a,this.$2=!1,this.$3=b("AvailableListInitialData").chatNotif,this.$4=!1}var c=a.prototype;c.subscribe=function(){__p&&__p();var a=this;b("Arbiter").subscribe(b("ChannelConstants").getArbiterType("chatproxy-presence"),this.updatePresenceInfo.bind(this));b("Arbiter").subscribe(b("ChannelConstants").ON_INVALID_HISTORY,function(){b("ChatReliabilityInstrumentation").logCHATPROXY_EVENT(b("ChatReliabilityEvents").ON_INVALID_HISTORY),a.$2=!0});b("Arbiter").subscribe(b("ChannelConstants").RTI_SESSION,function(c,d){b("ChatReliabilityInstrumentation").logCHATPROXY_EVENT(b("ChatReliabilityEvents").RTI_SESSION),d&&(a.$4=d)});b("Arbiter").subscribe(b("ChannelConstants").getArbiterType("get_debug_presence"),function(c,d){__p&&__p();b("ChatReliabilityInstrumentation").logCHATPROXY_EVENT(b("ChatReliabilityEvents").GET_DEBUG_PRESENCE);c=b("PresenceStatus").getAllDebugInfo();d=b("LastActiveTimes").getDebugData();for(var e in d){var f=c[e];f===void 0&&(f={},c[e]=f);f.l=Math.floor(d[e])}a.$4.issueRequest("/debug_presence",{},c,function(){b("BanzaiODS").bumpEntityKey(2966,"ChatproxyPresence","debug_presence.sucess")})})};c.getRTISession=function(){return this.$4};c.updatePresenceInfo=function(a,c){__p&&__p();this.$2&&(this.$2=!1,b("PresenceStatus").resetPresenceData());c=c.obj;if(!b("gkx")("845715")){a=c.buddyList;b("PresenceStatus").setMultiChatproxy(a)}a=!1;c.chatNotif!==void 0&&(a=this.$3!==c.chatNotif);a&&(this.$3=c.chatNotif);c.gamers&&b("PresenceStatus").setPlayingCanvasGameFriends(c.gamers);a&&this.$1(b("AvailableListConstants").ON_CHAT_NOTIFICATION_CHANGED,this.$3);b("debounceAcrossTransitions")(function(){this.$1(b("AvailableListConstants").ON_AVAILABILITY_CHANGED)}.bind(this),0)()};c.getWebChatNotification=function(){return this.$3};return a}();e.exports=a}),null); __d("ChatDispatcher",["ExplicitRegistrationDispatcher"],(function(a,b,c,d,e,f){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(b("ExplicitRegistrationDispatcher"));e.exports=new a({strict:!1})}),null); __d("PresenceStatusActionTypes",["keyMirror"],(function(a,b,c,d,e,f){"use strict";e.exports=b("keyMirror")({AVAILABILITY_CHANGED:null})}),null); __d("TypingStates",[],(function(a,b,c,d,e,f){a=Object.freeze({INACTIVE:0,TYPING:1,QUITTING:2});e.exports=a}),null); __d("AvailableList",["Arbiter","ArbiterMixin","AsyncRequest","AvailableListConstants","BanzaiODS","Bootloader","ChannelConstants","ChatConfig","ChatDispatcher","ChatproxyPresence","ChatReliabilityInstrumentation","ChatVisibility","CurrentUser","FBIDCheck","FBLogger","JSLogger","LastActiveTimes","PresencePrivacy","PresenceStatus","PresenceStatusActionTypes","Run","ServerTime","TypingStates","debounceAcrossTransitions","emptyFunction","gkx","requireWeak"],(function(a,b,c,d,e,f){"use strict";__p&&__p();b("BanzaiODS").setEntitySample("presence",1e-4);var g=babelHelpers["extends"]({},b("AvailableListConstants"),b("ArbiterMixin")),h=/\D/;g.subscribe([b("AvailableListConstants").ON_AVAILABILITY_CHANGED,b("AvailableListConstants").ON_UPDATE_ERROR],function(a,c){b("Arbiter").inform(a,c)});b("PresenceStatus").subscribe("change",b("debounceAcrossTransitions")(function(){g.inform(b("AvailableListConstants").ON_AVAILABILITY_CHANGED)},0));var i=b("debounceAcrossTransitions")(function(){g.inform(b("AvailableListConstants").ON_AVAILABILITY_CHANGED),b("ChatDispatcher").dispatch({type:b("PresenceStatusActionTypes").AVAILABILITY_CHANGED})},0);function j(a,c,d,e,f){if(a===b("CurrentUser").getID())return;c=b("PresenceStatus").set(a,c,d,e,f);if(c){d=b("debounceAcrossTransitions")(function(){g.inform(b("AvailableListConstants").ON_AVAILABILITY_CHANGED,a),b("ChatDispatcher").dispatch({type:b("PresenceStatusActionTypes").AVAILABILITY_CHANGED,id:a})},0);d()}}function k(a){a=a.payload.availability||{};for(var b in a)j(b&&b.toString(),a[b].a,!0,"mercury_tabs",a[b].c)}function l(a){if(!a||a==="0"||h.test(a)){b("ChatReliabilityInstrumentation").logERROR("bad id for available list: "+a);return}new(b("AsyncRequest"))("/ajax/mercury/tabs_presence.php").setData({target_id:a}).setHandler(k).setErrorHandler(b("emptyFunction")).setAllowCrossPageTransition(!0).send()}function a(a,c){c.chat_config=b("ChatConfig").getDebugInfo(),c.available_list_debug_info={count:b("PresenceStatus").getOnlineIDs().length}}var m=void 0;try{m=new(b("ChatproxyPresence"))(function(a){g.inform(a)}),m.subscribe()}catch(a){b("FBLogger")("chat").catching(a).mustfix("Failed to subscribe to chat proxy presence"),b("ChatReliabilityInstrumentation").logERROR(a.getMessage())}Object.assign(g,{getChatproxyPresenceObject:function(){return m},get:function(a){return b("PresenceStatus").get(a)},updateForID:function(a){if(b("ChatConfig").get("presence_page_green_dot_sub")&&!b("FBIDCheck").isUser_deprecated(a))return;l(a);b("PresencePrivacy").getVisibility()==b("PresencePrivacy").ONLINE&&b("Run").onAfterLoad(function(){b("gkx")("845715")?b("Bootloader").loadModules(["MessengerMQTTPresence"],function(b){b.sendAdditionalBuddyRequest(a)},"AvailableList"):b("Bootloader").loadModules(["ChannelManager","ChannelTransport"],function(b,c){b.startChannelManager(),c.sendAdditionalBuddyRequest(b.getCompleteConfig(),a)},"AvailableList")})},getWebChatNotification:function(){return m&&m.getWebChatNotification()},isReady:function(){return!!m},set:function(a,b,c,d){j(a,b,!0,c,d)}});b("Arbiter").subscribe(b("JSLogger").DUMP_EVENT,a);b("PresencePrivacy").subscribe(["privacy-changed","privacy-availability-changed","privacy-user-presence-response"],i);b("requireWeak")("ChannelConnection",function(a){return a.subscribe([a.CONNECTED,a.RECONNECTING,a.SHUTDOWN,a.MUTE_WARNING,a.UNMUTE_WARNING],i)});function c(a,c){__p&&__p();if(b("gkx")("845715"))return;a={};var d=[];c=c.obj.overlay;for(var e in c){g.set(e,c[e].a,c[e].s||"channel",c[e].vc);c[e].la&&(a[e]=c[e].la);var f=c[e].c&b("ChannelConstants").CAPABILITY_PLAYING_INSTANT_GAME;f!==0&&d.push(e)}b("LastActiveTimes").update(a)}b("Arbiter").subscribe(b("ChannelConstants").getArbiterType("buddylist_overlay"),c);b("Arbiter").subscribe(b("ChannelConstants").getArbiterType("buddylist_overlay_buffered"),c);b("Bootloader").loadModules(["MercurySyncEventsProxy"],function(a){__p&&__p();b("Arbiter").subscribe([a.getArbiterTypeForFBID(b("CurrentUser").getID(),a.Events.TYP)],function(a,c){__p&&__p();a=c.obj;if(a.st===b("TypingStates").TYPING){c=a.from;if(b("ChatVisibility").isOnline()){b("BanzaiODS").bumpEntityKey(2966,"presence","stale_presence_check_typing");a=b("PresenceStatus").get(c);if(a!=b("AvailableListConstants").ACTIVE){a=b("LastActiveTimes").get(c)*1e3;var d=b("ServerTime").get();if(!a)b("BanzaiODS").bumpEntityKey(2966,"presence","no_detailed_presence_typing");else if(d-a>5*60*1e3){var e="stale_presence_typing";d=d-a;d<10*60*1e3?e+="600":d<60*60*1e3&&(e+="3600");b("BanzaiODS").bumpEntityKey(2966,"presence",e)}}}g.set(c&&c.toString(),b("AvailableListConstants").ACTIVE,"channel-typing")}})},"AvailableList");b("Arbiter").subscribe(b("ChannelConstants").getArbiterType("messaging"),function(a,c){__p&&__p();if(!b("ChatVisibility").isOnline())return;a=c.obj;if(a.message&&a.message.timestamp&&a.message.sender_fbid){c=b("ServerTime").get();var d=a.message.timestamp;if(c-d<2*60*1e3){b("BanzaiODS").bumpEntityKey(2966,"presence","stale_presence_check");c=a.message.sender_fbid;a=b("PresenceStatus").get(c);if(a==b("AvailableListConstants").ACTIVE)return;a=b("LastActiveTimes").get(c)*1e3;if(!a)b("BanzaiODS").bumpEntityKey(2966,"presence","no_detailed_presence");else if(d-a>5*60*1e3){c="stale_presence";d=d-a;d<10*60*1e3?c+="600":d<60*60*1e3&&(c+="3600");b("BanzaiODS").bumpEntityKey(2966,"presence",c)}}}});e.exports=g}),null); __d("ChatHovercard",["Arbiter","AsyncLoader","Bootloader","JSLogger","TimeSlice","debounce","emptyFunction","setTimeoutAcrossTransitions"],(function(a,b,c,d,e,f){__p&&__p();var g=5,h=new(b("AsyncLoader"))("/ajax/chat/hovercard/sidebar.php","hover"),i=b("JSLogger").create("chat_hovercard");b("Arbiter").subscribe("Hovercard/dirty",h.reset.bind(h));function j(a,c){var d=function(){h.get(a,c)};b("TimeSlice").guard(d,"superfluous request to first open DD",{propagationType:b("TimeSlice").PropagationType.ORPHAN})()}function k(a,c){__p&&__p();if(!a)return;j(a,function(d){__p&&__p();b("setTimeoutAcrossTransitions")(function(){__p&&__p();if(!d){i.error("fetch_failure",{id:a});return}b("Bootloader").loadModules(["Hovercard"],function(b){b=b.getDialog(d);if(!b){i.error("no_hovercard",{id:a,endpoint:d});return}a==c.getActiveID()&&c.showHovercard(a,b)},"ChatHovercard")},0)})}function l(a,b){__p&&__p();var c=[];function d(b){b>=0&&b-1){d(b);for(var e=1;e=g){this.$13();return this.$2}this.$7++;this.$14();this.$6=new(b("AsyncRequest"))(i).setHandler(function(b){a.$6=null,a.$5=!0,a.$15(),a.$1(b.payload),a.$3()}).setErrorHandler(function(){a.$6=null,a.$8++,a.$16()}).setTimeoutHandler(h,function(){a.$6=null,a.$9++,a.$17(),a.fetchAll()}).setAllowCrossPageTransition(!0);this.$6.send();return this.$2};c.isBootstrapped=function(){return this.$5};c.isBootstrapping=function(){return!!this.$6};c.getAttemptCount=function(){return this.$7};c.getErrorCount=function(){return this.$8};c.getTimeoutCount=function(){return this.$9};c.$12=function(){this.$10||(j.log("bootstrap_start"),b("BanzaiODS").bumpEntityKey(2966,"chat.web","typeahead.bootstrap.starts"),this.$10=!0)};c.$14=function(){j.log("bootstrap_attempt"),b("BanzaiODS").bumpEntityKey(2966,"chat.web","typeahead.bootstrap.attempts")};c.$15=function(){j.log("bootstrap_success"),b("BanzaiODS").bumpEntityKey(2966,"chat.web","typeahead.bootstrap.successes"),this.$7>1&&b("BanzaiODS").bumpEntityKey(2966,"chat.web","typeahead.bootstrap.successes_after_retries")};c.$16=function(){j.log("bootstrap_error"),b("BanzaiODS").bumpEntityKey(2966,"chat.web","typeahead.bootstrap.errors")};c.$17=function(){j.log("bootstrap_timeout"),b("BanzaiODS").bumpEntityKey(2966,"chat.web","typeahead.bootstrap.timeouts")};c.$13=function(){this.$11||(j.log("bootstrap_giveup"),b("BanzaiODS").bumpEntityKey(2966,"chat.web","typeahead.bootstrap.giveups"),this.$11=!0,this.$4())};return a}();e.exports=a}),null); __d("XChatUserInfoAsyncController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/chat/user_info/",{ids:{type:"IntVector",defaultValue:[]}})}),null); __d("ShortProfiles",["AjaxLoader","Arbiter","CurrentUser","JSLogger","ShortProfilesBootstrapper","URI","XChatUserInfoAsyncController","emptyFunction"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=null,h=new(b("AjaxLoader"))(b("XChatUserInfoAsyncController").getURIBuilder().getURI().toString(),"profiles"),i={get:function(a,b){this.getMulti([a],function(c){return b(c[a],a)})},getMulti:function(a,c){h.get(a,c||b("emptyFunction"))},getNow:function(a){return h.getNow(a)||null},getMultiNow:function(a){var b={};a.forEach(function(a){return b[a]=i.getNow(a)});return b},getCachedProfileIDs:function(){return h.getCachedKeys()},hasAll:function(){return!!g&&g.isBootstrapped()},fetchAll:function(){g||(g=new(b("ShortProfilesBootstrapper"))(function(a){h.set(a)}));return g.fetchAll()},set:function(a,b){var c={};c[a]=b;this.setMulti(c)},setMulti:function(a){__p&&__p();if(b("CurrentUser").isWorkUser()){var c={};Object.keys(a).forEach(function(d){var e=a[d];(e.type!=="fb4c"||!e.uri)&&(c[d]=e);var f=new(b("URI"))(e.uri).setDomain("").setProtocol("").toString();c[d]=babelHelpers["extends"]({},e,{uri:f})});a=c}h.set(a)}};b("Arbiter").subscribe(b("JSLogger").DUMP_EVENT,function(a,c){a=i.getCachedProfileIDs();var d=b("JSLogger").getEntries(function(a){return a.cat=="short_profiles"||a.cat=="chat_typeahead"});c.chat_typeahead={bootstrapped:g&&g.isBootstrapped(),bootstrapping:g&&g.isBootstrapping(),bootstrap_attempts:g&&g.getAttemptCount(),bootstrap_errors:g&&g.getErrorCount(),bootstrap_timeouts:g&&g.getTimeoutCount(),entries:a,entry_count:a.length,history:d}});e.exports=i}),null); __d("TokenizeUtil",["nullthrows"],(function(a,b,c,d,e,f){__p&&__p();var g=/[ ]+/g,h=/[^ ]+/g,i=new RegExp("[^ "+l()+"]+|"+a(),"g"),j=new RegExp(a(),"g"),k=1e3;function l(){return".,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;\u30fb\u3001\u3002\u3008-\u3011\u3014-\u301f\uff1a-\uff1f\uff01-\uff0f\uff3b-\uff40\uff5b-\uff65\u2e2e\u061f\u066a-\u066c\u061b\u060c\u060d\ufd3e\ufd3f\u1801\u0964\u104a\u104b\u2010-\u2027\u2030-\u205e\xa1-\xb1\xb4-\xb8\xba\xbb\xbf"}function a(){return"["+l()+"]"}var m={},n={a:"\u0430 \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \u0101",b:"\u0431",c:"\u0446 \xe7 \u010d",d:"\u0434 \xf0 \u010f \u0111",e:"\u044d \u0435 \xe8 \xe9 \xea \xeb \u011b \u0113",f:"\u0444",g:"\u0433 \u011f \u0123",h:"\u0445 \u0127",i:"\u0438 \xec \xed \xee \xef \u0131 \u012b",j:"\u0439",k:"\u043a \u0138 \u0137",l:"\u043b \u013e \u013a \u0140 \u0142 \u013c",m:"\u043c",n:"\u043d \xf1 \u0148 \u0149 \u014b \u0146",o:"\u043e \xf8 \xf6 \xf5 \xf4 \xf3 \xf2",p:"\u043f",r:"\u0440 \u0159 \u0155",s:"\u0441 \u015f \u0161 \u017f",t:"\u0442 \u0165 \u0167 \xfe",u:"\u0443 \u044e \xfc \xfb \xfa \xf9 \u016f \u016b",v:"\u0432",y:"\u044b \xff \xfd",z:"\u0437 \u017e",ae:"\xe6",oe:"\u0153",ts:"\u0446",ch:"\u0447",ij:"\u0133",sh:"\u0448",ss:"\xdf",ya:"\u044f"};for(var o in n){var p=n[o].split(" ");for(var q=0;q=k&&(c={},d=0);var g=r(e),h=a(g);c[e]={value:e,flatValue:g,tokens:s(h,b),isPrefixQuery:!!h&&h[h.length-1]!=" "};d++}f!=null&&f!==!1&&c[e].sortedTokens===void 0&&(c[e].sortedTokens=c[e].tokens.slice(),c[e].sortedTokens.sort(function(a,b){return b.length-a.length}));return c[e]}}var t=d(c),u=d(function(a){return a},i);function f(a,c,d){__p&&__p();var e=a=="query"||a=="query_punc",f=a=="aligned",g=a=="query_punc"?u:t;c=g(c,a=="prefix");var h=a=="prefix"?b("nullthrows")(c.sortedTokens):c.tokens,i=g(d).tokens,j={},k=c.isPrefixQuery&&(e||f)?h.length-1:null;g=function(b,c){for(var d=0;d=c)return;if(b("PresencePrivacy").getFriendVisibility(e)==b("PresencePrivacy").BLACKLISTED)return;a==b("PresenceStatus").get(e)&&d.push(e)});return d}a=function(){"use strict";__p&&__p();function a(){this.$1=null}var c=a.prototype;c.getSorted=function(a,c){var d=this;if(this.$1){c(h(this.$1,a));return}b("ChatSidebarPreloadStore").onLoaded(function(b){b=b.buddies;d.$1=g(b);c(h(d.$1,a))})};c.getAvailableSorted=function(a){var c=b("PresenceStatus").getOnlineIDs();a&&(c=c.filter(function(b){return a&&a.indexOf(b)===-1}));return c.sort(b("ChatSortUsers").sortAlphabetical)};c.getAllSorted=function(a){var c=[],d=this.$1||[];b("PresenceStatus").getAllIDs().concat(d.map(function(a){return a[0]})).forEach(function(a){return c.indexOf(a)===-1&&c.push(a)});a&&(c=c.filter(function(b){return a&&a.indexOf(b)===-1}));return c.sort(b("ChatSortUsers").sortAlphabetical)};return a}();e.exports=new a()}),null); __d("PresenceStatusStore",["ChatDispatcher","FluxStore","PresenceStatus","PresenceStatusActionTypes"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){return a.call(this,b("ChatDispatcher"))||this}var d=c.prototype;d.__onDispatch=function(a){a=a.type;switch(a){case b("PresenceStatusActionTypes").AVAILABILITY_CHANGED:this.__emitChange();break;default:break}};d.get=function(a){return b("PresenceStatus").get(a)};d.getIsPlaying=function(a){return b("PresenceStatus").isPlayingCanvasGameUser(a)};return c}(b("FluxStore"));a.__moduleID=e.id;e.exports=new a()}),null); __d("ShortProfilesActionTypes",["keyMirror"],(function(a,b,c,d,e,f){"use strict";e.exports=b("keyMirror")({PROFILE_UPDATED:null})}),null); __d("ChatProfileStore",["ChatSidebarPreloadStore"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g={};a={init:function(){b("ChatSidebarPreloadStore").onLoaded(function(a){var b=a.profiles,c=a.nearby;return b.filter(function(a){return!c||c.indexOf(a.id)===-1}).forEach(function(a){var b=new Date();b=a.birthdate&&b.getDate()===a.birthdate.day&&b.getMonth()+1===a.birthdate.month;var c=a.profile_picture&&a.profile_picture.uri?a.profile_picture.uri:null;g[a.id]={id:a.id,is_birthday:b,thumbSrc:c,name:a.name,is_messenger_only:!!a.is_messenger_only}})})},get:function(a){return g[a]}};e.exports=a}),null); __d("ShortProfilesStore",["ChatDispatcher","ChatProfileStore","FluxStore","ShortProfiles","ShortProfilesActionTypes"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){return a.call(this,b("ChatDispatcher"))||this}var d=c.prototype;d.__onDispatch=function(a){a=a.type;switch(a){case b("ShortProfilesActionTypes").PROFILE_UPDATED:this.__emitChange();break;default:break}};d.getNow=function(a){var c=b("ChatProfileStore").get(a);c||(c=b("ShortProfiles").getNow(a));return c};d.getMulti=function(a){b("ShortProfiles").getMulti(a,this.$ShortProfilesStore1)};d.$ShortProfilesStore1=function(a){b("ChatDispatcher").dispatch({type:b("ShortProfilesActionTypes").PROFILE_UPDATED})};return c}(b("FluxStore"));a.__moduleID=e.id;e.exports=new a()}),null); __d("ChatSidebarStore",["AvailableListConstants","ChatConfig","ChatDispatcher","ChatOptions","ChatOptionsInitialData","ChatSidebarActionTypes","ChatUnreadCountActionTypes","CurrentUser","FluxStore","InitialChatFriendsList","PresenceOrderedList","PresencePrivacy","PresenceStatus","PresenceStatusActionTypes","PresenceStatusStore","ShortProfiles","ShortProfilesActionTypes","ShortProfilesStore","gkx","performanceAbsoluteNow"],(function(a,b,c,d,e,f){"use strict";__p&&__p();function g(a){return a.map(function(a){var b=a.slice(0,-2);a=Number(a.slice(-1));return[b,a]})}function h(a,c,d){d===void 0&&(d=[]);return a.reduce(function(a,e){var f=e[0];e=e[1];a.length0&&(l-=m+1);b("ChatConfig").get("nearby_friends_www_chatbar")&&d.length>0&&(l-=d.length+1);b("ChatConfig").get("show_admined_pages")&&e.length>0&&(l-=e.length+1);m=j&&h?h:{pages:[]};b("ChatConfig").get("show_businesses")&&m.pages.length>0&&(l-=2);l=Math.min(a,Math.max(l,b("ChatConfig").get("min_top_friends")||0));j=i(d);return{isUserOffline:b("PresencePrivacy").isUserOffline(),groups:c,numTopFriends:l,nearby:j,marketplaceThreads:f,maxThreadSlots:k,adminedPages:e,pageListModule:g,pymmList:m}};d.getGroupsToShow=function(a){if(b("ChatOptions").getSetting("hide_groups"))return[];return a.length>1?a.sort(function(a,c){return b("PresenceStatus").getGroup(c.mercury_thread.participants)-b("PresenceStatus").getGroup(a.mercury_thread.participants)}).slice(0,b("ChatConfig").getNumber("num_groups_to_show")):a};d.getOrderedPresenceUserList=function(a){if(this.$ChatSidebarStore1&&Array.isArray(this.$ChatSidebarStore1))return h(this.$ChatSidebarStore1,a);this.$ChatSidebarStore1=g(b("InitialChatFriendsList").list)||[];return h(this.$ChatSidebarStore1,a)};d.getStatusMap=function(a,c){var d={},e={};a.forEach(function(a){if(c){var f=b("PresenceStatusStore").getIsPlaying(a);d[a]=f}f=b("PresenceStatusStore").get(a);f===b("AvailableListConstants").ACTIVE&&(e[a]=f)});return{statusMap:e,playingMap:d}};return c}(b("FluxStore"));a.__moduleID=e.id;e.exports=new a()}),null); __d("ChatUnreadCountStore",["ChatDispatcher","ChatUnreadCountActionTypes","FluxStore","ifRequired"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){return a.call(this,b("ChatDispatcher"))||this}var d=c.prototype;d.__onDispatch=function(a){a=a.type;switch(a){case b("ChatUnreadCountActionTypes").COUNT_UPDATED:this.__emitChange();break;default:break}};d.get=function(a){return b("ifRequired")("ChatUnreadCount",function(b){return b.get().getUnreadCountForUID(a)||0},function(){return 0})};return c}(b("FluxStore"));a.__moduleID=e.id;e.exports=new a()}),null); __d("ChatSidebarUserDetailsFactory",["AvailableListConstants","ChatUnreadCountStore","LastActiveTimes","PresencePrivacy","PresenceStatusStore","ShortProfilesStore","gkx"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g={getUsersDetailedData:function(a,c){var d={},e=[];a.forEach(function(a){if(!Object.prototype.hasOwnProperty.call(d,a)){var b=g._getDetailsForUserId(a,c);d[a]=b;b||e.push(a)}});e.length>0&&b("ShortProfilesStore").getMulti(e);return d},_getDetailsForUserId:function(a,c){var d=b("ShortProfilesStore").getNow(a);if(d){var e=b("PresenceStatusStore").get(a);return{shortProfile:d,presencePrivacyAllows:b("PresencePrivacy").allows(a),lastActiveTime:b("LastActiveTimes").getShortDisplay(a),unreadCount:b("gkx")("780925")?0:b("ChatUnreadCountStore").get(a),isPlaying:c?b("PresenceStatusStore").getIsPlaying(a):!1,status:e===b("AvailableListConstants").ACTIVE?e:null}}return null}};e.exports=g}),null); __d("MessengerDivebarSizingTypedLogger",["Banzai","GeneratedLoggerUtils","nullthrows"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(){__p&&__p();function a(){this.$1={}}var c=a.prototype;c.log=function(){b("GeneratedLoggerUtils").log("logger:MessengerDivebarSizingLoggerConfig",this.$1,b("Banzai").BASIC)};c.logVital=function(){b("GeneratedLoggerUtils").log("logger:MessengerDivebarSizingLoggerConfig",this.$1,b("Banzai").VITAL)};c.logImmediately=function(){b("GeneratedLoggerUtils").log("logger:MessengerDivebarSizingLoggerConfig",this.$1,{signal:!0})};c.clear=function(){this.$1={};return this};c.getData=function(){return babelHelpers["extends"]({},this.$1)};c.updateData=function(a){this.$1=babelHelpers["extends"]({},this.$1,a);return this};c.setMaxItemSlots=function(a){this.$1.max_item_slots=a;return this};c.setNumAdminedPages=function(a){this.$1.num_admined_pages=a;return this};c.setNumGroups=function(a){this.$1.num_groups=a;return this};c.setNumNearby=function(a){this.$1.num_nearby=a;return this};c.setNumPymm=function(a){this.$1.num_pymm=a;return this};c.setNumRecents=function(a){this.$1.num_recents=a;return this};c.setNumTopFriends=function(a){this.$1.num_top_friends=a;return this};c.setNumTopFriendsShown=function(a){this.$1.num_top_friends_shown=a;return this};c.setSidebarType=function(a){this.$1.sidebar_type=a;return this};c.setTime=function(a){this.$1.time=a;return this};c.setWeight=function(a){this.$1.weight=a;return this};c.updateExtraData=function(a){a=b("nullthrows")(b("GeneratedLoggerUtils").serializeMap(a));b("GeneratedLoggerUtils").checkExtraDataFieldNames(a,g);this.$1=babelHelpers["extends"]({},this.$1,a);return this};c.addToExtraData=function(a,b){var c={};c[a]=b;return this.updateExtraData(c)};return a}();var g={max_item_slots:!0,num_admined_pages:!0,num_groups:!0,num_nearby:!0,num_pymm:!0,num_recents:!0,num_top_friends:!0,num_top_friends_shown:!0,sidebar_type:!0,time:!0,weight:!0};e.exports=a}),null); __d("WorkChatSidebarUtils",["Bootloader","CurrentUser","gkx"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a={loadPinnedThreads:function(a){__p&&__p();var c=this;b("Bootloader").loadModules(["MercuryServerRequests","MercuryThreadInformer","MessengerState.bs","SubscriptionsHandler"],function(d,e,f,g){__p&&__p();c._serverRequests=d.get();d=e.get();c._subscriptions=new g();c._subscriptions.addSubscriptions(d.subscribe("threadlist-updated",function(c,d){var e=f.getPinnedThreadlist(b("CurrentUser").getID());f.getMultiThreadMeta(b("CurrentUser").getID(),e,function(b){var c=e.map(function(a){if(Array.isArray(a))return a.map(function(a){return b[a]});else return b[a]});a(c)})}));c._serverRequests.fetchPinnedThreadlistInfo()},"WorkChatSidebarUtils")},computeGroups:function(a,c){if(b("gkx")("678258")){var d=c.map(function(a){return a.thread_fbid});return a.filter(function(a){return!d.includes(a.uid)})}else return a},computeTopUsers:function(a,c){if(b("gkx")("678258")){var d=c.map(function(a){return a.thread_fbid});return a.filter(function(a){return!d.includes(a)})}else return a}};e.exports=a}),null); __d("onAfterDisplay",["NavigationMetrics","TimeSlice","requestIdleCallback"],(function(a,b,c,d,e,f){"use strict";var g=[],h=!1;function a(a){a=b("TimeSlice").guard(a,"onAfterDisplay invocation",{propagationType:b("TimeSlice").PropagationType.ORPHAN});h?b("requestIdleCallback")(a):g.push(a)}b("NavigationMetrics").addRetroactiveListener(b("NavigationMetrics").Events.EVENT_OCCURRED,function(a,c){["all_pagelets_displayed","e2e"].indexOf(c.event)>-1&&!h&&(h=!0,g.forEach(function(a){b("requestIdleCallback")(a)}))});e.exports=a}),null); __d("ChatOrderedList",["csx","Arbiter","ArbiterMixin","AvailableList","AvailableListConstants","Bootloader","ChatConfig","ChatHovercard","ChatOptions","ChatOrderedListHover","ChatSidebarConstants","ChatSidebarPreloadStore","ChatSidebarStore","ChatSidebarUserDetailsFactory","CSS","CurrentUser","DataStore","DOM","Event","MessengerDivebarSizingTypedLogger","Parent","PresenceOrderedList","PresencePrivacy","React","ReactDOM","ShortProfilesStore","WorkChatSidebarUtils","debounceAcrossTransitions","emptyFunction","gkx","mixin","onAfterDisplay","qex"],(function(a,b,c,d,e,f,g){__p&&__p();a=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(c,d,e,f,g){__p&&__p();var h;h=a.call(this)||this;h._debouncedRender=b("emptyFunction");h._render=function(){__p&&__p();if(!h._isVisible||h._isHovering){h._isHovering&&(h._skippedRenderDuringHover=!0);return}b("PresenceOrderedList").getSorted(h._numTopFriends,function(a){__p&&__p();var c=b("CurrentUser").isWorkUser()?b("PresenceOrderedList").getAllSorted(a.concat(h._nearby)).filter(function(a){a=b("ShortProfilesStore").getNow(a);return!a||a.type==="fb4c"}):b("PresenceOrderedList").getAvailableSorted(a.concat(h._nearby)),d=b("CurrentUser").isWorkUser()?b("PresenceOrderedList").getAllSorted(a.concat(h._nearby)).filter(function(a){a=b("ShortProfilesStore").getNow(a);return a&&a.type!=="fb4c"}):[];a=a.filter(function(a){return!h._nearby||h._nearby.indexOf(a)===-1});var e=b("PresencePrivacy").getVisibility()==b("PresencePrivacy").ONLINE?h._nearby.filter(function(a){return b("PresencePrivacy").allows(a)}):h._nearby,f=b("PresencePrivacy").getVisibility()==b("PresencePrivacy").ONLINE?a.filter(function(a){return b("PresencePrivacy").allows(a)}):a;a=b("PresencePrivacy").getOnlinePolicy()===b("PresencePrivacy").ONLINE_TO_WHITELIST&&b("PresencePrivacy").getVisibility()?a.filter(function(a){return!b("PresencePrivacy").allows(a)}):[];var g=b("ChatSidebarStore").isAfterDomLoad(),i=h._chatSidebarRecentCallsStore?h._chatSidebarRecentCallsStore.getState():{},j=h._chatSidebarRecentCallsStore?h._chatSidebarRecentCallsStore.getParticipants():[];j=b("ChatSidebarUserDetailsFactory").getUsersDetailedData([].concat(c,e,a,f,j,d),g);g=h._orderedListComponent;b("ReactDOM").render(b("React").createElement(g,{adminedPages:h._adminedPages,availableUsers:c,groups:b("WorkChatSidebarUtils").computeGroups(h._groups,h._pinnedThreads),isAfterDomLoad:b("ChatSidebarStore").isAfterDomLoad(),isSidebar:h._isSidebar,isUserOffline:b("PresencePrivacy").isUserOffline(),marketplaceThreads:h._marketplaceThreads,maxItemSlots:h._maxItemSlots+1,nearby:e,offlineUsers:a,pageListModule:h._pageListModule,pinnedThreads:h._pinnedThreads,pymmList:h._pymmList,recentCalls:i,scrollContainer:h._scrollContainer,topUsers:b("WorkChatSidebarUtils").computeTopUsers(f,h._pinnedThreads),usersDetailedData:j,workOthers:d}),h._orderedList);h.inform("render")})};h._debouncedRender=b("debounceAcrossTransitions")(h._render,300);h._typeAheadActive=!1;h._root=d;h._isVisible=!1;h._excludedIds={};h._numTopFriends=5;h._adminedPages=[];h._marketplaceThreads=[];h._pageListModule=null;h._pymmList={config:null,pages:[]};h._pinnedThreads=[];h._groups=[];h._nearby=[];h._hoverController=null;h._isHovering=!1;h._skippedRenderDuringHover=!1;h._isSidebar=c;h._maxItemSlots=0;h._orderedListComponent=g;h._chatSidebarRecentCallsStore=null;h._orderedList=b("DOM").find(h._root,".fbChatOrderedList");b("Event").listen(h._orderedList,"mouseover",function(){h.isSidebar&&(h._isHovering=!0)});b("Event").listen(h._orderedList,"mouseout",function(){h._isHovering=!1,h._skippedRenderDuringHover&&(h._skippedRenderDuringHover=!1,h._debouncedRender())});h._scrollableOrderedList=b("Parent").byClass(h._root,"scrollableOrderedList");h._scrollableArea=b("Parent").byClass(h._root,"scrollable");c&&new(b("ChatHovercard"))(babelHelpers.assertThisInitialized(h));b("Arbiter").subscribe("jslogger/dump",function(a,c){h.getSortedList(function(a){c.chat_lists=c.chat_lists||{sorted_list:a,available_list:b("PresenceOrderedList").getAvailableSorted(),excluded_list:h._excludedIds}})});b("Arbiter").subscribe("sidebar/typeahead/active",function(a,b){h._typeAheadActive=b,h._render()});b("ShortProfilesStore").addListener(function(){return h._debouncedRender()});b("ChatSidebarStore").addListener(function(){return h._debouncedRender()});e=b("qex")._("698066");e&&b("Bootloader").loadModules(["ChatSidebarRecentCallsStore"],function(a){h._chatSidebarRecentCallsStore=a,a.addListener(function(){return h._debouncedRender()})},"ChatOrderedList");b("gkx")("678257")?b("onAfterDisplay")(function(){b("PresencePrivacy").subscribe("privacy-user-presence-changed",function(){return h._debouncedRender()}),b("AvailableList").subscribe(b("AvailableListConstants").ON_AVAILABILITY_CHANGED,function(){return h._debouncedRender()})}):(b("PresencePrivacy").subscribe("privacy-user-presence-changed",function(){return h._debouncedRender()}),b("AvailableList").subscribe(b("AvailableListConstants").ON_AVAILABILITY_CHANGED,function(){return h._debouncedRender()}));b("gkx")("678258")&&b("WorkChatSidebarUtils").loadPinnedThreads(function(a){h._pinnedThreads=a,h._render()});return h}var d=c.prototype;d.getShowingUsers=function(){return b("DOM").scry(this._root,"li._42fz,li._5a58").map(this.getUserForNode)};d.getUserForNode=function(a){return b("DataStore").get(a,"id")||b("DataStore").get(a,"serverthreadid")};d.getHoverController=function(){this._hoverController||(this._hoverController=new(b("ChatOrderedListHover"))(this));return this._hoverController};d.getItemHeight=function(){return b("ChatSidebarConstants").getItemHeight()};d.getRoot=function(){return this._root};d.getSortedList=function(a){b("PresenceOrderedList").getSorted(this._numTopFriends,function(b){return a(b)})};d.hide=function(){if(!this._isVisible)return;this._isVisible=!1;b("CSS").hide(this._scrollableOrderedList||this._root);this.inform("hide")};d.setNumTopFriends=function(a,c,d){__p&&__p();var e=this;b("ChatSidebarPreloadStore").onLoaded(function(f){__p&&__p();var g=f.groups,h=f.nearby,i=f.adminedPages,j=f.marketplaceThreads,k=f.pageListModule;f=f.pymmList;var l=new(b("MessengerDivebarSizingTypedLogger"))();l.setMaxItemSlots(a).setSidebarType(d);a--;b("ChatConfig").get("show_header")&&a--;var m=b("gkx")("678259"),n=!b("ChatOptions").getSetting("hide_businesses")&&f.pages&&d!=="buddylist";m&&n&&(a-=3);i=b("ChatOptions").getSetting("hide_admined_pages")?[]:i;m&&i.length&&d!=="buddylist"&&(a-=i.length+1);m=(j==null?void 0:j.length)&&!b("ChatOptions").getSetting("hide_marketplace");m&&b("qex")._("690094")&&d!=="buddylist"&&(e._marketplaceThreads=j,a-=j.length);e._maxItemSlots=a;m=a;j=b("ChatSidebarStore").getGroupsToShow(g||[])||[];g=n?f:{config:null,pages:[]};n=j.length;n===0&&b("gkx")("678261")&&!b("ChatOptions").getSetting("hide_groups")&&n++;n>0&&(m-=n+1);b("ChatConfig").get("nearby_friends_www_chatbar")&&h.length>0&&(m-=h.length+1);b("ChatConfig").get("show_admined_pages")&&i.length>0&&d!=="buddylist"&&(m-=i.length+1);b("ChatConfig").get("show_businesses")&&g.pages.length>0&&d!=="buddylist"&&(m-=2);f=m;m=Math.min(a,Math.max(m,b("ChatConfig").get("min_top_friends")||0));if(m!==e._numTopFriends||j.length!==e._groups.length||h.length!==e._nearby.length||i.length!==e._adminedPages.length||g.pages.length!==e._pymmList.pages.length){e._groups=j;e._numTopFriends=m;e._nearby=h;e._adminedPages=i;e._pageListModule=k;e._pymmList=g;l.setNumTopFriends(m).setNumNearby(h.length).setNumGroups(j.length).setNumAdminedPages(i.length).setNumPymm(g.pages.length);n=0;d==="buddylist"&&i.length>0&&(n+=i.length+1,l.setNumAdminedPages(0));d==="buddylist"&&g.pages.length>0&&(l.setNumPymm(0),n+=2);f+=n;m>f&&(f+=1);l.setNumTopFriendsShown(Math.max(f,0));b("ChatSidebarStore").getVisibleType()===d&&l.log();c?(typeof e._debouncedRender.reset==="function"&&e._debouncedRender.reset(),e._render()):e._debouncedRender()}})};d.show=function(){if(this._isVisible)return;this._isVisible=!0;b("CSS").show(this._scrollableOrderedList||this._root);this._render();this.inform("show")};d.isVisible=function(){return this._isVisible};d.setScrollContainer=function(a){b("DOM").contains(a,this._root)&&(this._scrollContainer=a)};return c}(b("mixin")(b("ArbiterMixin")));e.exports=a}),null); __d("ChatQuietLinks",["DataStore","DOM","Event","Parent","UserAgent_DEPRECATED","getOrCreateDOMID"],(function(a,b,c,d,e,f){__p&&__p();var g={};a={silenceLinks:function(a){h(a,this.removeEmptyHrefs.bind(this))},nukeLinks:function(a){h(a,this.removeAllHrefs.bind(this))},removeEmptyHrefs:function(a){i(a,function(a){return!a||a==="#"})},removeAllHrefs:function(a){i(a)}};function h(a,c){__p&&__p();if(!a)return;var d=!!b("UserAgent_DEPRECATED").chrome(),e=!!b("UserAgent_DEPRECATED").chrome()||b("UserAgent_DEPRECATED").ie()>=9||b("UserAgent_DEPRECATED").firefox()>=4;if(g[b("getOrCreateDOMID")(a)])return;g[b("getOrCreateDOMID")(a)]=!0;if(!e)return;if(!d){c&&c(a);return}b("Event").listen(a,"mouseover",function(a){a=b("Parent").byTag(a.getTarget(),"a");if(a){var c=a.getAttribute("href");j(c)&&(b("DataStore").set(a,"stashedHref",a.getAttribute("href")),a.removeAttribute("href"))}});b("Event").listen(a,"mouseout",function(a){a=b("Parent").byTag(a.getTarget(),"a");var c=a&&b("DataStore").remove(a,"stashedHref");j(c)&&a.setAttribute("href",c)});b("Event").listen(a,"mousedown",function(a){if(!a.isDefaultRequested())return!0;a=b("Parent").byTag(a.getTarget(),"a");var c=a&&b("DataStore").get(a,"stashedHref");j(c)&&a.setAttribute("href",c)})}function i(a,c){a=b("DOM").scry(a,"a");c&&(a=a.filter(function(a){return c(a.getAttribute("href"))}));a.forEach(function(a){a.removeAttribute("href"),a.tabIndex||a.setAttribute("tabindex",0)})}function j(a){return a&&a!=="#"}e.exports=a}),null); __d("ChatSidebarParticipantTooltipBuilder",["fbt","React"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();var h=10,i="\n";function a(a,b){var c=[],d=Math.min(h,a.length);a=a.slice(0,d);a.forEach(function(a){a=a.name;a&&c.push(a)});db.length?(c=a,d=b):(c=b,d=a);else if(b===a)return b+"u"+a;else{var e=0;while(eb[e]?(c=a,d=b):(c=b,d=a);break}}return d+"u"+c},getThreadIDFromParticipantID:function(a){a=this.getUserIDFromParticipantID(a);return a?this.getThreadIDFromUserID(a):null},getParticipantIDFromFromThreadID:function(a){a=this.getUserIDFromThreadID(a);return a?this.getParticipantIDFromUserID(a):null},getSupportInboxItemIDFromThreadID:function(a){return this.tokenize(a).value},isCanonical:function(a){return this.isValid(a)&&this.tokenize(a).type==="user"},isGroupChat:function(a){return this.isValid(a)&&this.tokenize(a).type!=="user"},isLocalThread:function(a){return this.isValid(a)&&this.tokenize(a).type==="root"}};e.exports=g}),null); __d("OrderedFriendsList",["AvailableListConstants","ChatProfileStore","ChatSidebarParticipantTooltipBuilder","ChatSidebarPreloadStore","CurrentUser","MercuryIDs","PresenceStatus","SearchableEntry","ShortProfiles","createArrayFromMixed","isValidUniqueID"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=null,h={},i=[],j={};function k(a){a=String(a);return b("MercuryIDs").isValid(a)?a:b("MercuryIDs").getParticipantIDFromUserID(a)}function l(a,c){a=b("createArrayFromMixed")(a);c(a.filter(function(a){a=b("ShortProfiles").getNow(a);return!a||o(a)||a.is_nonfriend_messenger_contact}))}function m(a){g=[];var c=0;a.forEach(function(a){var d=a.slice(0,-2);a=a.slice(-1);b("PresenceStatus").get(d)==a&&(g[c]=d,h[d]=c++)})}function n(a){var c=0;a.forEach(function(a){var d=a.slice(0,-2);a=a.slice(-1);a==b("AvailableListConstants").ACTIVE&&(i[c]=d,j[d]=c++)})}function o(a){return a.type==="friend"||b("CurrentUser").isWorkUser()&&a.type==="fb4c"}var p={contains:function(a){return a in h},getList:function(a){if(g&&g.length){l(g,a);return}b("ChatSidebarPreloadStore").onLoaded(function(b){b=b.buddies;m(b);l(g,a)})},getSearchableEntries:function(a,c,d){__p&&__p();p.getList(function(e){__p&&__p();b("ChatSidebarPreloadStore").onLoaded(function(f){__p&&__p();var g=f.groups,h=f.recentPageList;b("ShortProfiles").getMulti(e.slice(0,a),function(a){var b=[];for(var e in a)b.push(p.normalizeProfileEntry(a[e],e));a=c?g.map(p.normalizeThreadEntry):[];var f=h.map(p.normalizePageEntry);d(b.concat(a,f).filter(function(a){return!!a}).sort(function(a,b){return a.getOrder()-b.getOrder()}))})})})},normalizePageEntry:function(a,c){var d=a.searchTokens||[],e=a.name,f=null;return new(b("SearchableEntry"))({uniqueID:a.id||c,keywordString:d.join(" "),order:c,photo:a.imgSrc,title:e,subtitle:f,type:"page",uri:a.uri,auxiliaryData:{isVerified:a.isVerified}})},normalizeProfileEntry:function(a,c){var d=a.searchTokens||[],e=a.name,f=null;return new(b("SearchableEntry"))({uniqueID:a.id||c,keywordString:d.join(" "),order:p.getRank(a.id||c),photo:a.thumbSrc,title:e,subtitle:f,type:a.type,uri:a.uri,auxiliaryData:{isMessengerUser:a.is_messenger_user}})},normalizeThreadEntry:function(a,c){__p&&__p();var d=a.mercury_thread,e=a.participants_to_render.map(function(a){return babelHelpers["extends"]({},a,{id:k(a.id)})});d.participants=d.participants.map(k);var f=a.text,g=null;f||(f=d.name);var h=b("ChatSidebarParticipantTooltipBuilder").buildParticipantsTooltip(e,d.participants.length-1),i=e.map(function(a){return a.name}).join(", ");!f?f=i:g=i;i=a.uid;return!f||!b("isValidUniqueID")(i)?null:new(b("SearchableEntry"))({uniqueID:i,order:c,photo:d.image_src,title:f,subtitle:g,type:"thread",auxiliaryData:{participantsToRender:e,tooltipContent:h,thread:d}})},getRank:function(a){return a in h?h[a]:g?g.length:0},getActiveList:function(a){if(i.length>0){a(i);return}p.getList(function(b){return a(b)})},getActiveRank:function(a){return a in j?j[a]:p.getRank(a)}};(function(){b("ChatSidebarPreloadStore").onLoaded(function(a){var c=a.buddies;a=a.shortProfiles;b("ShortProfiles").setMulti(a);n(c);m(c)}),b("ChatProfileStore").init()})();e.exports=p}),null); __d("LoadOnRender.react",["React","createCancelableFunction"],(function(a,b,c,d,e,f){__p&&__p();a=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(c){__p&&__p();var d;d=a.call(this,c)||this;d.$1=!1;d.$2=null;d.$3=!0;d.$4=function(a){d.$2=a,d.$1&&d.forceUpdate()};d.state={cancelableOnComponentLoad:b("createCancelableFunction")(d.$4)};c.loader(d.state.cancelableOnComponentLoad);return d}var d=c.prototype;d.componentDidMount=function(){this.$1=!0,this.$3&&this.$2!=null&&this.forceUpdate()};d.componentWillUnmount=function(){this.$1=!1,this.state.cancelableOnComponentLoad.cancel()};d.render=function(){var a=this.$2;this.$3=a==null;return!a||this.props.forcePlaceholder?this.props.placeholder:b("React").cloneElement(this.props.component,{LazyLoadedComponent:a})};return c}(b("React").Component);a.defaultProps={forcePlaceholder:!1};e.exports=a}),null); __d("BootloadOnRender.react",["JSResource","LoadOnRender.react","React"],(function(a,b,c,d,e,f){__p&&__p();a=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){var c,d;for(var e=arguments.length,f=new Array(e),g=0;g0&&(l=a[0])}l&&(l.focus(),c.prevent())},getLastSearchQuery:function(){return m},deferRenderChatSidebarSheet:function(a){b("onAfterDisplay")(function(){b("Bootloader").loadModules(["ChatSidebarSheet.react"],function(c){var d=b("ge")("chatsidebarsheet");b("ReactDOM").render(b("React").createElement(c,{className:"fbChatSidebarMessage",viewer:b("CurrentUser").getID(),isSideBar:a}),d)},"ChatTypeaheadCore")})},init:function(a,c,d){var e=this;b("gkx")("678264")&&this.deferRenderChatSidebarSheet(d);b("ReactDOM").render(b("React").createElement("div",null,b("React").createElement("div",{id:"chatsidebarsheet"}),b("React").createElement(k,{loader:b("JSResource")("ChatTypeaheadWrapper.react").__setRef("ChatTypeaheadCore"),placeholder:b("React").createElement("div",null,j&&b("React").createElement(j,null),b("React").createElement("div",{className:"_1nq2"},b("React").createElement("div",{className:"_5iwm _5iwn _62it"},b("React").createElement("label",{className:"_58ak _3rhb"},b("React").createElement("input",{className:"_58al",type:"text",onChange:function(a){return e._handleInteraction("search",a.target.value)},onFocus:function(a){return e._handleInteraction("search",a.target.value)},onCompositionStart:this._handleCompositionStart,onCompositionEnd:this._handleCompositionEnd,placeholder:i._("Search")})))),d?b("React").createElement("div",{className:"_531b"},b("React").createElement("div",{className:"_5qth _6a _6e"},b("React").createElement("a",{href:"#",className:"button _5vmb",onClick:function(){return e._handleInteraction("settings")}})),b("React").createElement("a",{href:"#",className:"_3a-4 _5q85",onClick:function(){return e._handleInteraction("compose")}}),b("React").createElement("div",{className:"_46fv"},b("React").createElement("a",{href:"#",className:"_1-4-",onClick:function(){return e._handleInteraction("groupcreate")}}))):null),takeOverRender:this.takeOverRender,component:b("React").createElement(b("LazyComponent.react"),{id:c,isSidebar:d})})),a)}};e.exports=a}),null); __d("SRXUIBadge.react",["cx","invariant","React","joinClasses"],(function(a,b,c,d,e,f,g,h){__p&&__p();a=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var d=c.prototype;d.isInt=function(a){return parseInt(a,10)===a};d.render=function(){var a=this.props.count,c=this.props.maxcount;c==null&&(c=20);this.isInt(a)||h(0,186);this.isInt(c)||h(0,187);var d="_5ugh _5ugf _51lp"+(a>c?" _51lr":"")+(a===0?" hidden_elem":"");return b("React").createElement("span",{className:b("joinClasses")(this.props.className,d)},a>c?c:a)};return c}(b("React").Component);e.exports=a}),null); __d("BootloaderGamesPresenceIconContainer.react",["BootloadOnRender.react","JSResource","LazyComponent.react","React"],(function(a,b,c,d,e,f){"use strict";function a(a){return b("React").createElement(b("BootloadOnRender.react"),{component:b("React").createElement(b("LazyComponent.react"),{userID:a.userID}),loader:b("JSResource")("GamesPresenceIconContainer.react").__setRef("BootloaderGamesPresenceIconContainer.react"),placeholder:b("React").createElement("div",null)})}e.exports=a}),null); __d("ChatPerfTypedLogger",["Banzai","GeneratedLoggerUtils","nullthrows"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(){__p&&__p();function a(){this.$1={}}var c=a.prototype;c.log=function(){b("GeneratedLoggerUtils").log("logger:ChatPerfLoggerConfig",this.$1,b("Banzai").BASIC)};c.logVital=function(){b("GeneratedLoggerUtils").log("logger:ChatPerfLoggerConfig",this.$1,b("Banzai").VITAL)};c.logImmediately=function(){b("GeneratedLoggerUtils").log("logger:ChatPerfLoggerConfig",this.$1,{signal:!0})};c.clear=function(){this.$1={};return this};c.getData=function(){return babelHelpers["extends"]({},this.$1)};c.updateData=function(a){this.$1=babelHelpers["extends"]({},this.$1,a);return this};c.setDuration=function(a){this.$1.duration=a;return this};c.setEndpoint=function(a){this.$1.endpoint=a;return this};c.setEvent=function(a){this.$1.event=a;return this};c.setTabsOpen=function(a){this.$1.tabs_open=a;return this};c.setTime=function(a){this.$1.time=a;return this};c.setWeight=function(a){this.$1.weight=a;return this};return a}();c={duration:!0,endpoint:!0,event:!0,tabs_open:!0,time:!0,weight:!0};e.exports=a}),null); __d("FantaConst",[],(function(a,b,c,d,e,f){"use strict";var g={DEFAULT_ALLOWED_RAISED_TABS:2,DEFAULT_MESSAGE_COUNT:10,cookieIDs:{PERSONAL_COOKIE_ID:"t3",PERSONAL_FOCUS_COOKIE_ID:"lm3",PERSONAL_TIME_COOKIE_ID:"utc3",WORK_COOKIE_ID:"t3w",WORK_FOCUS_COOKIE_ID:"lm3w",WORK_TIME_COOKIE_ID:"utc3w"},getCookieIDs:function(){return[g.cookieIDs.PERSONAL_COOKIE_ID,g.cookieIDs.PERSONAL_FOCUS_COOKIE_ID,g.cookieIDs.PERSONAL_TIME_COOKIE_ID,g.cookieIDs.WORK_COOKIE_ID,g.cookieIDs.WORK_FOCUS_COOKIE_ID,g.cookieIDs.WORK_TIME_COOKIE_ID]}};e.exports=g}),null); __d("Dcode",[],(function(a,b,c,d,e,f){__p&&__p();var g,h={},i={_:"%",A:"%2",B:"000",C:"%7d",D:"%7b%22",E:"%2c%22",F:"%22%3a",G:"%2c%22ut%22%3a1",H:"%2c%22bls%22%3a",I:"%2c%22n%22%3a%22%",J:"%22%3a%7b%22i%22%3a0%7d",K:"%2c%22pt%22%3a0%2c%22vis%22%3a",L:"%2c%22ch%22%3a%7b%22h%22%3a%22",M:"%7b%22v%22%3a2%2c%22time%22%3a1",N:".channel%22%2c%22sub%22%3a%5b",O:"%2c%22sb%22%3a1%2c%22t%22%3a%5b",P:"%2c%22ud%22%3a100%2c%22lc%22%3a0",Q:"%5d%2c%22f%22%3anull%2c%22uct%22%3a",R:".channel%22%2c%22sub%22%3a%5b1%5d",S:"%22%2c%22m%22%3a0%7d%2c%7b%22i%22%3a",T:"%2c%22blc%22%3a1%2c%22snd%22%3a1%2c%22ct%22%3a",U:"%2c%22blc%22%3a0%2c%22snd%22%3a1%2c%22ct%22%3a",V:"%2c%22blc%22%3a0%2c%22snd%22%3a0%2c%22ct%22%3a",W:"%2c%22s%22%3a0%2c%22blo%22%3a0%7d%2c%22bl%22%3a%7b%22ac%22%3a",X:"%2c%22ri%22%3a0%7d%2c%22state%22%3a%7b%22p%22%3a0%2c%22ut%22%3a1",Y:"%2c%22pt%22%3a0%2c%22vis%22%3a1%2c%22bls%22%3a0%2c%22blc%22%3a0%2c%22snd%22%3a1%2c%22ct%22%3a",Z:"%2c%22sb%22%3a1%2c%22t%22%3a%5b%5d%2c%22f%22%3anull%2c%22uct%22%3a0%2c%22s%22%3a0%2c%22blo%22%3a0%7d%2c%22bl%22%3a%7b%22ac%22%3a"};(function(){var a=[];for(var b in i)h[i[b]]=b,a.push(i[b]);a.reverse();g=new RegExp(a.join("|"),"g")})();a={encode:function(a){return encodeURIComponent(a).replace(/([_A-Z])|%../g,function(a,b){return b?"%"+b.charCodeAt(0).toString(16):a}).toLowerCase().replace(g,function(a){return h[a]})},decode:function(a){return decodeURIComponent(a.replace(/[_A-Z]/g,function(a){return i[a]}))}};e.exports=a}),null); __d("PresenceCookieManager",["Cookie","CurrentUser","Dcode","ErrorUtils","JSLogger","PresenceInitialData","PresenceUtil","WebStorage"],(function(a,b,c,d,e,f){__p&&__p();var g=b("PresenceInitialData").cookieVersion,h="presence",i={},j=null,k=null,l=b("JSLogger").create("presence_cookie");function m(a){var c=b("Cookie").get(h)||"";if(c.length===0)return null;return c[0]!==a?null:c.substring(1)}function n(a,c){b("Cookie").set(h,a+c)}function o(){return!(b("PresenceInitialData").useWebStorage||!1)?null:b("WebStorage").getSessionStorage()}function p(){var a=o();a=a!=null?a.getItem(h):null;return a!=null?a.substring(1):null}function q(a){var b=o();if(b==null)return!1;b.setItem(h,"E"+a);return!0}function r(){var a=p();return a!=null?a:m("E")}function s(a){__p&&__p();a=a.state;if(a==null)return"";var c=m("S")||"",d=b("CurrentUser").isWorkUser()?"w":"f";a=b("CurrentUser").isWorkUser()?a.t3w:a.t3;a=a!=null?a.length>0:!1;var e=c.indexOf(d)!==-1;e&&!a&&(c=c.replace(d,""));!e&&a&&(c+=d);return c}function t(a,b){var c=q(a);c?n("S",b):(a.length>1024&&l.warn("big_cookie",a.length),n("E",a))}function u(){__p&&__p();try{var a=r();j!==a&&(j=a,k=null,a&&(a=b("Dcode").decode(a),k=JSON.parse(a)));if(k){if(k.user&&k.user!==b("CurrentUser").getID())return null;return k.v!==g?null:k}}catch(a){l.warn("getcookie_error",a)}return null}function v(){return{v:g,time:w(),user:b("CurrentUser").getID()}}function w(){return parseInt(Date.now()/1e3,10)}function x(a){var c=b("Dcode").encode(JSON.stringify(a));b("PresenceUtil").hasUserCookie()&&t(c,s(a))}var y={register:function(a,b){i[a]=b},store:function(){__p&&__p();var a=u();if(a&&a.v&&g1)return g._({"*":"{others_count} others"},[g._param("others_count",a,[0])]);else return g._("1 other")}e.exports=a}),null); __d("WebMessengerThreadPermalinks",["MercuryIDs","MessagingTag","MessengerURIConstants","URI","WWWBase","requireWeak"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g={getThreadURI:function(a,c,d){var e="";b("MercuryIDs").isCanonical(a)?e=b("MercuryIDs").tokenize(a).value:b("requireWeak")("MercuryThreadIDMap",function(b){e=b.get().getServerIDFromClientIDNow(a)});d=g.getThreadURIFromServerID(e||"",d);c&&c(d)},getThreadURIFromServerID:function(a,c){__p&&__p();var d=new(b("URI"))(b("WWWBase").uri),e=b("MessengerURIConstants").FACEBOOK_PREFIX;if(c)switch(c){case b("MessagingTag").OTHER:e+="/filtered";break;case b("MessagingTag").PENDING:e+="/requests";break;case b("MessagingTag").INBOX:break;default:e+="/"+c;break}d.setPath(e+b("MessengerURIConstants").THREAD_PREFIX+a);return d.toString()},getThreadURIFromUserID:function(a,c){var d=new(b("URI"))(b("WWWBase").uri),e=b("MessengerURIConstants").FACEBOOK_PREFIX;d.setPath(h(e,c)+"/t/"+a);return d.toString()}};function h(a,c){c&&c!=b("MessagingTag").INBOX&&(a+="/"+c);return a}e.exports=g}),null); __d("ChatSidebarPresencePrivacyStore",["ChatDispatcher","ChatSidebarPresencePrivacyActions","FluxReduceStore","PresencePrivacy"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var d=c.prototype;d.getInitialState=function(){return{currentUser:b("PresencePrivacy").getVisibility(),onlinePolicy:b("PresencePrivacy").getOnlinePolicy(),friends:b("PresencePrivacy").getFriendsVisibility()}};d.reduce=function(a,c){switch(c.type){case b("ChatSidebarPresencePrivacyActions").PRIVACY_CHANGED:return{onlinePolicy:b("PresencePrivacy").getOnlinePolicy(),currentUser:b("PresencePrivacy").getVisibility(),friends:b("PresencePrivacy").getFriendsVisibility()};case b("ChatSidebarPresencePrivacyActions").USER_PRESENCE_CHANGED:return babelHelpers["extends"]({},a,{onlinePolicy:b("PresencePrivacy").getOnlinePolicy(),currentUser:b("PresencePrivacy").getVisibility()})}return a};d.isUserOffline=function(){return this.getState().currentUser===b("PresencePrivacy").OFFLINE};return c}(b("FluxReduceStore"));a.__moduleID=e.id;e.exports=new a(b("ChatDispatcher"))}),null); __d("ChatSidebarHideReason",[],(function(a,b,c,d,e,f){a=Object.freeze({VIEWPORT_INCAPABLE:0,LOW_FRIEND_COUNT:1,NOT_ENABLED:2,OFF_HOMEPAGE:3});e.exports=a}),null); __d("ChatSidebarVisibility",["ChatConfig","ChatSidebarHideReason","ChatSidebarStore","OrderedFriendsList","URI","getViewportDimensions","gkx"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=b("ChatConfig").get("sidebar.min_friends"),h=b("ChatConfig").get("sidebar.minimum_width"),i=b("ChatConfig").get("sidebar.hide_divebar_off_homepage"),j={getViewport:function(){return b("gkx")("678657")?b("getViewportDimensions")():b("getViewportDimensions").withoutScrollbars()},shouldShowSidebar:function(a,c,d){j.shouldShowSidebarIgnoreEnabled(a,function(a,d){var e=b("ChatSidebarStore").isEnabled();c(a&&e,e?d:d.concat([b("ChatSidebarHideReason").NOT_ENABLED]))},d)},shouldShowSidebarIgnoreEnabled:function(a,c,d){__p&&__p();var e=this;b("OrderedFriendsList").getActiveList(function(f){var k=a||j.getViewport();k=k.width>h;f=f.length=i){var d=b("XPagesBrowserController").getURIBuilder().setString("category","your_pages").setString("ref",a.adminedPages[0].ref).getURI();c=b("React").createElement(b("SRLink.react"),{className:"_2l56",href:d,target:"_blank"},h._("SEE ALL"))}d=a.pageListModule;return b("React").createElement(b("React").Fragment,null,b("React").createElement(b("ChatSidebarHeader.react"),{className:"_4kqp"},b("React").createElement(b("LeftRight.react"),null,h._("YOUR PAGES"),c)),b("React").createElement(d,{adminedPages:a.adminedPages,onMouseEnter:a.onMouseEnterItem}))}e.exports=a}),null); __d("XWorkSaveGroupPurposeController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/work/group_creation/dialog/save_purpose/",{purpose:{type:"String",required:!0},ref:{type:"String",required:!0},name:{type:"String"},community:{type:"FBID"},coworkers_to_invite:{type:"IntVector",defaultValue:[]},back_disallowed:{type:"Bool",defaultValue:!1}})}),null); __d("ChatSidebarCreateNewGroupItem.react",["ix","cx","fbt","Bootloader","Image.react","MercuryConfig","QE2Logger","React","SRLink.react","TooltipData","XWorkSaveGroupPurposeController","asset"],(function(a,b,c,d,e,f,g,h,i){"use strict";__p&&__p();a=b("React").PropTypes;c=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){__p&&__p();var c,d;for(var e=arguments.length,f=new Array(e),g=0;g1;c=f?h(c,d):b("React").createElement(b("SplitImage.react"),{className:"_1gyw",size:d,srcs:c});return b("React").createElement("div",{"aria-hidden":!0,className:"_7049 _6--1"+(f?" _44yq":""),style:{height:d,width:d}},c,a===!0?b("React").createElement("div",{className:"_4rwy"}):e?b("React").createElement("div",{className:"_1gyx"}):null)};return c}(b("React").PureComponent);e.exports=a}),null); __d("ChatSidebarStatus.react",["cssVar","cx","fbt","ix","Image.react","React","asset","gkx"],(function(a,b,c,d,e,f,g,h,i,j){__p&&__p();a=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var d=c.prototype;d.render=function(){var a=this.props,c=this.renderStatusIcon();if(c==null&&a.statusTime==null)return null;var d=!0,e=a.unreadCount;e!=null&&e>0&&(c=a.statusTime!=null?null:c,d=!1);a.showingPresenceOnProfile===!1&&a.isDoNotDisturb===!0&&a.isWorkUser&&b("gkx")("678573")&&(d=!1);return b("React").createElement("div",{className:"_568z"+(a.showRelationshipIndicator?" _2oov":"")},d?this.renderLastActiveTime():null,c)};d.renderStatusIcon=function(){__p&&__p();var a=this.props;if(a.isMessengerOnlyContact===!0)return b("React").createElement(b("Image.react"),{alt:i._("Using Messenger without Facebook"),className:"_568_",src:j("28076")});else if(a.showingPresenceOnProfile===!1&&a.isDoNotDisturb===!0&&a.isWorkUser&&b("gkx")("678573"))return b("React").createElement("span",{"aria-label":i._("Do Not Disturb"),className:"_3zdc"});else if(a.isMultiCompany===!0&&a.isWorkUser)return b("React").createElement("div",{"aria-label":i._("Multi company chat"),className:"_6p8n"});else if(a.status===2)if(a.showRelationshipIndicator===!0)return b("React").createElement(b("Image.react"),{src:j("593722"),alt:i._("hearts icon")});else if(a.showingPresenceOnProfile===!1)return b("React").createElement("span",{"aria-label":i._("Active Now"),style:{background:"#42b72a",borderRadius:"50%",display:"inline-block",height:"6px",marginLeft:"4px",veritcalAlign:"middle",width:"6px"}});return null};d.renderLastActiveTime=function(){return b("React").createElement("div",{className:"_568-"},this.props.statusTime)};return c}(b("React").PureComponent);e.exports=a}),null); __d("RenderOnClient.react",["React"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.render=function(){return this.props.component};return b}(b("React").Component);e.exports=a}),null); __d("isFalsey",[],(function(a,b,c,d,e,f){"use strict";function a(a){return a==null||!Boolean(a)}e.exports=a}),null); __d("ChatSidebarItem.react",["cx","ix","BootloaderGamesPresenceIconContainer.react","BootloadOnRender.react","ChatSidebarConstants","ChatSidebarNameWithGameInfo.react","ChatSidebarProfile.react","ChatSidebarStatus.react","CurrentUser","ErrorBoundary.react","Image.react","JSResource","LazyComponent.react","React","RenderOnClient.react","ShortProfiles","SRLink.react","SRXUIBadge.react","TextWithEmoticons.react","gkx","isFalsey"],(function(a,b,c,d,e,f,g,h){"use strict";__p&&__p();var i=b("gkx")("865973");a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f1).setTotalParticipantCount(d).renderParticipantList(c).toString()}function h(a){return a.map(function(a){return a.image_src}).filter(function(a){return a})}e.exports=c}),null); __d("ChatSidebarGroupThreadsGroup.react",["cx","ChatSidebarConstants","ChatSidebarThread.react","MercuryIDs","PresencePrivacy","PresenceStatus","React"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();a=b("React").PropTypes;c=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){var c,d;for(var e=arguments.length,f=new Array(e),g=0;g0?this.$5():this.$6();a=b("React").createElement(b("React").Fragment,null,b("React").createElement("div",{ref:"noLinks"},this.$7(),this.$8()),this.$9(),b("React").createElement("div",{ref:"noLinks"},this.$10(),this.$11(),this.$12(),a));return b("React").createElement("div",{"data-testid":"chat_sidebar"},b("React").createElement("div",{ref:"noLinks"},this.$13()),b("React").createElement("div",{ref:"noLinks"},this.$14()),b("React").createElement("div",{ref:"noLinks"},this.$15()),!this.$16()&&a,this.$17())};d.$18=function(a){var c=this.props.scrollContainer;if(!c)return;var d=c.clientHeight,e=c.scrollHeight,f=b("Scroll").getTop(c),g=Math.min(a.offsetTop,e-d);f!==g&&b("ifRequired")("Animation",function(a){var b=Math.abs(g-f)/c.clientHeight*500;new a(c).to("scrollTop",g).ease(a.ease.end).duration(b).go()},function(){b("Scroll").setTop(c,g)})};d.$7=function(){if(!b("ChatConfig").getBool("show_header"))return null;var a=this.state.isDisconnected||this.props.isUserOffline;return b("React").createElement(b("ChatSidebarHeader.react"),{className:a?"_570-":""},i._("CONTACTS"))};d.$5=function(){var a=b("ChatSidebarConstants").getImageSize(),c=this.props.offlineUsers.slice(0,-2),d=i._("MORE CONTACTS"),e=i._("These contacts can't see you on chat.");return b("React").createElement(b("React").Fragment,null,b("React").createElement(b("ChatSidebarHeader.react"),null,d),b("React").createElement(b("ChatSidebarHeader.react"),{className:"_5j9-"},e," ",b("React").createElement("a",{ajaxify:"/ajax/chat/privacy/settings_dialog.php?ref=whitelist_separator",href:"#",rel:"dialog"},i._("Edit"))),b("React").createElement(b("ChatSidebarUserGroupContainer.react"),{ids:c,imageSize:a,isDisconnected:this.state.isDisconnected,loadExtras:this.props.isAfterDomLoad,onMouseEnterItem:this.props.onMouseEnterItem,sectionName:"offline_users",showHoverCard:this.props.isSidebar,slotOffset:this.$19(),totalSlots:this.props.maxItemSlots,usersDetailedData:this.props.usersDetailedData}))};d.$6=function(){__p&&__p();var a=this;if(this.props.availableUsers.length===0)return null;if(!this.props.isAfterDomLoad){var c=b("ChatSidebarConstants").getItemHeight();return b("React").createElement("div",{style:{height:c*this.props.availableUsers.length}})}c=b("ChatSidebarConstants").getImageSize();var d=i._("{MORE ONLINE CONTACTS} ({count})",[i._param("MORE ONLINE CONTACTS",i._("MORE CONTACTS")),i._param("count",this.props.availableUsers.length)]);return b("React").createElement(b("React").Fragment,null,b("React").createElement(b("ChatSidebarHeader.react"),{ref:function(b){a.$3=b},onClick:function(){return a.$18(b("ReactDOM").findDOMNode(a.$3))}},d),b("React").createElement(b("ChatSidebarUserGroupContainer.react"),{ids:this.props.availableUsers,imageSize:c,isDisconnected:this.state.isDisconnected,loadExtras:this.props.isAfterDomLoad,onMouseEnterItem:this.props.onMouseEnterItem,sectionName:"more_online_friends",showHoverCard:this.props.isSidebar,slotOffset:this.$19(),totalSlots:this.props.maxItemSlots,usersDetailedData:this.props.usersDetailedData}))};d.$19=function(){var a=this.$20();a+=this.$21();var b=this.props.groups;a+=this.$22(b.length);return a};d.$9=function(){return!b("ChatConfig").getBool("nearby_friends_www_chatbar")||this.props.nearby.length===0?null:b("React").createElement(b("ChatSidebarHeader.react"),{ref:"nearbySeparator"},b("React").createElement(b("LeftRight.react"),null,i._("NEARBY"),b("React").createElement(b("SRLink.react"),{target:"_blank",href:"/help/android-app/291236034364603"},b("React").createElement(b("Image.react"),{className:"_3-90",src:g("129548")}))))};d.$11=function(){if(!b("ChatConfig").getBool("nearby_friends_www_chatbar")||this.props.nearby.length===0)return null;var a=this.$20(),c=b("ChatSidebarConstants").getImageSize();return b("React").createElement(b("ChatSidebarUserGroupContainer.react"),{ids:this.props.nearby,imageSize:c,isDisconnected:this.state.isDisconnected,loadExtras:this.props.isAfterDomLoad,onMouseEnterItem:this.props.onMouseEnterItem,sectionName:"nearby",showHoverCard:this.props.isSidebar,slotOffset:a,totalSlots:this.props.maxItemSlots,usersDetailedData:this.props.usersDetailedData})};d.$21=function(){return this.props.nearby.length};d.$12=function(){var a=this.state.isDisconnected||this.props.isUserOffline,c=this.props.groups,d=this.$20()+this.$21();if(this.$23())return b("React").createElement(b("React").Fragment,null,this.$24(),b("React").createElement("ul",null,b("React").createElement("li",{className:"_42fz"+(a?" _570-":"")},b("React").createElement(b("RenderOnClient.react"),{component:b("React").createElement(b("ChatSidebarCreateNewGroupItem.react"),{slot:0,slotOffset:d,totalSlots:this.props.maxItemSlots})}))));else if(b("ChatOptions").getSetting("hide_groups")||this.props.groups.length===0)return null;return b("React").createElement(b("React").Fragment,null,this.$24(),b("React").createElement(b("RenderOnClient.react"),{component:b("React").createElement(b("ChatSidebarGroupThreadsGroup.react"),{groups:c.slice(0,this.$22(c.length)),isDisconnected:this.state.isDisconnected,loadExtras:this.props.isAfterDomLoad,slotOffset:d,totalSlots:this.props.maxItemSlots})}))};d.$24=function(){var a=this,c=this.state.isDisconnected||this.props.isUserOffline;return b("React").createElement(b("ChatSidebarHeader.react"),{ref:function(b){a.$2=b},className:c?"_570-":"",onClick:function(){return a.$18(b("ReactDOM").findDOMNode(a.$2))}},i._("GROUP CONVERSATIONS"))};d.$22=function(a){if(this.$23())return 1;else if(a===0)return 0;return Math.min(a,b("ChatConfig").getNumber("num_groups_to_show"))};d.$8=function(){var a=b("ChatSidebarConstants").getImageSize();return b("React").createElement(b("ChatSidebarUserGroupContainer.react"),{ids:this.props.topUsers,imageSize:a,isDisconnected:this.state.isDisconnected,loadExtras:this.props.isAfterDomLoad,onMouseEnterItem:this.props.onMouseEnterItem,sectionName:"ordered_list",showHoverCard:this.props.isSidebar,slotOffset:0,totalSlots:this.props.maxItemSlots,usersDetailedData:this.props.usersDetailedData})};d.$20=function(){return this.props.topUsers.length};d.$14=function(){var a=this.props.pymmList;if(a==null)return null;a=a.pages;return this.props.isSidebar!==!0||!b("ChatConfig").getBool("show_businesses")||a==null||a.length===0?null:b("React").createElement(b("RenderOnClient.react"),{component:b("React").createElement(b("ChatSidebarPymmListSection.react"),{pymmList:a})})};d.$13=function(){return b("gkx")("678659")||!b("ChatConfig").getBool("show_admined_pages")||this.props.adminedPages.length===0||this.props.pageListModule==null?null:b("React").createElement(b("RenderOnClient.react"),{component:b("React").createElement(b("ChatSidebarAdminedPagesSection.react"),{adminedPages:this.props.adminedPages,onMouseEnterItem:this.props.onMouseEnterItem,pageListModule:this.props.pageListModule})})};d.$10=function(){var a;a=((a=this.props.marketplaceThreads)==null?void 0:a.length)||0;return a===0||b("ChatOptions").getSetting("hide_marketplace")||!b("qex")._("690094")?null:b("React").createElement(b("RenderOnClient.react"),{component:b("React").createElement(b("ChatSidebarMarketplaceSectionLazy.react"),{marketplaceThreads:this.props.marketplaceThreads})})};d.$15=function(){return j?b("React").createElement(b("RenderOnClient.react"),{component:b("React").createElement(j,{recentCalls:this.props.recentCalls,usersDetailedData:this.props.usersDetailedData})}):null};d.$4=function(){var a=this;b("Bootloader").loadModules(["ChannelConnection"],function(c){a.$1=c.subscribe([c.CONNECTED,c.RECONNECTING,c.SHUTDOWN,c.MUTE_WARNING,c.UNMUTE_WARNING],function(){var d=c.disconnected();d!==a.state.isDisconnected&&(d?b("ChatReliabilityInstrumentation").logCHANNEL_DISCONNECT():b("ChatReliabilityInstrumentation").logCHANNEL_CONNECT(),a.setState({isDisconnected:d}))})},"ChatSidebarOrderedList.react")};d.$23=function(){return this.props.groups.length===0&&!b("ChatOptions").getSetting("hide_groups")};d.$16=function(){return b("gkx")("697231")&&this.props.isSidebar!==!0&&this.props.isUserOffline===!0};d.$17=function(){return!this.$16()?null:b("React").createElement(b("RenderOnClient.react"),{component:b("React").createElement(b("ChatSidebarOfflineOverlayWrapper.react"),null)})};return c}(b("React").PureComponent);e.exports=a}),null);