/*!CK:3005907834!*//*1427333161,*/

if (self.CavalryLogger) { CavalryLogger.start_js(["5FIQ8"]); }

__d("CreditCardFormParam",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={ACCOUNT_ID:"account_id",ACCOUNT_COUNTRY_CODE:"account_country_code",APP_ID:"app_id",CARD_EXPIRATION:"exp",CARD_FBID:"cc_fbid",CARD_ID:"cc_id",CARD_TYPE:"cardType",CITY:"city",CONTEXT_ID:"context_id",COUNTRY:"country",CSC_LENGTH:"csc_length",EMAIL:"email",FIRST_NAME:"firstName",TRACKING_ID:"tracking_id",JSFAIL_SOURCE:"jsfail_source",KEYPRESS_TIMES:"kpts",LAST_NAME:"lastName",MONTH:"month",STATE:"state",STREET:"street",STREET_2:"street2",VALIDATE_ADDRESS:"validate_address",VALIDATE_NAME:"validate_name",VALIDATE_ZIP:"validate_zip",YEAR:"year",ZIP:"zip",VALIDATOR_CHECKS:"checks",CARD_NUMBER:"creditCardNumber",CSC:"csc",CARD_NUMBER_FIRST_6:"creditCardNumber_first6",CARD_NUMBER_LAST_4:"creditCardNumber_last4",CARD_NUMBER_TOKEN:"creditCardNumber_token",CSC_TOKEN:"csc_token",AUTH_LEVEL_FLAG:"auth_level",AUTH_AMOUNT:"auth_amount",AUTH_CURRENCY:"auth_currency",AUTO_EXPAND_AUTH_LEVEL_FLAG:"auto_expand_auth_level",PAYMENT_ITEM_TYPE:"payment_item_type",CREDENTIAL_ID:"credential_id"};},null);
__d("CreditCardTypeEnum",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={VISA:86,MASTERCARD:77,DISCOVER:68,AMERICANEXPRESS:65,DINERSCLUB:64,JCB:74};},null);
__d("MercuryActionStatus",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={UNSENT:0,SUCCESS:1,UNCONFIRMED:3,FAILED_UNKNOWN_REASON:4,UNABLE_TO_CONFIRM:5,RESENT:6,RESENDING:7,ERROR:10};},null);
__d("MercuryActionType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={LOG_MESSAGE:"ma-type:log-message",USER_GENERATED_MESSAGE:"ma-type:user-generated-message",CHANGE_READ_STATUS:"ma-type:change_read_status",MARK_THREAD_SEEN:"ma-type:mark_thread_seen",CHANGE_MUTE_SETTINGS:"ma-type:change-mute-settings",CLEAR_CHAT:"ma-type:clear_chat",SEND_MESSAGE:"ma-type:send-message",UPDATE_ACTION_ID:"ma-type:update-action-id",DELETE_MESSAGES:"ma-type:delete-messages",MARK_MESSAGES_SPAM:"ma-type:mark-messages-spam",DELETE_THREAD:"ma-type:delete-thread",CHANGE_ARCHIVED_STATUS:"ma-type:change-archived-status",CHANGE_FOLDER:"ma-type:change-folder",ADD_PARTICIPANTS:"ma-type:add-participants",CANCEL_ATTACHMENT_PLACEHOLDER:"ma-type:cancel-attachment-placeholder",CONFIRM_ATTACHMENT_PLACEHOLDER:"ma-type:confirm-attachment-placeholder",ADD_SHARE_DATA_TO_EXISTING_MESSAGE:"ma-type:add-share-data-to-existing-message",UNPIN_THREAD:"ma-type:unpin-thread"};},null);
__d("MercuryAPIArgsSource",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={CHAT:"chat",JEWEL:"jewel",MERCURY:"mercury",WEBMESSENGER:"web_messenger",MESSENGER:"messenger"};},null);
__d("MercuryAttachmentContentType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={PHOTO:"attach:image",VIDEO:"attach:video",MUSIC:"attach:music",VOICE:"attach:voice",TEXT:"attach:text",MSWORD:"attach:ms:word",MSXLS:"attach:ms:xls",MSPPT:"attach:ms:ppt",ORION:"attach:orion",SHOERACK_INVITATION:"attach:shoerackinvite",UNKNOWN:"attach:unknown"};},null);
__d("MercuryAttachmentType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={ERROR:"error",FILE:"file",PHOTO:"photo",STICKER:"sticker",SHARE:"share",UNKNOWN:"unknown",VIDEO:"video",ANIMATED_IMAGE:"animated_image"};},null);
__d("MercuryAudioType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={AudioClip:"fb_voice_message",VoiceMessageWithTranscript:"fb_voice_message_with_transcript"};},null);
__d("MercuryErrorType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={SERVER:1,TRANSPORT:2,TIMEOUT:3};},null);
__d("MercuryGenericConstants",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={MAX_THREAD_NAME_LENGTH:250};},null);
__d("MercuryGlobalActionType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={MARK_ALL_READ:"mga-type:mark-all-read"};},null);
__d("MercuryLogMessageType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={SUBSCRIBE:"log:subscribe",UNSUBSCRIBE:"log:unsubscribe",VIDEO_CALL:"log:video-call",PHONE_CALL:"log:phone-call",THREAD_NAME:"log:thread-name",THREAD_IMAGE:"log:thread-image",SERVER_ERROR:"log:error-msg",LIVE_LISTEN:"log:live-listen",WALLPAPER:"log:wallpaper",ORION:"log:orion",SWITCH_TO_WORK:"log:switch",PAGE_REPLY:"log:page-reply"};},null);
__d("MercuryMessageSourceTags",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={CHAT:"source:chat",EMAIL:"source:email",MESSENGER:"source:messenger",MOBILE:"source:mobile"};},null);
__d("MercuryParticipantTypes",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={USER:"user",THREAD:"thread",EVENT:"event",PAGE:"page",FRIEND:"friend"};},null);
__d("MercuryPayloadSource",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={UNKNOWN:"unknown",CLIENT_CHANNEL_MESSAGE:"client_channel_message",CLIENT_SEND_MESSAGE:"client_send_message",CLIENT_CHANGE_ARCHIVED_STATUS:"client_change-archived_status",CLIENT_CHANGE_FOLDER:"client_change_folder",CLIENT_CHANGE_MUTE_SETTINGS:"client_change_mute_settings",CLIENT_CHANGE_READ_STATUS:"client_change_read_status",CLIENT_MARK_THREAD_SEEN:"client_mark_thread_seen",CLIENT_ADD_PARTICIPANTS:"client_add_participants",CLIENT_FETCH_PARTICIPANTS:"client_fetch_participants",CLIENT_CLEAR_CHAT:"client_clear_chat",CLIENT_DELETE_MESSAGES:"client_delete_messages",CLIENT_MARK_MESSAGES_SPAM:"client_mark_messages_spam",CLIENT_DELETE_THREAD:"client_delete_thread",CLIENT_HANDLE_ERROR:"client_handle_error",CLIENT_UNPIN_THREAD:"client_unpin_thread",SERVER_INITIAL_DATA:"server_initial_data",SERVER_SEND_MESSAGE:"server_send_message",SERVER_CONFIRM_MESSAGES:"server_confirm_messages",SERVER_CHANGE_ARCHIVED_STATUS:"server_change_archived_status",SERVER_CHANGE_READ_STATUS:"server_change_read_status",SERVER_MARK_FOLDER_READ:"server_mark_folder_read",SERVER_MARK_SEEN:"server_mark_seen",SERVER_FETCH_PARTICIPANTS:"server_fetch_participants",SERVER_FETCH_THREAD_INFO:"server_fetch_thread_info",SERVER_FETCH_THREADLIST_INFO:"server_fetch_threadlist_info",SERVER_STANDALONE_NOTIFICATIONS:"server_standalone_notifications",SERVER_THREAD_SYNC:"server_thread_sync",SERVER_TAB_PRESENCE:"server_tab_presence",SERVER_UNREAD_THREADS:"server_unread_threads",SERVER_SEARCH:"server_search",SERVER_ADD_SHARE_DATA_TO_EXISTING_MESSAGE:"server_add_share_data_to_existing_message"};},null);
__d("MercurySendMessageFields",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={AUTO_RETRY_CNT:"auto_retry_cnt",MANUAL_RETRY_CNT:"manual_retry_cnt"};},null);
__d("MercurySourceType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={CHAT_ORCA:"source:chat:orca",CHAT_IPHONE:"source:chat:iphone",CHAT_JABBER:"source:chat:jabber",CHAT_MEEBO:"source:chat:meebo",CHAT_WEB:"source:chat:web",CHAT_TEST:"source:chat:test",CHAT:"source:chat",EMAIL:"source:email",GIGABOXX_API:"source:gigaboxx:api",GIGABOXX_BLAST:"source:gigaboxx:blast",GIGABOXX_EMAIL_REPLY:"source:gigaboxx:emailreply",GIGABOXX_MOBILE:"source:gigaboxx:mobile",GIGABOXX_WAP:"source:gigaboxx:wap",GIGABOXX_WEB:"source:gigaboxx:web",LEIA:"source:leia",MESSENGER_WEB:"source:messenger:web",SAM_UFI:"source:sam:ufi",SHARE_DIALOG:"source:share:dialog",SEND_PLUGIN:"source:sendplugin",SMS:"source:sms",TEST:"source:test",TITAN_WAP:"source:titan:wap",TITAN_M_BASIC:"source:titan:m_basic",TITAN_M_FREE:"source:titan:m_free_basic",TITAN_M_JAPAN:"source:titan:m_japan",TITAN_M_MINI:"source:titan:m_mini",TITAN_M_TOUCH:"source:titan:m_touch",TITAN_M_APP:"source:titan:m_app",TITAN_M_TABLET:"source:titan:m_tablet",TITAN_M_ZERO:"source:titan:m_zero",TITAN_M_TALK:"source:titan:m_talk",TITAN_WEB:"source:titan:web",TITAN_FACEWEB_ANDROID:"source:titan:faceweb_android",TITAN_FACEWEB_BUFFY:"source:titan:faceweb_buffy",TITAN_FACEWEB_IPAD:"source:titan:faceweb_ipad",TITAN_FACEWEB_IPHONE:"source:titan:faceweb_iphone",TITAN_FACEWEB_UNKNOWN:"source:titan:faceweb_unknown",TITAN_API:"source:titan:api",TITAN_API_MOBILE:"source:titan:api_mobile",TITAN_ORCA:"source:titan:orca",TITAN_EMAIL_REPLY:"source:titan:emailreply",MOBILE:"source:mobile",PAGE_PLATFORM_API:"source:page_platform_api",UNKNOWN:"source:unknown",WEB:"source:web",HELPCENTER:"source:helpcenter",NEW_SHARE_DIALOG:"source:share:dialog:new",PAID_PROMOTION:"source:paid_promotion",BUFFY_SMS:"source:buffy:sms",WEBRTC_MOBILE:"source:webrtc:mobile",MESSENGER_COMMERCE:"source:messenger:commerce"};},null);
__d("MercuryThreadMode",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={EMAIL_ORIGINATED:1,TITAN_ORIGINATED:2,OBJECT_ORIGINATED:3};},null);
__d("MercuryTimePassed",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={TODAY:0,WEEK_AGO:1,MONTH_AGO:2,CURRENT_YEAR:3,OTHER_YEAR:4};},null);
__d("MessagingEvent",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={DELETE:"delete",DELETE_MESSAGES:"delete_messages",DELIVER:"deliver",ERROR:"error",READ:"read",REPORT_SPAM:"report_spam",REPORT_SPAM_MESSAGES:"report_spam_messages",UNMARK_SPAM:"unmark_spam",SUBSCRIBE:"subscribe",CHANGE_MUTE_SETTINGS:"change_mute_settings",TAG:"tag",UNREAD:"unread",UNSUBSCRIBE:"unsubscribe",DELIVER_LOG:"deliver_log",MORE_THREADS:"more_threads",READ_ALL:"read_all",READ_RECEIPT:"read_receipt",DELIVERY_RECEIPT:"delivery_receipt",SENT_PUSH:"sent_push",DELIVER_FAST_PAST:"deliver_fast_path",MESSENGER_STATUS:"messenger_status",UPDATE_PINNED_THREADS:"update_pinned_threads"};},null);
__d("MessagingTag",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={GROUPS:"groups",UNREAD:"unread",ACTION_ARCHIVED:"action:archived",INBOX:"inbox",OTHER:"other",EVENT:"event",SENT:"sent",SMS_MUTE:"sms_mute",SPAM:"spam",UPDATES:"broadcasts_inbox",BCC:"header:bcc",FILTERED_CONTENT:"filtered_content",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"};},null);
__d("P2PChannelType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={TRANSFER_STATUS_CHANGED:"P2P\/TransferStatusChanged"};},null);
__d("P2PPasswordProtectionParam",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={STATUS:"status"};},null);
__d("P2PPasswordProtectionStatusTypes",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={NOT_SET:0,DISABLED:1,ENABLED:2};},null);
__d("P2PPaymentCreditCardsTypes",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={SENDING:1,RECEIVING:2};},null);
__d("P2PPaymentLoggerEvent",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={ACTN_ADD_CREDIT_CARD:"Actn_AddCreditCard",ACTN_UPDATE_CREDIT_CARD:"Actn_UpdateCreditCard",ACTN_REMOVE_CREDIT_CARD:"Actn_RemoveCreditCard",ACTN_UNLOCK_CREDIT_CARD:"Actn_UnlockCreditCard",ACTN_TRANSFER_MONEY:"Actn_TransferMoney",ACTN_ACCEPT_MONEY:"Actn_AcceptMoney",ACTN_DECLINE_MONEY:"Actn_DeclineMoney",ACTN_SET_PRIMARY:"Actn_SetPrimary",ACTN_WITHDRAW_MONEY:"Actn_WithdrawMoney",ACTN_AUTH_FOR_SENDER_REVIEW:"Actn_AuthForSenderReview",ACTN_COMPLETE_SENDER_REVIEW:"Actn_CompleteSenderReview",ACTN_COMPLETE_RECEIVER_REVIEW:"Actn_CompleteReceiverReview",ACTN_COMPLETE_SENDER_VERIFICATION:"Actn_CompleteSenderVerification",ACTN_COMPLETE_RECEIVER_VERIFICATION:"Actn_CancelReceiverVerification",ACTN_CANCEL_SENDER_VERIFICATION:"Actn_CancelSenderVerification",ACTN_CANCEL_RECEIVER_VERIFICATION:"Actn_CancelReceiverVerification",ACTN_CANCEL_SENDER_RISK:"Actn_CancelSenderRisk",ACTN_CANCEL_EXPIRE:"Actn_CancelExpire",ACTN_CANCEL_FOR_SAME_CARD:"Actn_CancelForSameCard",ACTN_CANCEL_BY_CUSTOMER_SERVICE:"Actn_CancelByCustomerService",ACTN_CANCEL_RECEIVER_REVIEW:"Actn_CancelReceiverReview",ACTN_CANCEL_SENDER_REVIEW:"Actn_CancelSenderReview",ACTN_ADD_PIN:"Actn_AddPIN",ACTN_UPDATE_PIN:"Actn_UpdatePIN",ACTN_REMOVE_PIN:"Actn_RemovePIN",ACTN_RESET_PIN:"Actn_ResetPIN",ACTN_ENABLE_TOUCH_ID:"Actn_EnableTouchID",ACTN_VERIFY_TOUCH_ID:"Actn_VerifyTouchID",ACTN_DISABLE_TOUCH_ID:"Actn_DisableTouchID",UI_ACTN_INITIATE_SEND:"UI_Actn_Initiate_Send",UI_ACTN_CANCEL_SEND:"UI_Actn_Send_Money_Cancelled",UI_ACTN_INITIATE_ADD_CARD:"UI_Actn_Initiate_Add_Card",UI_ACTN_CANCEL_ADD_CARD:"UI_Actn_Cancel_Add_Card",UI_ACTN_CONFIRM_CARD_DETAILS:"UI_Actn_Confirm_Card_Details",UI_ACTN_ACCEPT_WITH_CARD:"UI_Actn_Accept_With_Card",UI_ACTN_ADD_CARD_SUCCESS:"UI_Actn_Add_Card_Success",UI_ACTN_ADD_CARD_FAIL:"UI_Actn_Add_Card_Fail",UI_ACTN_CONFIRM_SEND:"UI_Actn_Confirm_Send",UI_ACTN_SEND_SUCCESS:"UI_Actn_Send_Success",UI_ACTN_SEND_MONEY_CANCELLED:"UI_Actn_Send_Money_Cancelled",UI_ACTN_SEND_FAIL:"UI_Actn_Send_Fail",UI_ACTN_INITIATE_EDIT_CARD:"UI_Actn_Initiate_Edit_Card",UI_ACTN_CANCEL_EDIT_CARD:"UI_Actn_Cancel_Edit_Card",UI_ACTN_CONFIRM_EDIT_CARD_DETAILS:"UI_Actn_Confirm_Edit_Card_Details",UI_ACTN_EDIT_CARD_SUCCESS:"UI_Actn_Edit_Card_Success",UI_ACTN_EDIT_CARD_FAIL:"UI_Actn_Edit_Card_Fail",UI_ACTN_INITIATE_REMOVE_CARD:"UI_Actn_Initiate_Remove_Card",UI_ACTN_CONFIRM_REMOVE_CARD:"UI_Actn_Confirm_Remove_Card",UI_ACTN_REMOVE_CARD_SUCCESS:"UI_Actn_Remove_Card_Success",UI_ACTN_REMOVE_CARD_FAIL:"UI_Actn_Remove_Card_Fail",UI_ACTN_INITIATE_PASSWORD_PROTECTION_NUX:"UI_Actn_Initiate_Password_Protection_NUX",UI_ACTN_OPT_IN_PASSWORD_PROTECTION_NUX:"UI_Actn_Opt_In_Password_Protection_NUX",UI_ACTN_OPT_OUT_PASSWORD_PROTECTION_NUX:"UI_Actn_Opt_Out_Password_Protection_NUX",UI_ACTN_ENABLED_PASSWORD_PROTECTION_SETTING:"UI_Actn_Enabled_Password_Protection_Setting",UI_ACTN_DISABLED_PASSWORD_PROTECTION_SETTING:"UI_Actn_Disabled_Password_Protection_Setting",UI_ACTN_SEND_CLICKED:"UI_Actn_Send_Clicked",UI_ACTN_VERIFY_CSC:"UI_Actn_Verify_CSC",UI_ACTN_CONFIRM_AMOUNT:"UI_Actn_Confirm_Amount"};},null);
__d("P2PPaymentLoggerEventFlow",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={UI_FLOW_P2P_SEND:"UI_Flow_P2P_Send",UI_FLOW_P2P_RECEIVE:"UI_Flow_P2P_Receive",UI_FLOW_P2P_SETTINGS:"UI_Flow_P2P_Settings"};},null);
__d("P2PTransferParam",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={TRANSFER_ID:"transfer_id",STATUS:"status",RISK_RESULT:"risk_result"};},null);
__d("P2PTransferStatus",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={PENDING_SENDER_MANUAL_REVIEW:1,PENDING_SENDER_VERIFICATION:2,CANCELED_SENDER_RISK:3,PENDING_RECIPIENT_NUX:4,CANCELED_DECLINED:5,PENDING_RECIPIENT_VERIFICATION:6,PENDING_RECIPIENT_MANUAL_REVIEW:7,PENDING_RECIPIENT_PROCESSING:8,PENDING_PUSH_FAIL:9,CANCELED_RECIPIENT_RISK:10,CANCELED_SYSTEM_FAIL:11,CANCELED_EXPIRED:12,COMPLETED:13,INTERMEDIATE_PROCESSING:14,PENDING_SENDER_INITED:15,CANCELED_SAME_CARD:16,PENDING_SENDER_VERIFICATION_PROCESSING:17,PENDING_RECIPIENT_VERIFICATION_PROCESSING:18};},null);
__d("PagesMessagingConst",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={LOAD_MESSAGE_THREAD_URI:"\/ajax\/pages\/messages\/load_message_thread.php",ASYNC_ENDPOINT:"\/ajax\/messaging\/async.php"};},null);
__d("PhotoResizeModeConst",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={CONTAIN:"s",COVER:"p"};},null);
__d("StoryAttachmentStyle",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={FALLBACK:"fallback",SHARE:"share",OG_COMPOSER_SIMPLE:"og_composer_simple",SPORTS_MATCHUP:"sports_matchup",SHARE_LARGE_IMAGE:"share_large_image",PHOTO:"photo",COVER_PHOTO:"cover_photo",ALBUM:"album",NEW_ALBUM:"new_album",COUPON:"coupon",QUESTION:"question",ANSWER:"answer",OPTION:"option",GALLERY:"gallery",STREAM_PUBLISH:"stream_publish",MUSIC_AGGREGATION:"music_aggregation",ITEM_LIST:"list",HIGH_SCORE:"high_score",SCORE_LEADERBOARD:"score_leaderboard",FRIEND_LIST:"friend_list",CHECKIN:"checkin",POPULAR_OBJECTS:"popular_objects",AVATAR_LIST:"avatar_list",AVATAR:"avatar",AVATAR_WITH_VIDEO:"avatar_with_video",EVENT:"event",EXPERIENCE:"experience",LIFE_EVENT:"life_event",TRAVEL_SLIDESHOW_LIFE_EVENT:"travel_slideshow_life_event",GIFT:"gift",IMAGE_SHARE:"image_share",ANIMATED_IMAGE_SHARE:"animated_image_share",ANIMATED_IMAGE_AUTOPLAY:"animated_image_autoplay",NOTE:"note",TOPIC:"topic",FILE_UPLOAD:"file_upload",NOTIFICATION_TARGET:"notification_target",UNAVAILABLE:"unavailable",PAGE_RECOMMENDATION:"page_recommendation",PAGE_VIDEO_PLAYLIST:"page_video_playlist",VIDEO:"video",VIDEO_INLINE:"video_inline",VIDEO_AUTOPLAY:"video_autoplay",VIDEO_SHARE:"video_share",VIDEO_SHARE_HIGHLIGHTED:"video_share_highlighted",VIDEO_SHARE_YOUTUBE:"video_share_youtube",MAP:"map",OG_MAP:"og_map",PRODUCT:"product",EXTERNAL_PRODUCT:"external_product",FITNESS_COURSE:"fitness_course",APPLICATION:"application",STICKER:"sticker",EXTERNAL_OG_PRODUCT:"external_og_product",TRAVEL_LOG:"travel_log",MULTI_SHARE:"multi_share",MULTI_SHARE_NO_END_CARD:"multi_share_no_end_card",YEAR_IN_REVIEW:"year_in_review",AVATAR_LARGE_COVER:"avatar_large_cover",BROADCAST_REQUEST:"broadcast_request",COMMERCE_PRODUCT_ITEM:"commerce_product_item",COMMERCE_STORE:"commerce_store",THIRD_PARTY_PHOTO:"third_party_photo",PROMPT:"prompt",BIRTHDAY:"birthday",DONATIONS_CAMPAIGN:"donations_campaign",DONATE_PROMPT:"donate_prompt",DISCUSSION_CONVERSATION:"discussion_conversation",DISCUSSION_COMMENT:"discussion_comment",GROUP_SELL_PRODUCT_ITEM:"group_sell_product_item",GROUP_SELL_PRODUCT_ITEM_MARK_AS_SOLD:"group_sell_mark_as_sold",GAMETIME:"gametime",GROUP_REPORTED_POST_QUEUE:"group_reported_post_queue",GROUP_PENDING_POST_QUEUE:"group_pending_post_queue",GROUP_JOIN_REQUEST_QUEUE:"group_join_request_queue",GREETING_CARD:"greeting_card",LEAD_GEN:"lead_gen",ATTACHED_STORY:"attached_story",SOUVENIR:"souvenir",ORION:"orion",RETAIL_ITEM:"retail_item",RETAIL_RECEIPT:"retail_receipt",INSTANT_ARTICLE:"instant_article",RETAIL_CANCELLATION:"retail_cancellation",JOIN_TOPIC_CONVERSATION:"join_topic_conversation",MOMENTS_APP_INVITATION:"moments_app_invitation",RETAIL_SHIPMENT:"retail_shipment",RETAIL_SHIPMENT_TRACKING_EVENT:"retail_shipment_tracking_event",SURVEY:"survey",MESSAGE_LOCATION:"message_location"};},null);
__d("XdArbiterBuffer",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();if(!a.XdArbiter)a.XdArbiter={_m:[],_p:[],register:function(g,h,i){h=h||((/^apps\./).test(location.hostname)?'canvas':'tab');this._p.push([g,h,i]);return h;},handleMessage:function(g,h){this._m.push([g,h]);}};},null);
__d("CanvasIFrameLoader",["$","XdArbiterBuffer"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();b('XdArbiterBuffer');var h={loadFromForm:function(i){i.submit();}};e.exports=h;},null);
__d("ChatConfig",["ChatConfigInitialData","copyProperties"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i={},j={get:function(k,l){return k in i?i[k]:l;},set:function(k){if(arguments.length>1){var l={};l[k]=arguments[1];k=l;}h(i,k);},getDebugInfo:function(){return i;}};j.set(g);e.exports=j;},null);
__d("SystemEvents",["Arbiter","ErrorUtils","SystemEventsInitialData","UserAgent_DEPRECATED","copyProperties","setIntervalAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=new g(),n=[],o=1000;l(function(){for(var y=0;y<n.length;y++)n[y]();},o);function p(){return (/c_user=(\d+)/.test(document.cookie)&&RegExp.$1)||0;}function q(){return i.ORIGINAL_USER_ID;}var r=q(),s=navigator.onLine;function t(){if(!s){s=true;m.inform(m.ONLINE,s);}}function u(){if(s){s=false;m.inform(m.ONLINE,s);}}if(j.ie()){if(j.ie()>=11){window.addEventListener('online',t,false);window.addEventListener('offline',u,false);}else if(j.ie()>=8){window.attachEvent('onload',function(){document.body.ononline=t;document.body.onoffline=u;});}else n.push(function(){(navigator.onLine?t:u)();});}else if(window.addEventListener)if(!j.chrome()){window.addEventListener('online',t,false);window.addEventListener('offline',u,false);}var v=r;n.push(function(){var y=p();if(v!=y){m.inform(m.USER,y);v=y;}});var w=Date.now();function x(){var y=Date.now(),z=y-w,aa=z<0||z>10000;w=y;if(aa)m.inform(m.TIME_TRAVEL,z);return aa;}n.push(x);n.push(function(){if(window.onerror!=h.onerror)window.onerror=h.onerror;});k(m,{USER:'SystemEvents/USER',ONLINE:'SystemEvents/ONLINE',TIME_TRAVEL:'SystemEvents/TIME_TRAVEL',isPageOwner:function(y){return (y||p())==r;},isOnline:function(){return j.chrome()||s;},checkTimeTravel:x});e.exports=m;},null);
__d("ChannelSubdomain",["Event","JSLogger","Run","setTimeoutAcrossTransitions","LogHistory","WebStorage"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=b('LogHistory').getInstance('channel'),l=b('WebStorage').getLocalStorage(),m=h.create('channel'),n='channel_sub:',o=7,p=100*1000,q=null,r;function s(){if(r){clearTimeout(r);r=null;}if(l&&q!=null)l.removeItem(n+q);q=null;}function t(u,v,w){var x=(u-1)*o;if(w){if(r)clearTimeout(r);q=r=null;}if(v==null)v=Math.floor(Math.random()*x);if(q==null)if(l){var y=[];for(var z=0;z<l.length;z++){var aa=l.key(z);if(aa.indexOf(n)===0){var ba=parseInt(aa.substr(n.length),10);y[ba]=parseInt(l.getItem(aa),10);}}var ca=Date.now()-p;for(z=0;z<x;z++){var da=(z+v)%x;if(!y[da]||y[da]<ca){q=da;break;}}if(q!=null){var ea=function(){try{l.setItem(n+q,Date.now());}catch(fa){k.warn('subdomain set failed',fa.message);}r=j(ea,p/2);};ea();}else{k.warn('no channel subdomain',y);m.error('subdomain_overflow');}if(typeof window.onpageshow!='undefined'){g.listen(window,'pagehide',s);}else i.onUnload(s);}else q=v;return q==null?null:q%o;}e.exports={allocate:t,clear:s};},null);
__d("DocRPC",["ErrorUtils"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={_apis:{},_dispatch:function(i){var j;try{i=JSON.parse(i);}catch(k){throw new Error('DocRPC unparsable dispatch: "'+i+'"');}if(h._apis.hasOwnProperty(i.api)){var l=h._apis[i.api];if(l[i.method])j=g.applyWithGuard(l[i.method],l,i.args);}if(j===(void 0))j=null;return JSON.stringify(j);},publish:function(i,j){h._apis[j]=i;},proxy:function(i,j,k){var l={};k.forEach(function(m){l[m]=function(){var n={api:j,method:m,args:Array.prototype.slice.call(arguments)},o;try{if(i.closed)throw new Error('DocRPC window closed');o=i.DocRPC._dispatch(JSON.stringify(n));}catch(p){g.reportError(p);return;}if(typeof(o)=='string')try{o=JSON.parse(o);}catch(p){throw new Error('DocRPC '+j+'.'+m+' unparsable return: "'+o+'"');}return o;};});return l;}};e.exports=a.DocRPC=h;},null);
__d("ChannelTransport",["AjaxRequest","ChannelConstants","DocRPC","LogHistory","URI","copyProperties","bind","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o=j.getInstance('channel');function p(){return (1048576*Math.random()|0).toString(36);}function q(z,aa){var ba=z.subdomain;ba=ba===null?'':(ba+'-');var ca=new k(aa).setDomain(ba+z.host+'.'+z.domain).setPort(z.port).setSecure(k().isSecure());return ca;}function r(z){var aa={partition:z.partition,cb:p()};if(z.sticky_token)aa.sticky_token=z.sticky_token;var ba=q(z,'/p').setQueryData(aa);o.log('start_p',{uri:ba.toString()});var ca=new g('GET',ba);if(g.supportsCORS())ca.xhr.withCredentials=true;var da=function(ea){o.log('finish_p',{xhr:ea.toJSON?ea.toJSON():ea});};ca.timeout=z.P_TIMEOUT;ca.onError=ca.onSuccess=da;ca.send();}function s(z,aa,ba){var ca=new Image(),da=0,ea=function(ha){ca.abort();return ha?aa():ba();};ca.onload=function(){o.log('ping_ok',{duration:Date.now()-da});ea(true);};ca.onerror=function(){r(z);ea(false);};var fa=n(ca.onerror,10000);ca.abort=function(){if(fa){clearTimeout(fa);fa=null;}ca.onload=ca.onerror=null;};var ga={partition:z.partition,cb:p()};if(z.sticky_token)ga.sticky_token=z.sticky_token;if(z.sticky_pool)ga.sticky_pool=z.sticky_pool;if(z.lastRequestErrorReason){ga.reason=z.lastRequestErrorReason;z.lastRequestErrorReason=null;}if(z.uid&&z.viewerUid){ga.uid=z.uid;ga.viewer_uid=z.viewerUid;}if(z.watchdog&&z.watchdog.enabled)ga.wtc=z.watchdog.doSerialize();da=Date.now();ca.src=q(z,'/ping').setQueryData(ga);return ca;}function t(z){var aa={channel:z.user_channel,partition:z.partition,clientid:z.sessionID,cb:p(),cap:0,uid:z.uid,viewer_uid:z.viewerUid};if(z.sticky_token)aa.sticky_token=z.sticky_token;if(z.sticky_pool)aa.sticky_pool=z.sticky_pool;if(z.is_offline){aa.state='offline';}else aa.state='active';if(aa.state===z.lastPresenceState)return;z.lastPresenceState=aa.state;if(z.profile)aa.profile=z.profile;if(z.capabilities)aa.cap=z.capabilities;var ba=q(z,'/active_ping').setQueryData(aa),ca=new g('GET',ba);if(g.supportsCORS())ca.xhr.withCredentials=true;ca.onError=function(da){o.warn('active_ping_error');};ca.onSuccess=function(da){o.log('active_ping_ok');};ca.timeout=z.P_TIMEOUT;ca.send();}function u(z,aa,ba,ca){var da=new Date(),ea=-1;if(z.userActive>0){ea=(da-z.userActive)/1000|0;if(ea<0)o.warn('idle_regression',{idleTime:ea,now:da.getTime(),userActive:z.userActive});}var fa={channel:z.user_channel,seq:z.seq,partition:z.partition,clientid:z.sessionID,cb:p(),idle:ea,cap:0};if(!!z.watchdog&&z.watchdog.enabled)fa.wtc=z.watchdog.doSerialize();fa.msgs_recv=z.estimatedReceived;if(z.uid&&z.viewerUid){fa.uid=z.uid;fa.viewer_uid=z.viewerUid;}if(z.sticky_token)fa.sticky_token=z.sticky_token;if(z.sticky_pool)fa.sticky_pool=z.sticky_pool;if('trace_id' in z)fa.traceid=z.trace_id;if(z.is_offline){fa.state='offline';}else if(z.userActive>0&&ea<60)fa.state='active';z.lastPresenceState=fa.state;if(z.streamingCapable){fa.mode='stream';fa.format='json';}if(z.profile)fa.profile=z.profile;if(z.capabilities)fa.cap=z.capabilities;var ga=q(z,'/pull').setQueryData(fa),ha=z.fantail_enabled?'POST':'GET',ia=new g(ha,ga);if(g.supportsCORS())ia.xhr.withCredentials=true;ia.timeout=z.streamingCapable?z.STREAMING_TIMEOUT:z.LONGPOLL_TIMEOUT;ia.onJSON=aa;ia.onSuccess=ba;ia.onError=function(){var la=(this.status==12002&&this._time>=z.MIN_12002_TIMEOUT)||(this.status==504&&this._time>=z.MIN_504_TIMEOUT),ma=la?ba:ca;return ma&&ma.apply(this,arguments);};if(z.fantail_logs&&z.fantail_logs.length>0){var ja={};for(var ka=0;ka<z.fantail_logs.length;ka++)l(ja,z.fantail_logs[ka]);ia.send(ja);z.fantail_logs=[];}else ia.send();z.inStreaming=z.streamingCapable;return ia;}function v(z){this.manager=z;(this.init&&this.init());}function w(z){v.apply(this,arguments);}l(w.prototype,{logName:'CORS',enterState:function(z,aa){if(this._request){this._request.abort();this._request=null;}if(z=='init')n(m(this.manager,'exitState',{status:h.OK,stateId:aa.stateId}),3000);if(!/pull|ping/.test(z))return;var ba=this.manager;if(z=='ping'){this._request=s(aa,m(ba,'exitState',{status:h.OK,stateId:aa.stateId}),m(ba,'exitState',{status:h.ERROR,stateId:aa.stateId}));}else if(z=='pull')this._request=u(aa,m(ba,'_processTransportData',aa.stateId),m(ba,'exitState',{status:h.OK,stateId:aa.stateId}),m(ba,'exitState',{status:h.ERROR,stateId:aa.stateId}));}});function x(z){o.log('iframe_init_constructor');v.apply(this,arguments);this._iframe=document.createElement('iframe');this._iframe.style.display='none';document.body.appendChild(this._iframe);i.publish(this,'outerTransport');}l(x.prototype,{logName:'iframe',_initIframe:function(z){o.log('iframe_init_start');window.onchanneliframeready=function(){o.log('iframe_resources');return z.resources;};window.onchanneliframeloaded=function(){o.log('iframe_loaded');};if(z){this._iframeURI=q(z,z.path);if(z.resources){var aa=this._iframeURI.getDomain();z.resources=z.resources.map(function(da){var ea=k(da);if(ea.getPath().startsWith('/intern/rsrc.php')&&ea.getQueryData().origin!==(void 0))return ea.addQueryData('origin',aa).toString();return da;});}if(z.bustIframe){var ba={partition:z.partition,cb:p()};this._iframeURI.setQueryData(ba);}}else this._iframeURI='about:blank';this._iframeProxy=null;try{this._iframe.contentWindow.location.replace(this._iframeURI);o.log('iframe_uri_set');}catch(ca){o.error('iframe_uri_set_error',ca);this.exitState({status:h.ERROR,stateId:z.stateId},ca+'');}},enterState:function(z,aa){if(z=='init'){this._initIframe(aa);}else if(/idle|ping|pull/.test(z)){if(this._iframeProxy){this._iframeProxy.enterState.apply(this._iframeProxy,arguments);}else if(z!='idle')this.exitState({status:h.ERROR,stateId:aa.stateId},'iframe not yet loaded');}else if(z=='shutdown')this._initIframe();},_processTransportData:function(){this.manager._processTransportData.apply(this.manager,arguments);},exitState:function(z){if(this.manager.state=='init'&&z.status==h.OK)this._iframeProxy=i.proxy(this._iframe.contentWindow,'innerTransport',['enterState'],(this._iframeURI+'').replace(/iframe.*/,''));if(/ping|pull/.test(this.manager.state)&&!this._iframeProxy)return;this.manager.exitState.apply(this.manager,arguments);}});function y(){this.init=this.init.bind(this);v.apply(this,arguments);}l(y.prototype,{logName:'iframe(inner)',init:function(){i.publish(this,'innerTransport');try{var aa=i.proxy(window.parent,'outerTransport',['_processTransportData','exitState'],top.DocRPC.origin);l(this,aa);this.exitState({status:h.OK,stateId:1e+06});}catch(z){o.error('iframe_inner_init_error',z);}},enterState:function(z,aa){if(this._request){this._request.abort();this._request=null;}if(z=='ping'){this._request=s(aa,m(this,'exitState',{status:h.OK,stateId:aa.stateId}),m(this,'exitState',{status:h.ERROR,stateId:aa.stateId}));}else if(z=='pull')this._request=u(aa,m(this,'_processTransportData',aa.stateId),m(this,'exitState',{status:h.OK,stateId:aa.stateId}),m(this,'exitState',{status:h.ERROR,stateId:aa.stateId}));}});e.exports={getURI:q,Transport:v,CORSTransport:w,IframeTransport:x,IframeInnerTransport:y,sendActivePing:t};},null);
__d("PresencePrivacy",["Arbiter","AsyncRequest","ChannelConstants","CurrentUser","PresencePrivacyInitialData","JSLogger","PresenceUtil","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o='/ajax/chat/privacy/settings.php',p='/ajax/chat/privacy/online_policy.php',q='/ajax/chat/privacy/visibility.php',r='friend_visibility',s='visibility',t='online_policy',u=n({},k.privacyData),v=k.visibility,w=n({},k.privacyData),x=v,y=k.onlinePolicy,z=y,aa=[],ba=false;function ca(){return l.create('blackbird');}var da=n(new g(),{WHITELISTED:1,BLACKLISTED:-1,UNLISTED:0,ONLINE:1,OFFLINE:0,ONLINE_TO_WHITELIST:0,ONLINE_TO_BLACKLIST:1});function ea(qa){var ra;for(ra in qa){var sa=qa[ra];if(ra==j.getID()){ca().error('set_viewer_visibility');throw new Error("Invalid to set current user's visibility");}switch(sa){case da.WHITELISTED:case da.BLACKLISTED:case da.UNLISTED:break;default:ca().error('set_invalid_friend_visibility',{id:ra,value:sa});throw new Error("Invalid state: "+sa);}}for(ra in qa)u[ra]=qa[ra];da.inform('privacy-changed');}function fa(qa,ra){var sa={};sa[qa]=ra;ea(sa);}function ga(qa){switch(qa){case da.ONLINE:case da.OFFLINE:break;default:ca().error('set_invalid_visibility',{value:qa});throw new Error("Invalid visibility: "+qa);}v=qa;da.inform('privacy-changed');da.inform('privacy-user-presence-changed');g.inform('chat/visibility-changed',{sender:this});}function ha(qa){switch(qa){case da.ONLINE_TO_WHITELIST:case da.ONLINE_TO_BLACKLIST:break;default:throw new Error("Invalid default online policy: "+qa);}y=qa;da.inform('privacy-user-presence-changed');da.inform('privacy-changed');}function ia(qa,ra){ba=true;qa.send();}function ja(qa,ra){aa.push({request:qa,data:ra});if(!ba){var sa=aa.shift();ia(sa.request,sa.data);}}function ka(qa,ra){var sa=qa.type;if(sa===r){var ta=ra.payload.user_availabilities;if(!Array.isArray(ta)){da.inform('privacy-availability-changed',{user_availabilities:ta});for(var ua in qa.settings)w[ua]=qa.settings[ua];}}else{if(sa===s){x=qa.visibility;}else if(sa===t)z=qa.online_policy;da.inform('privacy-user-presence-response');}ca().log('set_update_response',{data:qa,response:ra});}function la(qa,ra){if(v!==x)ga(x);if(y!==z)ha(z);n(u,w);da.inform('privacy-changed');aa=[];ca().log('set_error_response',{data:qa,response:ra});}function ma(qa){ba=false;if(aa.length>0){var ra=aa.shift();ia(ra.request,ra.data);}}function na(qa,ra){if(m!=null){var sa=qa.getData();sa.window_id=m.getSessionID();qa.setData(sa);}qa.setHandler(ka.bind(this,ra)).setErrorHandler(la.bind(this,ra)).setTransportErrorHandler(la.bind(this,ra)).setFinallyHandler(ma.bind(this)).setAllowCrossPageTransition(true);return qa;}function oa(qa,ra,sa){return na(new h(qa).setData(ra),sa);}function pa(qa,ra){var sa=ra.obj;if(sa.viewer_id!=j.getID()){ca().error('invalid_viewer_for_channel_message',{type:qa,data:ra});throw new Error("Viewer got from the channel is not the real viewer");}if(sa.window_id===m.getSessionID())return;var ta=sa.data;if(sa.event=='access_control_entry'){ta.target_ids.forEach(function(va){fa(va,ta.setting);w[va]=ta.setting;});}else{if(sa.event=='visibility_update'){var ua=!!ta.visibility?da.ONLINE:da.OFFLINE;ga(ua);x=ua;}else if(sa.event=='online_policy_update'){ha(ta.online_policy);z=ta.online_policy;}da.inform('privacy-user-presence-response');}ca().log('channel_message_received',{data:ra.obj});}n(da,{WHITELISTED:1,BLACKLISTED:-1,UNLISTED:0,ONLINE:1,OFFLINE:0,ONLINE_TO_WHITELIST:0,ONLINE_TO_BLACKLIST:1,init:function(qa,ra,sa){},setVisibility:function(qa){x=v;ga(qa);var ra={visibility:qa},sa={type:s,visibility:qa},ta=oa(q,ra,sa);ja(ta,sa);ca().log('set_visibility',{data:ra});return qa;},getVisibility:function(){return v;},setOnlinePolicy:function(qa){z=y;ha(qa);var ra={online_policy:qa},sa={type:t,online_policy:qa},ta=oa(p,ra,sa);ja(ta,sa);ca().log('set_online_policy',{data:ra});return qa;},getOnlinePolicy:function(){return y;},getFriendVisibility:function(qa){return u[qa]||da.UNLISTED;},isUserOffline:function(){return this.getVisibility()===da.OFFLINE;},allows:function(qa){if(this.isUserOffline())return false;var ra=this.getOnlinePolicy();return ra===da.ONLINE_TO_WHITELIST?u[qa]==da.WHITELISTED:u[qa]!=da.BLACKLISTED;},setFriendsVisibility:function(qa,ra){if(qa.length>0){var sa={};for(var ta=0;ta<qa.length;ta++){var ua=qa[ta];w[ua]=u[ua];sa[ua]=ra;}ea(sa);var va=ra;if(va==da.UNLISTED)va=w[qa[0]];var wa={users:qa,setting:ra,setting_type:va},xa={type:r,settings:sa},ya=oa(o,wa,xa);ja(ya,xa);ca().log('set_friend_visibility',{data:wa});}return ra;},setFriendVisibilityMap:function(qa,ra){for(var sa in qa)w[sa]=u[sa];ea(qa);var ta={type:r,settings:qa};ja(na(ra,ta),ta);ca().log('set_friend_visibility_from_map',{data:qa});},allow:function(qa){if(this.allows(qa)){ca().error('allow_already_allowed');throw new Error("allow() should only be called for users that "+"are not already allowed");}if(this.getVisibility()===da.OFFLINE){ca().error('allow_called_while_offline');throw new Error("allow() should only be called when the user is already online");}var ra=this.getOnlinePolicy()===da.ONLINE_TO_WHITELIST?da.WHITELISTED:da.UNLISTED;return this.setFriendsVisibility([qa],ra);},disallow:function(qa){if(!this.allows(qa)){ca().error('disallow_already_disallowed');throw new Error("disallow() should only be called for users that "+"are not already disallowed");}if(this.getVisibility()===da.OFFLINE){ca().error('disallow_called_while_offline');throw new Error("disallow() should only be called when the user is already online");}var ra=this.getOnlinePolicy()===da.ONLINE_TO_BLACKLIST?da.BLACKLISTED:da.UNLISTED;return this.setFriendsVisibility([qa],ra);},getBlacklist:function(){var qa=[];for(var ra in u)if(u[ra]===da.BLACKLISTED)qa.push(ra);return qa;},getWhitelist:function(){var qa=[];for(var ra in u)if(u[ra]===da.WHITELISTED)qa.push(ra);return qa;},getMapForTest:function(){return u;},setMapForTest:function(qa){u=qa;}});da.inform('privacy-changed');da.inform('privacy-user-presence-changed',g.BEHAVIOR_STATE);ca().log('initialized',{visibility:v,policy:y});g.subscribe(l.DUMP_EVENT,function(qa,ra){ra.presence_privacy={initial:k.privacyData,current:u};});g.subscribe(i.getArbiterType('privacy_changed'),pa.bind(this));g.subscribe(i.ON_CONFIG,function(qa,ra){var sa=ra.getConfig('visibility',null);if(sa!==null&&typeof(sa)!=='undefined'){var ta=sa?da.ONLINE:da.OFFLINE;ga(ta);ca().log('config_visibility',{vis:ta});}}.bind(this));a.PresencePrivacy=e.exports=da;},3);
__d("ChatVisibility",["Arbiter","JSLogger","PresencePrivacy"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j={isOnline:function(){return i.getVisibility()===i.ONLINE;},hasBlackbirdEnabled:function(){return this.isVisibleToMostFriends()||this.isVisibleToSomeFriends();},isVisibleToMostFriends:function(){return i.getOnlinePolicy()===i.ONLINE_TO_BLACKLIST&&i.getBlacklist().length>0;},isVisibleToSomeFriends:function(){return i.getOnlinePolicy()===i.ONLINE_TO_WHITELIST&&i.getWhitelist().length>0;},goOnline:function(k){if(i.getVisibility()===i.OFFLINE){h.create('blackbird').log('chat_go_online');i.setVisibility(i.ONLINE);g.inform('chat-visibility/go-online');}k&&k();},goOffline:function(k){if(i.getVisibility()===i.ONLINE){h.create('blackbird').log('chat_go_offline');i.setVisibility(i.OFFLINE);g.inform('chat-visibility/go-offline');}k&&k();},toggleVisibility:function(){if(j.isOnline()){j.goOffline();}else j.goOnline();}};e.exports=j;},null);
__d("MovingStat",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();function g(h){h=h||60000;var i={t:new Date(),count:0,v:0},j=i,k=0,l=0;function m(){var n=new Date()-h;while(j&&j.next&&j.t<n){k-=j.v;l-=j.count;j=j.next;}}this.add=function(n){k+=n;l++;var o=new Date();if(o-i.t<1000){i.v+=n;i.count++;}else{i.next={t:o,v:n,count:1};i=i.next;m();}};this.tally=function(n){n=n||1000;m();return {sum:k,count:l,timeAverage:k*n/h};};}e.exports=g;},null);
__d("Dcode",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();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 k=[];for(var l in i){h[i[l]]=l;k.push(i[l]);}k.reverse();g=new RegExp(k.join("|"),'g');})();var j={encode:function(k){return encodeURIComponent(k).replace(/([_A-Z])|%../g,function(l,m){return m?'%'+m.charCodeAt(0).toString(16):l;}).toLowerCase().replace(g,function(l){return h[l];});},decode:function(k){return decodeURIComponent(k.replace(/[_A-Z]/g,function(l){return i[l];}));}};e.exports=j;},null);
__d("PresenceCookieManager",["Cookie","CurrentUser","Dcode","ErrorUtils","JSLogger","PresenceInitialData","PresenceUtil","URI"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o=l.cookieVersion,p=l.dictEncode,q='presence',r={},s=null,t=null,u=k.create('presence_cookie');function v(){try{var z=g.get(q);if(s!==z){s=z;t=null;if(z&&z.charAt(0)=='E')z=i.decode(z.substring(1));if(z)t=JSON.parse(z);}if(t&&(!t.user||t.user===h.getID()))return t;}catch(y){u.warn('getcookie_error',y);}return null;}function w(){return parseInt(Date.now()/1000,10);}var x={register:function(y,z){r[y]=z;},store:function(){var y=v();if(y&&y.v&&o<y.v){u.debug('stale_cookie',o);return;}var z={v:o,time:w(),user:h.getID()};for(var aa in r)z[aa]=j.applyWithGuard(r[aa],r,[y&&y[aa]],function(ea){ea.presence_subcookie=aa;});var ba=JSON.stringify(z);if(p)ba='E'+i.encode(ba);if(m.hasUserCookie()){var ca=ba.length;if(ca>1024)u.warn('big_cookie',ca);var da=n.getRequestURI(false).isSecure()&&!!g.get('csm');g.set(q,ba,null,null,da);}},clear:function(){g.clear(q);},getSubCookie:function(y){var z=v();if(!z)return null;return z[y];}};e.exports=x;},null);
__d("PresenceState",["Arbiter","ErrorUtils","JSLogger","PresenceCookieManager","copyProperties","debounceAcrossTransitions","setIntervalAcrossTransitions","PresenceInitialData"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o=n.cookiePollInterval||2000,p=[],q=[],r=null,s=null,t=0,u=null,v=0,w=['sb2','t2','lm2','uct2','tr','tw','at','wml'],x=i.create('presence_state');function y(){return j.getSubCookie('state');}function z(){t=Date.now();j.store();da(s);}var aa=l(z,0);function ba(ia){if(typeof ia=='undefined'||isNaN(ia)||ia==Number.POSITIVE_INFINITY||ia==Number.NEGATIVE_INFINITY)ia=0;return ia;}function ca(ia){var ja={};if(ia){w.forEach(function(ma){ja[ma]=ia[ma];});if(t<ia.ut)x.error('new_cookie',{cookie_time:ia.ut,local_time:t});}ja.ut=t;for(var ka=0,la=p.length;ka<la;ka++)h.applyWithGuard(p[ka],null,[ja]);s=ja;return s;}function da(ia){v++;t=ba(ia.ut);if(!r)r=m(ga,o);s=ia;if(u===null)u=ia;for(var ja=0,ka=q.length;ja<ka;ja++)h.applyWithGuard(q[ja],null,[ia]);v--;}function ea(ia){if(ia&&ia.ut)if(t<ia.ut){return true;}else if(ia.ut<t)x.error('old_cookie',{cookie_time:ia.ut,local_time:t});return false;}function fa(){var ia=y();if(ea(ia))s=ia;return s;}function ga(){var ia=y();if(ea(ia))da(ia);}j.register('state',ca);g.subscribe(i.DUMP_EVENT,function(ia,ja){ja.presence_state={initial:k({},u),state:k({},s),update_time:t,sync_paused:v,poll_time:o};});(function(){var ia=fa();if(ia){da(ia);}else{x.debug('no_cookie_initial');da(ca());return;}})();var ha={doSync:function(ia){if(v)return;if(ia){z();}else aa();},registerStateStorer:function(ia){p.push(ia);},registerStateLoader:function(ia){q.push(ia);},get:function(){return fa();},getInitial:function(){return u;},verifyNumber:ba};e.exports=ha;},null);
__d("VideoCallSupport",["ChannelConstants","ChatVisibility","RTCConfig","UserAgent"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k={isSendWebrtcSupported:function(){return i.SendNewVCGK;},isReceiveWebrtcSupported:function(){return i.ReceiveNewVCGK;},isVideoInteropSupported:function(){return i.VideoInteropGK;},isVideoCallSupported:function(){return k.isSendWebrtcSupported();},isWebrtcSupported:function(){return (j.isBrowser('Chrome >= 28')||j.isBrowser('Firefox >= 25')||j.isBrowser('Opera >= 20'));},getCapabilities:function(){var l=0;if(this.isReceiveWebrtcSupported()&&h.isOnline())l=g.CAPABILITY_VOIP_INTEROP;return l;}};e.exports=k;},null);
__d("RTISession",["URI","AjaxRequest","copyProperties","invariant","ErrorUtils"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l='.facebook.com';function m(n,o,p,q,r,s,t,u,v){j(n);j(q);j(r);this.domain=n;this.port=o;this.edgePoolName=p;this.stickyToken=q;this.loggedInId=r;this.accountId=s;this.clientProfile=t||'desktop';this.clientId=u;this.capabilities=v;}m.prototype.issueRequest=function(n,o,p,q,r){j(n);j(o);j(q);var s=this.domain.length-l.length,t=s>0&&this.domain.indexOf(l,s)!==-1,u=t?this.domain:this.domain+l,v=(1048576*Math.random()|0).toString(36),w={cb:v,sticky_token:this.stickyToken,uid:this.loggedInId,viewer_uid:this.accountId,sticky_pool:this.edgePoolName,profile:this.clientProfile,clientid:this.clientId,cap:this.capabilities};for(var x in w)j(!o[x]);i(w,o);var y=new g(n).setDomain(u).setPort(this.port).setSecure(g().isSecure()).setQueryData(w),z=p?'POST':'GET',aa=new h(z,y);aa.timeout=r?r*1000:30000;if(aa.xhr)aa.xhr.withCredentials=true;var ba={};aa.onSuccess=function(){};aa.onJSON=(function(){ba.data=aa.json;ba.error=null;k.applyWithGuard(q,this,[ba]);}).bind(this);aa.onError=(function(){ba.data=null;ba.error=aa.errorType||'error';k.applyWithGuard(q,this,[ba]);}).bind(this);aa.send(JSON.stringify(p));};e.exports=m;},null);
__d("ChannelManager",["AjaxRequest","Arbiter","AsyncRequest","ChannelConstants","ChannelInitialData","ChannelSubdomain","ChannelTransport","ChatVisibility","DTSG","Env","FBAjaxRequest","ISB","JSLogger","MessagingRealtimeConstants","MovingStat","PresenceCookieManager","PresenceState","PresenceUtil","SystemEvents","URI","UserActivity","VideoCallSupport","RTISession","copyProperties","createArrayFromMixed","setIntervalAcrossTransitions","setTimeoutAcrossTransitions","WebStorage"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga){b.__markCompiled&&b.__markCompiled();var ha=b('WebStorage').getSessionStorage(),ia='chproxy_base_sess',ja,ka=s.create('channel'),la=null;function ma(ya){la=ya;}var na={idle:{ok:'init!'},init:{ok:'pull!',error:'reconnect',sys_online:'init',sys_timetravel:'init'},pull:{ok:'pull!',error:'ping',error_missing:'pull',error_msg_type:'pull',refresh_0:'reconnect',refresh_110:'reconnect',refresh_111:'reconnect',refresh_112:'pull',refresh_113:'pull',refresh_117:'reconnect'},ping:{ok:'pull!',error:'ping',error_stale:'reconnect!'},reconnect:{ok:'init!',error:'reconnect',sys_online:'reconnect',sys_timetravel:'reconnect'},shutdown:{},_all:{error_max:'shutdown!',error_shutdown:'shutdown!',sys_owner:'reconnect',sys_nonowner:'idle!',sys_online:'ping',sys_offline:'idle!',sys_timetravel:'ping'}},oa={reconnectOverrideTimeMillis:Date.now(),userActive:Date.now(),lastPresenceState:null,lastRequestErrorReason:null,estimatedReceived:0,fantail_logs:[],sessionID:(Math.random()*2147483648|0).toString(16),capabilities:ba.getCapabilities(),streamingCapable:false,inStreaming:false,LONGPOLL_TIMEOUT:60000,STREAMING_TIMEOUT:60000,P_TIMEOUT:30000,IFRAME_LOAD_TIMEOUT:30000,MIN_RETRY_INTERVAL:5000,MAX_RETRY_INTERVAL:320000,MIN_12002_TIMEOUT:9000,MIN_504_TIMEOUT:20000,STALL_THRESHOLD:180000,JUMPSTART_THRESHOLD:90000,MIN_INIT_PROBE_DELAY:3000,INIT_PROBE_DELAY_RANDOMIZE_RANGE:12000,CHANNEL_PROXY_REPORTING_MIN_INTERVAL:10000,PROBE_DELAY:60000,PROBE_HEARTBEATS_INTERVAL_LOW:1000,PROBE_HEARTBEATS_INTERVAL_HIGH:5000,STREAMING_EXIT_STATE_ON_CONTINUE:false,FANTAIL_QUEUE_CAPACITY:50},pa={MAX_CONTINUOUS_PULL_FAILS:3,enabled:false,uptimeMillis:Date.now(),timeInGoodStatesStartMillis:Date.now(),timeInGoodStatesMillis:0,initialized:false,firstPullSentTimeMillis:Date.now(),accumulatedPullTimeMillis:0,pullStartTimeMillis:0,pingCount:0,pullCount:0,continuousPullFails:0,getTimeSinceFirstPullSentSeconds:function(){return (Date.now()-this.firstPullSentTimeMillis)/1000;},getUptimeSeconds:function(){return (Date.now()-this.uptimeMillis)/1000;},getAccumulatedPullTimeSeconds:function(){var ya=this.accumulatedPullTimeMillis,za=Date.now();if(this.pullStartTimeMillis>0&&za-this.pullStartTimeMillis<=oa.LONGPOLL_TIMEOUT)ya+=(za-this.pullStartTimeMillis);var ab=ya/1000;if(ab>=this.getTimeSinceFirstPullSentSeconds())this.initialize();return ab;},getPingToPullRatio:function(){return this.pullCount===0?0:this.pingCount/this.pullCount;},reportPullSent:function(){if(!this.enabled)return;if(!this.initialized)this.initialize();this.pullStartTimeMillis=Date.now();},initialize:function(){this.initialized=true;this.firstPullSentTimeMillis=Date.now();this.pullStartTimeMillis=0;this.accumulatedPullTimeMillis=0;this.pingCount=0;this.pullCount=0;this.timeInGoodStatesStartMillis=Date.now();this.timeInGoodStatesMillis=0;this.uptimeMillis=Date.now();},reportPullReturned:function(ya,za){if(!this.enabled)return;if(this.pullStartTimeMillis>0){this.accumulatedPullTimeMillis+=(Date.now()-this.pullStartTimeMillis);if(ya){this.pullCount++;this.continuousPullFails=0;}else this.continuousPullFails++;}this.pullStartTimeMillis=0;},reportPingSent:function(){if(!this.enabled)return;this.pingCount++;},isGoodState:function(ya){return ya.indexOf('pull')===0||ya.indexOf('init')===0||ya.indexOf('idle')===0;},getTotalTimeInGoodStatesSeconds:function(){var ya=this.timeInGoodStatesMillis;if(this.timeInGoodStatesStartMillis>0)ya+=(Date.now()-this.timeInGoodStatesStartMillis);return ya/1000;},clientEnteredState:function(ya){if(!this.enabled)return;var za=this.isGoodState(ya);if(za&&this.timeInGoodStatesStartMillis===0){this.timeInGoodStatesStartMillis=Date.now();}else if(!za&&this.timeInGoodStatesStartMillis>0){this.timeInGoodStatesMillis=Date.now()-this.timeInGoodStatesStartMillis;this.timeInGoodStatesStartMillis=0;}},transportEnteredState:function(ya){if(!this.enabled)return;if(ya.indexOf('pull')===0){this.reportPullSent();}else if(ya.indexOf('ping')===0&&oa.lastRequestErrorReason!==j.SYS_TIMETRAVEL&&oa.lastRequestErrorReason!==j.SYS_ONLINE&&oa.lastRequestErrorReason!==j.SYS_OWNER&&oa.lastRequestErrorReason!==j.SYS_NONOWNER)this.reportPingSent();},doSerialize:function(){if(!this.enabled)return "";return (this.getTimeSinceFirstPullSentSeconds()).toFixed(0)+','+(this.getAccumulatedPullTimeSeconds()).toFixed(0)+','+(this.getPingToPullRatio()).toFixed(3)+','+(this.getUptimeSeconds()).toFixed(0)+','+(this.getTotalTimeInGoodStatesSeconds()).toFixed(0);}},qa=1,ra={},sa=0;function ta(){return i.lastSuccessTime?Math.round((Date.now()-i.lastSuccessTime)/1000):-1;}function ua(){var ya={};if(ja.getConfig('host'))ya[ja.getConfig('user_channel')]=ja.getConfig('seq',0);return ya;}function va(){var ya=Date.now(),za=Date.now(),ab={total:0},bb='idle',cb=false;y.subscribe([y.USER,y.ONLINE,y.TIME_TRAVEL],function(fb,gb){xa(true);za=null;ja.lastPullTime=Date.now();var hb;switch(fb){case y.USER:hb=y.isPageOwner()?j.SYS_OWNER:j.SYS_NONOWNER;break;case y.ONLINE:hb=gb?j.SYS_ONLINE:j.SYS_OFFLINE;break;case y.TIME_TRAVEL:hb=j.SYS_TIMETRAVEL;break;}ja.exitState({status:hb,stateId:qa});});var db=function(fb,gb){var hb=Date.now(),ib;if(gb){ya=hb;ib=gb.nextState||gb.state;}else ib=bb;y.checkTimeTravel();if(za){var jb=Math.round((hb-za)/1000);if(jb>0){ab[bb]=(ab[bb]||0)+jb;ab.total+=jb;}}bb=ib;za=hb;if(!fb){ab.lastSuccessTime=ta();ab.online=y.isOnline();ka.log('rollup',ab);}};h.subscribe(j.ON_ENTER_STATE,db);fa(db,60000);h.subscribe(s.DUMP_EVENT,function(fb,gb){gb.channelRollup=ab;});var eb=function(){if(ja.isShutdown()||ja.shouldIdle())return;y.checkTimeTravel();var fb=Date.now()-(ja.lastPullTime||p.start);if(!cb&&fb>oa.STALL_THRESHOLD){var gb=ta();ka.error('stall',{lastSuccessTime:gb,rollupState:bb});cb=true;}var hb=Date.now()-ya;if(ja.state=='pull'&&hb>oa.JUMPSTART_THRESHOLD){ya=null;ka.warn('jumpstart',{state:ja.state,dormant:hb});ja.enterState('init');}};fa(eb,10000);}function wa(){var ya=Date.now(),za=1;function ab(){ga(ab,za*1000);var fb=ja.state;if(fb=='idle'&&ja.shouldIdle())return;ka.bump('conn_t',za);if(fb=='pull')ka.bump('conn_t_pull',za);}ab();var bb=[15,30,60,120,240],cb=false,db=false;function eb(fb){ga(function(){ka.rate('pullenter_'+fb,cb);ka.rate('pullexit_'+fb,db);},fb*1000);}while(bb.length)eb(bb.shift());h.subscribe(j.ON_ENTER_STATE,function(fb,gb){if(gb.state=='pull')cb=true;ya=Date.now();});h.subscribe(j.ON_EXIT_STATE,function(fb,gb){if(gb.state!='pull'||!ya)return;var hb='other';if(gb.status==j.OK){db=true;hb='ok';}else if(gb.xhr&&gb.xhr.errorType){hb=/ar:(\w+)/.test(gb.xhr.errorType)&&RegExp.$1;}else if(/^sys_/.test(gb.status))return;var ib=(Date.now()-ya)/1000;if(ib<0){return;}else if(ib>3600)ib=3600;ka.bump('conn_num');ka.bump('conn_exit',ib);ka.bump('conn_num_'+hb);ka.bump('conn_exit_'+hb,ib);});}function xa(ya){if(ya){sa=0;ra={};}else sa++;}ja={state:'idle',nextState:null,proxyDown:false,lastPullTime:Date.now(),lastReportOnMisguidedMsgTime:Date.now(),heartbeats:[],setTestCallback:ma,backoff:false,init:function(ya){this.init=function(){};this._logFantail('client initialized',j.FANTAIL_INFO);var za=!!oa.use_sticky_session,ab=null;if(za&&ha){for(var bb=0;bb<ha.length;bb++){var cb=ha.key(bb);if(cb.indexOf(ia)===0){ab=ha.getItem(cb);break;}}if(!ab){ab=oa.sessionID;ha.setItem(ia,ab);}}pa.enabled=!!oa.watchdog_enabled;oa.watchdog=pa;if(typeof(aa)!='undefined'){aa.subscribe(function(){oa.userActive=Date.now();m.sendActivePing(oa);}.bind(this));}else ka.error('user_activity_undefined');v.register('ch',ua);var db=this.getConfig('max_conn',2);oa.subdomain=l.allocate(db);if(ab&&ab.length&&ab.trim())oa.sessionID=ab;this._logFantail('using session id: '+oa.sessionID,j.FANTAIL_INFO);this._transportRate=new u(30000);var eb=(g.supportsCORS()&&!oa.forceIframe)?'CORSTransport':'IframeTransport';this.transport=new m[eb](this);if(ya)this.enterState.apply(this,arguments);h.subscribe(s.DUMP_EVENT,function(event,gb){gb.transportRate=this._transportRate.tally();gb.transportType=eb;gb.transportVersion=2;}.bind(this));va();wa();if(ja.getConfig('tryStreaming')&&ja.getConfig('host')&&g.supportsCORS()&&!oa.forceIframe){var fb=oa.MIN_INIT_PROBE_DELAY+Math.random()*oa.INIT_PROBE_DELAY_RANDOMIZE_RANGE;ga(this._probeTest,fb);}},configure:function(){var ya=ea(arguments);ka.log('configure',ya);ya.forEach(da.bind(null,oa));h.inform(j.ON_CONFIG,this);},getConfig:function(ya,za){return ya in oa?oa[ya]:za;},getCompleteConfig:function(){return oa;},getWatchdog:function(){return pa;},isShutdown:function(){return this.state=='shutdown';},shouldIdle:function(){return !(y.isPageOwner()&&y.isOnline());},_sendIframeError:function(ya){var za=new i().setURI('/ajax/presence/reconnect.php').setData({reason:ya,fb_dtsg:o.getToken()}).setOption('suppressErrorHandlerWarning',true).setOption('retries',1).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true);za.specifiesWriteRequiredParams()&&za.send();},_getDelay:function(){var ya=Math.min(oa.MIN_RETRY_INTERVAL*Math.pow(2,Math.max(0,sa-1)),oa.MAX_RETRY_INTERVAL);if(this.proxyDown&&'proxy_down_delay_millis' in oa)ya=oa.proxy_down_delay_millis;this.proxyDown=false;return Math.floor(ya*(1+Math.random()*.5));},enterState:function(){if(this._inEnterState)ka.warn('enterstate_recursion');this._inEnterState=true;try{this._enterState.apply(this,arguments);this._inEnterState=false;}catch(ya){this._inEnterState=false;throw ya;}},_enterState:function(ya){if((ya.indexOf('pull')===0||ya.indexOf('ping')===0||ya.indexOf('shutdown')===0)&&!!oa.active_config_refresh){var za=Date.now(),ab=(za-oa.reconnectOverrideTimeMillis)/1000;if('config_refresh_seconds' in oa&&oa.config_refresh_seconds>0&&ab>oa.config_refresh_seconds){ya='reconnect';this._logFantail('forcing reconnect to refresh config'+' - this is normal behavior',j.FANTAIL_DEBUG);}}if(ya.indexOf('reconnect')===0)oa.reconnectOverrideTimeMillis=Date.now();var bb=this.backoff?this._getDelay():0;this.backoff=false;var cb=ea(arguments);if(this.isShutdown()){this._logFantail('not executing state due to shutdown mode: '+ya,j.FANTAIL_WARN);return;}if(ya!='idle!'&&this.shouldIdle()){this._logFantail('forced idleness',j.FANTAIL_WARN);return;}qa++;oa.stateId=qa;clearTimeout(this._deferredTransition);this._deferredTransition=null;this.transport.enterState('idle');this.state='idle';this.nextState=null;if(/!$/.test(ya)){var db=this._transportRate.tally().timeAverage,eb=ja.getConfig('MAX_CHANNEL_STATES_PER_SEC',1);if(db>=eb){if(!this._throttled){this._throttled=true;ka.warn('throttled');}ka.bump('throttle');bb=1000/eb;}}else if(!(/#$/.test(ya)))bb=this._getDelay();ya=ya.replace(/\W*$/,'');if(!na[ya]){this._logFantail('invalid state: '+ya,j.FANTAIL_ERROR);throw new Error('invalid state:'+ya);}var fb;if(bb<=0){fb={state:ya};this._transportRate.add(1);this.state=ya;var gb=this['_enter_'+this.state];if(gb){cb.shift();gb.apply(this,cb);}if(/init|idle|pull|ping/.test(this.state)){if(oa.streamingCapable&&/pull/.test(this.state))this.heartbeats=[];pa.transportEnteredState(ya);pa.clientEnteredState(ya);oa.is_offline=!n.isOnline();oa.capabilities=ba.getCapabilities();this._logFantail('entering transport state: '+this.state,j.FANTAIL_INFO);this.transport.enterState(this.state,oa);if(this.state=='ping'){fb.url=m.getURI(oa).toString();fb.port=oa.port||'undefined';}}}else{this.state='idle';this.nextState=ya;fb={state:this.state,delay:bb,nextState:ya};cb[0]=ya+'#';this._deferredTransition=ga((function(){this._deferredTransition=null;this.enterState.apply(this,cb);}).bind(this),bb);}if(/pull/.test(ya)){fb.client_id=oa.sessionID;fb.streaming=oa.inStreaming;}ka.log('enter_'+this.state,fb);h.inform(j.ON_ENTER_STATE,fb);},exitState:function(ya,za){var ab=ya.stateId,bb=ya.status;if((bb==j.SYS_TIMETRAVEL||bb==j.SYS_ONLINE||bb==j.SYS_NONOWNER||bb==j.SYS_OWNER)&&pa)pa.initialize();if(this.isShutdown()||ab<qa)return;var cb=ea(arguments),db=this.state;cb[0]=ya.status;var eb={state:db,status:bb};if(/pull/.test(db)){eb.client_id=oa.sessionID;eb.streaming=oa.inStreaming;}if(/ping/.test(db)&&bb!=j.OK)eb.url=m.getURI(oa).toString();if(this.nextState)eb.nextState=this.nextState;if(za&&za.errorType){oa.lastRequestErrorReason=za.errorType;eb.xhr=za.toJSON?za.toJSON():za;if(za.errorType==g.SERVICE_UNAVAILABLE){this._logFantail('got 5xx http status code, setting long delay',j.FANTAIL_ERROR);this.proxyDown=true;}delete eb.xhr.json;}else if(bb!=j.OK)oa.lastRequestErrorReason=bb;if(za&&za.json){if(za.json.t)eb.t=za.json.t;if(za.json.reason)eb.reason=za.json.reason;if(za.json.seq)eb.seq=za.json.seq;}ka.log('exit_'+db,eb);h.inform(j.ON_EXIT_STATE,eb);var fb=this['_exit_'+db];if(fb)bb=fb.apply(this,cb)||bb;if(bb!=j.OK){xa();ra[db]=(ra[db]||0)+1;}var gb=na[this.nextState||db][bb]||na._all[bb],hb=gb&&gb.replace(/!*$/,'');if(!hb){ka.error('terminal_transition',eb);this._shutdownHint=j.HINT_INVALID_STATE;gb='shutdown!';this._logFantail('entering shutdown state',j.FANTAIL_ERROR);}this._lastState=db;this._lastStatus=bb;this.enterState(gb);},_processTransportData:function(ya,za){var ab=za.json,bb=ab.t;if('s' in ab){ab.seq=ab.s;delete ab.s;}if(ab.u&&oa.user&&ab.u!=oa.user){ka.warn('misguided_msg',{user:oa.user,target:ab.u});this._reportProxyMisguidedMsg(ab.u,oa.user);return;}var cb=oa.seq;if('seq' in ab){oa.seq=ab.seq;w.doSync();}switch(bb){case 'continue':if(oa.inStreaming&&this.heartbeats.length<1){oa.streamingCapable=false;ka.log('switch_to_longpoll');ga(this._probeTest,oa.PROBE_DELAY);}xa(true);if(!oa.inStreaming||oa.STREAMING_EXIT_STATE_ON_CONTINUE)this.exitState({status:j.OK,stateId:ya});break;case 'refresh':case 'refreshDelay':this._logFantail('got refresh with reason: '+ab.reason,j.FANTAIL_INFO);this.exitState({status:'refresh_'+(ab.reason||0),stateId:ya},za);break;case 'backoff':this._logFantail('server told client to back off',j.FANTAIL_WARN);xa();this.backoff=true;break;case 'lb':var db=ab.lb_info;oa.estimatedReceived=0;if(db){oa.sticky_token=db.sticky;if('pool' in db){oa.sticky_pool=db.pool;}else oa.host=db.vip;if(g.supportsCORS()&&!oa.forceIframe){var eb=oa.subdomain===null?oa.host:(oa.subdomain+'-'+oa.host),fb=new ca(eb,oa.port,oa.sticky_pool,oa.sticky_token,oa.uid,oa.viewer_uid,oa.profile,oa.sessionID,oa.capabilities);h.inform(j.RTI_SESSION,fb);}}else ka.error('bad lb info');break;case 'test_streaming':ga(this._probeTest,500);break;case 'fullReload':v.clear();ka.log('invalid_history');h.inform(j.ON_INVALID_HISTORY);xa(true);this._logFantail('full reload incurred',j.FANTAIL_INFO);this.exitState({status:j.ERROR_MISSING,stateId:ya},za);break;case 'msg':var gb,hb,ib,jb;xa(true);if('tr' in ab)oa.trace_id=ab.tr;hb=ab.ms;ib=oa.seq-hb.length;for(gb=0;gb<hb.length;gb++,ib++){oa.estimatedReceived++;if(ib>=cb){jb=hb[gb];if(jb.type){var kb=j.getArbiterType(jb.type);if(jb.type==='messaging'){var lb={type:'messaging',event:jb.event};if(jb.message){lb.inbox_unread=jb.unread_counts&&jb.unread_counts.inbox;lb.tid=jb.message.tid;lb.mid=jb.message.mid;this._logFantail('got message with id: '+jb.message.mid,j.FANTAIL_INFO);}ka.debug('message',lb);}else if(jb.type==='m_messaging'){ka.debug('message',{type:'m_messaging',tid:jb.tid,mid:jb.uuid});}else if(jb.type==='pages_messaging'){if(jb.unread_counts&&jb.unread_counts.inbox)h.inform(j.getArbiterType('pages_inbox_count_update'),{page_id:jb[t.VIEWER_FBID],inbox_unread:jb.unread_counts.inbox});}else if(jb.type==='skywalker'){kb=j.SKYWALKER;}else ka.debug('message',{type:jb.type});h.inform(kb,{obj:jb});}}else ka.warn('seq_regression',{seq:ib,last_seq:cb,messages:hb.length});}break;case 'heartbeat':if(oa.inStreaming){var mb=Date.now();if(this.heartbeats.length>0){var nb=mb-this.heartbeats[this.heartbeats.length-1];ka.log('heartbeat_interval',{client_id:oa.sessionID,interval:nb});}this.heartbeats.push(mb);}break;default:this._logFantail('got an unknown protocol message: '+bb,j.FANTAIL_ERROR);ka.error('unknown_msg_type',{type:bb});break;}},_enter_init:function(){if(ra.init>=ja.getConfig('MAX_INIT_FAILS',2))return setTimeout(this.exitState.bind(this,{status:j.ERROR_MAX,stateId:qa}),0);this._initTimer=ga(this.exitState.bind(this,{status:j.ERROR,stateId:qa},'timeout'),oa.IFRAME_LOAD_TIMEOUT);},_enter_reconnect:function(ya){this._logFantail('entered reconnect with reason: '+ya,j.FANTAIL_INFO);var za=qa;if(!x.hasUserCookie()){this._logFantail('user has no cookie???',j.FANTAIL_WARN);ka.warn('no_user_cookie');setTimeout(function(){ja._shutdownHint=j.HINT_AUTH;ja.exitState({status:j.ERROR_SHUTDOWN,stateId:za});},0);return;}var ab={reason:ya,fb_dtsg:o.getToken()};if(r.token)ab.fb_isb=r.token;if(la)la(ab);var bb=new q('GET','/ajax/presence/reconnect.php',ab);bb.onSuccess=(function(){ja.configure(bb.json);v.store();this.exitState({status:j.OK,stateId:za});}).bind(this);bb.onError=(function(){var cb=bb.json&&bb.json.error;this._logFantail('reconnect error: '+bb.errorType,j.FANTAIL_ERROR);if(bb.errorType==g.TRANSPORT_ERROR||bb.errorType==g.PROXY_ERROR||bb.errorType==g.SERVICE_UNAVAILABLE)this._shutdownHint=j.HINT_CONN;if(cb&&cb==1356007){this._shutdownHint=j.HINT_MAINT;}else if(cb==1357001||cb==1357004||cb==1348009){this._shutdownHint=j.HINT_AUTH;}else this._shutdownHint=null;this.exitState({status:this._shutdownHint?j.ERROR_SHUTDOWN:j.ERROR,stateId:za},bb);}).bind(this);bb.send();},_enter_shutdown:function(){h.inform(j.ON_SHUTDOWN,{reason:this._shutdownHint});if(!!oa.shutdown_recovery_enabled&&'shutdown_recovery_interval_seconds' in oa&&oa.shutdown_recovery_interval_seconds>0){var ya=oa.shutdown_recovery_interval_seconds*1000;ga((function(){h.inform(j.ATTEMPT_RECONNECT);this.state='reconnect!';this.enterState('reconnect!');}).bind(this),ya);}},_exit_init:function(ya){if(this._initTimer)this._initTimer=clearTimeout(this._initTimer);if(ya==j.ERROR_MAX)this._sendIframeError(j.reason_IFrameLoadGiveUp);},_exit_pull:function(ya,za){var ab=ya==j.OK;pa.reportPullReturned(ab,this);if(ab){this.lastPullTime=Date.now();}else{var bb="exit status: "+ya;if(za&&za.errorType)bb+=" ajax request error: "+za.errorType;this._logFantail('pull failed with status: '+bb,j.FANTAIL_ERROR);}},_exit_ping:function(ya){if(ya==j.OK){var za=Date.now()-(this.lastPullTime||p.start);if(za>oa.STALL_THRESHOLD){this._logFantail('didnt complete a successful pull for too long',j.FANTAIL_ERROR);return j.ERROR_STALE;}}else this._logFantail('ping failed with status: '+ya,j.FANTAIL_ERROR);},_reportProxyMisguidedMsg:function(ya,za){this._logFantail('misguided message to '+za+' meant for '+ya,j.FANTAIL_ERROR);var ab=Date.now();if(ab-this.lastReportOnMisguidedMsgTime<=oa.CHANNEL_PROXY_REPORTING_MIN_INTERVAL)return;this.lastReportOnMisguidedMsgTime=ab;var bb={received_uid:ya,expected_uid:za};if(oa.sticky_token)bb.sticky_token=oa.sticky_token;var cb=new z('/err_misguided_msg').setDomain(oa.host+'.'+oa.domain).setPort(oa.port).setSecure(z().isSecure()).setQueryData(bb),db=new g('GET',cb);if(g.supportsCORS())db.xhr.withCredentials=true;db.onSuccess=function(eb){};db.onError=function(eb){};db.onJSON=function(eb,fb){};db.send();},_probeTest:function(){oa.streamingCapable=false;var ya=[],za={mode:'stream',format:'json'};if(oa.sticky_token)za.sticky_token=oa.sticky_token;var ab=new z('/probe').setDomain(oa.host+'.'+oa.domain).setPort(oa.port).setSecure(z().isSecure()).setQueryData(za),bb=new g('GET',ab);bb.onJSON=function(cb,db){if(cb&&cb.json&&cb.json.t==='heartbeat'){ya.push(Date.now());if(ya.length>=2){var eb=ya[1]-ya[0];if(eb>=oa.PROBE_HEARTBEATS_INTERVAL_LOW&&eb<=oa.PROBE_HEARTBEATS_INTERVAL_HIGH){oa.streamingCapable=true;ka.log('switch_to_streaming');}ka.log('probe_ok',{time:eb});}}};bb.onSuccess=function(cb){if(ya.length!=2){oa.streamingCapable=false;ka.error('probe_error',{error:'beats.length = '+ya.length});}};bb.onError=function(cb){oa.streamingCapable=false;ka.error('probe_error',cb);};ka.log('probe_request');bb.send();},_logFantail:function(ya,za){var ab=oa.fantail_queue_capacity||oa.FANTAIL_QUEUE_CAPACITY;if(!oa.fantail_enabled||oa.fantail_logs.length>ab)return;var bb='fantail queue size exceeded',cb=j.FANTAIL_WARN;if(oa.fantail_logs.length<ab){bb=ya;cb=za;}var db=oa.fantail_logs.length,eb={};eb['time'+db]=Date.now();eb['log'+db]=bb;eb['severity'+db]=cb;oa.fantail_logs.push(eb);}};e.exports=ja;if(k.channelConfig){ja.configure(k.channelConfig);if(/shutdown/.test(k.state))ja._shutdownHint=j[k.reason];ja.init(k.state,k.reason);}},null);
__d("ChannelConnection",["Arbiter","copyProperties","ChatConfig","Run","SystemEvents","ChannelConstants","ChannelManager","JSLogger","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=n.create('channel_connection'),q=null,r=null,s=null,t=null,u=0,v=h(new g(),{CONNECTED:'chat-connection/connected',RECONNECTING:'chat-connection/reconnecting',SHUTDOWN:'chat-connection/shutdown',MUTE_WARNING:'chat-connection/mute',UNMUTE_WARNING:'chat-connection/unmute'});function w(){if(r){clearTimeout(r);r=null;}}function x(){w();p.log('unmute_warning');v.inform(v.UNMUTE_WARNING);}function y(ba){w();r=o(x,ba);p.log('mute_warning',{time:ba});v.inform(v.MUTE_WARNING);}function z(){if(s){clearTimeout(s);s=null;}}function aa(ba,ca){z();if(ba===l.ON_ENTER_STATE&&(ca.nextState||ca.state)==='pull'){if(t!==v.CONNECTED){p.log('connected');var da=!t;t=v.CONNECTED;u=0;v.inform(v.CONNECTED,{init:da});}}else if(ba===l.ON_ENTER_STATE&&((ca.nextState||ca.state)==='ping'||(!ca.nextState&&ca.state==='idle'))){s=o(function(){var ea=null;if(!(ca.state==='idle'&&!ca.nextState))ea=(ca.delay||0);p.log('reconnecting',{delay:ea});if(v.disconnected())p.log('reconnecting_ui',{delay:ea});t=v.RECONNECTING;(ca.state==='idle')&&u++;if(u>1){v.inform(v.RECONNECTING,ea);}else if(!ca.nextState&&ca.state==='idle')aa(ba,ca);},500);}else if(ba===l.ON_SHUTDOWN){p.log('shutdown',{reason:ca.reason});t=v.SHUTDOWN;u=0;v.inform(v.SHUTDOWN,ca.reason);}}if(m.isShutdown()){aa(l.ON_SHUTDOWN,m._shutdownHint);}else aa(l.ON_ENTER_STATE,{state:m.state,nextState:m.nextState,delay:0});h(v,{disconnected:function(){return t===v.SHUTDOWN||(t===v.RECONNECTING&&!r&&u>1);},isShutdown:function(){return t===v.SHUTDOWN;},reconnect:function(ba){if(m.state==='ping'||m.isShutdown())return;p.log('reconnect',{now:ba});v.inform(v.RECONNECTING,0);if(!!ba){if(q!==null){clearTimeout(q);q=null;}m.enterState('ping!');}else if(!q)q=o(function(){m.enterState('ping!');q=null;},i.get('channel_manual_reconnect_defer_msec'));},unmuteWarning:x});g.subscribe([l.ON_ENTER_STATE,l.ON_SHUTDOWN],aa);g.subscribe(l.ATTEMPT_RECONNECT,function(){if(v.disconnected())v.reconnect();});k.subscribe(k.TIME_TRAVEL,function(){v.reconnect();y(i.get('mute_warning_time_msec'));});j.onBeforeUnload(z,false);e.exports=v;},null);
__d("AvailableListConstants",["fbt"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={ON_AVAILABILITY_CHANGED:'buddylist/availability-changed',ON_UPDATE_ERROR:'buddylist/update-error',ON_UPDATED:'buddylist/updated',ON_CHAT_NOTIFICATION_CHANGED:'chat-notification-changed',OFFLINE:0,IDLE:1,ACTIVE:2,MOBILE:3,WEB_STATUS:'webStatus',FB_APP_STATUS:'fbAppStatus',MESSENGER_STATUS:'messengerStatus',OTHER_STATUS:'otherStatus',ACTIVE_ON_WEB:g._("Web"),ACTIVE_ON_MOBILE:g._("Mobile"),LEGACY_OVERLAY_OFFLINE:-1,LEGACY_OVERLAY_ONLINE:0,LEGACY_OVERLAY_IDLE:1,STATUS_ACTIVE:'active',STATUS_IDLE:'idle',STATUS_OFFLINE:'offline',legacyStatusMap:{'0':2,'1':1,'-1':0,'2':3},reverseLegacyStatusMap:{0:-1,1:1,2:0,3:2}};a.AvailableListConstants=e.exports=h;},null);
__d("LastMobileActiveTimes",["ServerTime","fbt"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i={};function j(n){if(!n||n<0)return '';var o=(g.get()/1000)-n,p=Math.floor(o/60),q=Math.floor(p/60),r=Math.floor(q/24);if(p<=1){return h._("{count}m",[h.param("count",1)]);}else if(p<60){return h._("{count}m",[h.param("count",p)]);}else if(q<24){return h._("{count}h",[h.param("count",q)]);}else if(r<3){return h._("{count}d",[h.param("count",r)]);}else return '';}function k(n,o){if(!(n in i)||i[n]<o)i[n]=o;}function l(n){if(n in i){return i[n];}else return 0;}var m={update:function(n){for(var o in n)k(o,n[o]);},getShortDisplay:function(n){return j(l(n));},get:function(n){return l(n);}};e.exports=m;},null);
__d("ChatContexts",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={};function h(k){var l=k?k.subtext:'';return l;}function i(k,l){g[k]=l;}var j={get:function(k){if(k in g){return g[k];}else return null;},update:function(k){for(var l in k)i(l,k[l]);},getShortDisplay:function(k){return h(j.get(k));}};e.exports=j;},null);
__d("Poller",["ArbiterMixin","AsyncRequest","CurrentUser","copyProperties","emptyFunction","mixin","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();var n=l(g);for(var o in n)if(n.hasOwnProperty(o))q[o]=n[o];var p=n===null?null:n.prototype;q.prototype=Object.create(p);q.prototype.constructor=q;q.__superConstructor__=n;function q(t){"use strict";this._config=j({clearOnQuicklingEvents:true,setupRequest:k,interval:null,maxRequests:Infinity,dontStart:false},t);this._handle=null;if(!this._config.dontStart)this.start();}q.prototype.start=function(){"use strict";if(this._polling)return this;this._requests=0;this.request();return this;};q.prototype.stop=function(){"use strict";this._cancelRequest();return this;};q.prototype.mute=function(){"use strict";this._muted=true;return this;};q.prototype.resume=function(){"use strict";if(this._muted){this._muted=false;if(this._handle===null&&this._polling)return this.request();}return this;};q.prototype.skip=function(){"use strict";this._skip=true;return this;};q.prototype.reset=function(){"use strict";return this.stop().start();};q.prototype.request=function(){"use strict";this._cancelRequest();this._polling=true;if(!s())return this._done();if(this._muted)return this;if(++this._requests>this._config.maxRequests)return this._done();var t=new h();t.setIsBackgroundRequest(true);var u=false;t.setInitialHandler(function(){return !u;});this._cancelRequest=function(){u=true;this._cleanup();}.bind(this);t.setFinallyHandler(r.bind(this));t.setInitialHandler=k;t.setFinallyHandler=k;this._config.setupRequest(t,this);if(this._skip){this._skip=false;setTimeout(r.bind(this),0);}else t.send();return this;};q.prototype.isPolling=function(){"use strict";return this._polling;};q.prototype.isMuted=function(){"use strict";return this._muted;};q.prototype.setInterval=function(t){"use strict";if(t){this._config.interval=t;this.start();}};q.prototype.getInterval=function(){"use strict";return this._config.interval;};q.prototype._cleanup=function(){"use strict";if(this._handle!==null)clearTimeout(this._handle);this._handle=null;this._cancelRequest=k;this._polling=false;};q.prototype._done=function(){"use strict";this._cleanup();this.inform('done',{sender:this});return this;};q.MIN_INTERVAL=2000;j(q.prototype,{_config:null,_requests:0,_muted:false,_polling:false,_skip:false,_cancelRequest:k});function r(){if(!this._polling)return;if(this._requests<this._config.maxRequests){var t=this._config.interval;t=typeof t==='function'?t(this._requests):t;t=(t>q.MIN_INTERVAL)?t:q.MIN_INTERVAL;if(this._config.clearOnQuicklingEvents){this._handle=setTimeout(this.request.bind(this),t);}else this._handle=m(this.request.bind(this),t);}else this._done();}function s(){return i.isLoggedInNow();}e.exports=q;},null);
__d("PresenceStatus",["ArbiterMixin","AvailableListConstants","BanzaiODS","ChatVisibility","CurrentUser","LastMobileActiveTimes","LogHistory","PresencePrivacy","ServerTime","createObjectFrom","debounceAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();i.setEntitySample('presence',.0001);var r=m.getInstance('presence_status'),s={},t={},u={},v={},w={},x={},y={},z=Object.assign({},g),aa=q(function(){return z.inform('change');},0);Object.assign(z,{resetPresenceData:function(){t={};u={};y={};x={};w={};},reset:function(){z.resetPresenceData();v={};},get:function(ba){if(ba==k.getID())return j.isOnline()?h.ACTIVE:h.OFFLINE;var ca=h.OFFLINE;if(ba in t)ca=t[ba];if(ca===h.OFFLINE||ca===h.IDLE)if(v[ba])ca=h.MOBILE;if(!n.allows(ba))ca=h.OFFLINE;return ca;},getCapabilities:function(ba){var ca=z.get(ba);if(ca==h.OFFLINE)return 0;var da=u[ba];return da?da:0;},getDetailedActivePresence:function(ba){var ca=y[ba];if(!ca)return h.ACTIVE_ON_WEB;var da=ca[h.WEB_STATUS],ea=ca[h.FB_APP_STATUS],fa=ca[h.MESSENGER_STATUS],ga=ca[h.OTHER_STATUS];if(ea===h.STATUS_ACTIVE||fa===h.STATUS_ACTIVE){return h.ACTIVE_ON_MOBILE;}else if(da===h.STATUS_ACTIVE||ga===h.STATUS_ACTIVE){return h.ACTIVE_ON_WEB;}else{if(!s[ba]){r.error('inconsistent_presence',{id:ba,presence:z.getDebugInfo(ba)});i.bumpEntityKey('presence','inconsistent_presence');s[ba]=true;}return null;}},isMessengerUser:function(ba){var ca=y[ba];if(ca)if(ca[h.MESSENGER_STATUS]==h.STATUS_ACTIVE)return true;return v[ba];},hasDetailedPresenceData:function(ba){return y[ba]!=null;},getGroup:function(ba){return ba.some(function(ca){if(ca==k.getID())return false;return (z.get(ca)===h.ACTIVE);})?h.ACTIVE:h.OFFLINE;},set:function(ba,ca,da,ea,fa,ga){if(ba==k.getID())return false;switch(ca){case h.OFFLINE:case h.IDLE:case h.ACTIVE:case h.MOBILE:break;default:return false;}var ha=z.get(ba),ia=ha!=ca;if((ia&&ha==h.ACTIVE)||(ca==h.ACTIVE)){var ja={};ja[ba]=o.get()/1000;l.update(ja);}var ka=false;if(!ia&&fa)ka=z.getCapabilities(ba)!=fa;if(da){w[ba]=o.get();x[ba]=ea;}t[ba]=ca;if(fa)u[ba]=fa;if(ga)y[ba]=ga;var la=ia||ka;if(la)aa();return la;},setMobileFriends:function(ba){v=p(ba);},getOnlineIDs:function(){var ba,ca=[];for(ba in t)if(z.get(ba)===h.ACTIVE)ca.push(ba);return ca;},getAvailableIDs:function(){var ba=z.getOnlineIDs(),ca;for(ca in v){if(t[ca])continue;ba.push(ca);}return ba;},getOnlineCount:function(){return z.getOnlineIDs().length;},getPresenceStats:function(){var ba=0,ca=0,da=0,ea=0,fa=0;for(var ga in t){ba+=1;switch(z.get(ga)){case h.OFFLINE:ca+=1;break;case h.IDLE:da+=1;break;case h.ACTIVE:ea+=1;break;case h.MOBILE:fa+=1;break;default:break;}}return {total:ba,offline:ca,idle:da,active:ea,mobile:fa};},getDebugInfo:function(ba){return {id:ba,presence:t[ba],detailedPresence:y[ba],overlaySource:x[ba],overlayTime:w[ba],mobile:v[ba]};}});e.exports=z;},null);
__d("PresencePoller",["AvailableListConstants","AvailableListInitialData","BanzaiODS","ChannelConnection","ChatContexts","ChatVisibility","CurrentUser","JSLogger","LastMobileActiveTimes","Poller","PresencePrivacy","PresenceStatus","ServerTime","ShortProfiles","UserActivity","copyProperties","debounceAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){b.__markCompiled&&b.__markCompiled();var x=5,y='/ajax/chat/buddy_list.php',z=1800000,aa=h.pollInterval,ba=h.lazyPollInterval,ca=h.lazyThreshold,da=n.create('available_list'),ea='presence_poller';i.setEntitySample(ea,.01);function fa(ga){"use strict";this.$PresencePoller0=ga;this.$PresencePoller1=false;this.$PresencePoller2=h.chatNotif;this.$PresencePoller3=new p({interval:aa,setupRequest:this.$PresencePoller4.bind(this),clearOnQuicklingEvents:false,dontStart:true});if(l.isOnline()){this.$PresencePoller5=Date.now();this.$PresencePoller6=Date.now();this.$PresencePoller7=Date.now();this.$PresencePoller8=h.updateTime;}else{this.$PresencePoller5=0;this.$PresencePoller8=0;this.$PresencePoller6=0;this.$PresencePoller7=0;}this.$PresencePoller9=0;this.$PresencePollera('available_initial_data',h.updateTime,h.availableList,h.lastActiveTimes,h.mobileFriends);u.subscribe(function(ha,ia){if(ia.idleness>aa)this.forceUpdate();}.bind(this));q.subscribe('privacy-user-presence-changed',function(){this.forceUpdate();}.bind(this));}fa.prototype.start=function(){"use strict";setTimeout(this.$PresencePoller3.start.bind(this.$PresencePoller3),0);};fa.prototype.restart=function(){"use strict";if(this.$PresencePoller3.isMuted()){this.$PresencePoller3.resume();this.forceUpdate();}};fa.prototype.stop=function(){"use strict";this.$PresencePoller3.mute();};fa.prototype.forceUpdate=function(){"use strict";this.$PresencePoller3.request();};fa.prototype.getIsUserIdle=function(){"use strict";return this.$PresencePoller1;};fa.prototype.getWebChatNotification=function(){"use strict";return this.$PresencePoller2;};fa.prototype.getCallback=function(){"use strict";return this.$PresencePoller0;};fa.prototype.$PresencePollerb=function(){"use strict";return w(function(){this.$PresencePoller0(g.ON_AVAILABILITY_CHANGED);}.bind(this),0)();};fa.prototype.$PresencePollera=function(ga,ha,ia,ja,ka){"use strict";this.$PresencePoller8=ha;if(!Array.isArray(ia)){r.resetPresenceData();for(var la in ia)r.set(la,ia[la].a,false,ga,ia[la].c,ia[la].p);}if(ja)o.update(ja);if(ka)r.setMobileFriends(ka);this.$PresencePollerb();};fa.prototype.$PresencePoller4=function(ga){"use strict";if(j.isShutdown()||!l.isOnline()){this.$PresencePoller3.skip();i.bumpEntityKey(ea,'skip.offline');return;}if(Date.now()-this.$PresencePoller5<aa){this.$PresencePoller3.skip();i.bumpEntityKey(ea,'skip.recent');return;}i.bumpEntityKey(ea,'request');this.$PresencePoller5=Date.now();var ha=Date.now()-this.$PresencePoller7,ia=t.getCachedProfileIDs().join(",");ga.setHandler(this.$PresencePollerc.bind(this)).setErrorHandler(this.$PresencePollerd.bind(this)).setOption('suppressErrorAlerts',true).setOption('retries',1).setData({user:m.getID(),cached_user_info_ids:ia,fetch_mobile:(ha>z)}).setURI(y).setAllowCrossPageTransition(true);};fa.prototype.$PresencePollerc=function(ga){"use strict";var ha=ga.getPayload(),ia=ha.buddy_list;if(!ia){this.$PresencePollerd(ga);return;}i.bumpEntityKey(ea,'response');this.$PresencePollere();this.$PresencePoller6=Date.now();s.update(ha.time);if(ia.mobile_friends)this.$PresencePoller7=Date.now();this.$PresencePoller9=0;this.$PresencePollerf();var ja=ia.userInfos;if(ja)t.setMulti(ja);var ka=ia.chatContexts;ka&&k.update(ka);this.$PresencePoller1=ia.userIsIdle;if(ia.chatNotif!==(void 0)){this.$PresencePoller2=ia.chatNotif;this.$PresencePoller0(g.ON_CHAT_NOTIFICATION_CHANGED,this.$PresencePoller2);}this.$PresencePollera('buddy_list_poller',ha.time,ia.nowAvailableList,ia.last_active_times,ia.mobile_friends);};fa.prototype.$PresencePollerd=function(ga){"use strict";i.bumpEntityKey(ea,'error');if(ga.getError()==1356007)return;this.$PresencePoller9++;if(this.$PresencePoller9>=x)this.$PresencePoller0(g.ON_UPDATE_ERROR);};fa.prototype.$PresencePollerf=function(){"use strict";var ga=u.isActive(ca)?aa:ba;i.bumpEntityKey(ea,'period.'+ga);this.$PresencePoller3.setInterval(ga);};fa.prototype.$PresencePollere=function(){"use strict";var ga=Date.now(),ha=ga-this.$PresencePoller6;da.log('buddylist_presence_stats',v({duration:ha},r.getPresenceStats()));};e.exports=fa;},null);
__d("TypingStates",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={INACTIVE:0,TYPING:1,QUITTING:2};e.exports=g;},null);
__d("AvailableList",["Arbiter","ArbiterMixin","AsyncRequest","AvailableListConstants","BanzaiODS","ChannelConnection","ChannelConstants","ChatConfig","ChatVisibility","JSLogger","LastMobileActiveTimes","PresencePoller","PresencePrivacy","PresenceStatus","ServerTime","ShortProfiles","TypingStates","copyProperties","debounceAcrossTransitions","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){b.__markCompiled&&b.__markCompiled();k.setEntitySample('presence',.0001);var aa=x({},j,h);aa.subscribe([j.ON_AVAILABILITY_CHANGED,j.ON_UPDATE_ERROR],function(ja,ka){g.inform(ja,ka);});var ba=y(function(){aa.inform(j.ON_AVAILABILITY_CHANGED);},0);function ca(ja,ka,la,ma,na,oa){var pa=t.set(ja,ka,la,ma,na,oa);if(pa)ba();}function da(ja){var ka=ja.payload.availability||{};for(var la in ka)ca(la,ka[la].a,true,'mercury_tabs',ka[la].c,ka[la].p);}function ea(){ia.restart();}function fa(){ia.stop();}function ga(ja){var ka=aa.getDebugInfo(ja),la=(ka.presence==j.ACTIVE),ma=new i('/ajax/mercury/tabs_presence.php').setData({target_id:ja,to_online:la,presence_source:ka.overlaySource,presence_time:ka.overlayTime}).setHandler(da).setErrorHandler(z).setAllowCrossPageTransition(true).send();}function ha(ja,ka){ka.chat_config=n.getDebugInfo();ka.available_list_debug_info={};t.getAvailableIDs().forEach(function(la){ka.available_list_debug_info[la]=aa.getDebugInfo(la);});ka.available_list_poll_interval=aa._poller&&aa._poller.getInterval();}var ia=new r(function(event){aa.inform(event);});x(aa,{get:function(ja){return t.get(ja);},updateForID:function(ja){ga(ja);},getWebChatNotification:function(){return ia.getWebChatNotification();},isUserIdle:function(){return ia.getIsUserIdle();},isReady:function(){return true;},set:function(ja,ka,la,ma,na){ca(ja,ka,true,la,ma,na);},update:function(){ia.forceUpdate();},isIdle:function(ja){return aa.get(ja)==j.IDLE;},getDebugInfo:function(ja){var ka=t.getDebugInfo(ja),la=v.getNow(ja);if(la)ka.name=la.name;return ka;}});ia.start();g.subscribe(p.DUMP_EVENT,ha);g.subscribe('chat-visibility/go-online',ea);g.subscribe('chat-visibility/go-offline',fa);s.subscribe(['privacy-changed','privacy-availability-changed','privacy-user-presence-response'],ba);l.subscribe([l.CONNECTED,l.RECONNECTING,l.SHUTDOWN,l.MUTE_WARNING,l.UNMUTE_WARNING],ba);g.subscribe(m.getArbiterType('buddylist_overlay'),function(ja,ka){var la={},ma=ka.obj.overlay;for(var na in ma){aa.set(na,ma[na].a,ma[na].s||'channel',ma[na].vc,ma[na].p);if(ma[na].la)la[na]=ma[na].la;}q.update(la);});g.subscribe([m.getArbiterType('typ'),m.getArbiterType('ttyp')],function(ja,ka){var la=ka.obj;if(la.st===w.TYPING){var ma=la.from;if(o.isOnline()){k.bumpEntityKey('presence','stale_presence_check_typing');var na=t.get(ma);if(na!=j.ACTIVE){var oa=q.get(ma)*1000,pa=u.get();if(!oa){k.bumpEntityKey('presence','no_detailed_presence_typing');}else if(pa-oa>5*60*1000){var qa='stale_presence_typing',ra=pa-oa;if(ra<10*60*1000){qa+='600';}else if(ra<60*60*1000)qa+='3600';k.bumpEntityKey('presence',qa);}}}aa.set(ma,j.ACTIVE,'channel-typing');}});g.subscribe(m.getArbiterType('messaging'),function(ja,ka){if(!o.isOnline())return;var la=ka.obj;if(la.message&&la.message.timestamp&&la.message.sender_fbid){var ma=u.get(),na=la.message.timestamp;if(ma-na<2*60*1000){k.bumpEntityKey('presence','stale_presence_check');var oa=la.message.sender_fbid,pa=t.get(oa);if(pa==j.ACTIVE)return;var qa=q.get(oa)*1000;if(!qa){k.bumpEntityKey('presence','no_detailed_presence');}else if(na-qa>5*60*1000){var ra='stale_presence',sa=na-qa;if(sa<10*60*1000){ra+='600';}else if(sa<60*60*1000)ra+='3600';k.bumpEntityKey('presence',ra);}}}});a.AvailableList=e.exports=aa;},null);
__d("ChatImpressionLogger",["AsyncSignal","requireWeak","ChatConfig","ChatVisibility","Poller","PresencePrivacy","PresenceStatus","debounceAcrossTransitions","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=null;h(['AvailableList'],function(v){return p=v;});var q=null;function r(){if(!q)return '';return q.getCachedSortedList().toString();}function s(){if(!q||!p)return '';var v=[],w=q.getCachedSortedList();for(var x=0;x<w.length;x++)v[x]=p.get(w[x]);return v.toString();}function t(v){v.setURI('/ajax/chat/imps_logging.php').setData({list_availability:s(),sorted_list:r(),source:'periodical_imps'});}var u={init:function(v){q=v;var w=i.get('chat_impression_logging_periodical',0);if(w){var x=i.get('periodical_impression_logging_config.interval'),y=new k({interval:x,setupRequest:t,clearOnQuicklingEvents:false,dontStart:true});l.subscribe('privacy-user-presence-changed',n(function(){if(j.isOnline()){y.start();}else y.stop();}));}this.init=function(){};},logImpression:function(v,w,x){var y=i.get('chat_impression_logging_with_click'),z={list_availability:y?s():'',sorted_list:y?r():'',source:v,target:w,target_presence:m.get(w),viewport_width:document.body.clientWidth};new g('/ajax/chat/ct.php',o(z,x)).send();}};e.exports=u;},null);
__d("ChatWelcomeMessage",["ImmutableObject"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';function h(){this.$ChatWelcomeMessage0={};}h.prototype.setWelcomeMessage=function(j,k,l){this.$ChatWelcomeMessage0[j]=new g({timestamp:Date.now(),thread_id:j,author:k,body:l});};h.prototype.getWelcomeMessage=function(j){return this.$ChatWelcomeMessage0[j];};var i=new h();e.exports=i;},null);
__d("MercuryIDs",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={isValid:function(h){if(!h||typeof h!=='string')return false;return (/^\w{3,12}:/.test(h));},isValidThreadID:function(h){if(!g.isValid(h))return false;var i=g.tokenize(h);switch(i.type){case 'user':case 'group':case 'thread':case 'root':case 'pending':return true;default:return false;}},tokenize:function(h){if(!this.isValid(h))throw ("bad_id_format "+h);var i=h.indexOf(':');return {type:h.substr(0,i),value:h.substr(i+1)};},getUserIDFromParticipantID:function(h){if(!this.isValid(h))throw ("bad_id_format "+h);var i=g.tokenize(h),j=i.type,k=i.value;if(j!='fbid')return null;return k;},getParticipantIDFromUserID:function(h){if(isNaN(h))throw ("Not a user ID: "+h);return 'fbid:'+h;},getUserIDFromThreadID:function(h){if(!this.isCanonical(h))return null;return this.tokenize(h).value;},getThreadIDFromUserID:function(h){return 'user:'+h;},getThreadIDFromParticipantID:function(h){var i=this.getUserIDFromParticipantID(h);return i?this.getThreadIDFromUserID(i):null;},getParticipantIDFromFromThreadID:function(h){return this.getParticipantIDFromUserID(this.getUserIDFromThreadID(h)||'');},isCanonical:function(h){return this.isValid(h)&&this.tokenize(h).type==='user';},isMultichat:function(h){return this.isValid(h)&&this.tokenize(h).type!=='user';}};e.exports=g;},null);
__d("MercuryAssert",["MercuryIDs"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();e.exports={isParticipantID:function(h){if(!g.isValid(h))throw ("bad_participant_id "+h);},allParticipantIDs:function(h){h.forEach(this.isParticipantID);},isUserParticipantID:function(h){var i=g.tokenize(h);if(i.type!='fbid')throw ("bad_user_id "+h);},isEmailParticipantID:function(h){var i=g.tokenize(h);if(i.type!='email')throw ("bad_email_id "+h);},allThreadID:function(h){h.forEach(this.isThreadID);},isThreadID:function(h){if(!g.isValid(h))throw ("bad_thread_id "+h);}};},null);
__d("MercuryAttachment",["MercuryAttachmentContentType","MercuryAttachmentType","MercuryAudioType","MercuryConfig"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k={getAttachIconClass:function(l){switch(l){case g.PHOTO:return 'MercuryPhotoIcon';case g.VIDEO:return 'MercuryVideoIcon';case g.MUSIC:return 'MercuryMusicIcon';case g.VOICE:return 'MercuryVoiceIcon';case g.TEXT:return 'MercuryTextIcon';case g.MSWORD:return 'MercuryMSWordIcon';case g.MSXLS:return 'MercuryMSXLSIcon';case g.MSPPT:return 'MercuryMSPPTIcon';}return 'MercuryDefaultIcon';},getAttachIconClassByMime:function(l){if(l.startsWith('image')){return 'MercuryPhotoIcon';}else if(l.startsWith('video')){return 'MercuryVideoIcon';}else if(l.startsWith('audio')){return 'MercuryMusicIcon';}else if(l.startsWith('text/plain')){return 'MercuryTextIcon';}else return 'MercuryDefaultIcon';},getAttachTypeByMime:function(l){if(l.startsWith('image')){return g.PHOTO;}else if(l.startsWith('video')){return g.VIDEO;}else if(l.startsWith('audio')){return g.MUSIC;}else if(l.startsWith('text/plain')){return g.TEXT;}else return g.UNKNOWN;},convertRaw:function(l){var m=[];for(var n=0;n<l.length;n++){var o=l[n];if(o.attach_type===h.PHOTO){m.push(o);}else if(o.filename){var p=k.getAttachTypeByMime(o.filetype),q={};q.attach_type=h.FILE;q.name=o.filename;q.icon_type=p;q.url='';m.push(q);}}return m;},get:function(l){var m=[];if(l.attachments){m=l.attachments;}else if(l.raw_attachments)m=this.convertRaw(l.raw_attachments);if(!(l.attachments&&l.attachments.length>0)){if(l.sticker_id)return m.concat([{attach_type:h.STICKER}]);if(l.preview_attachments&&l.preview_attachments.length>0)return m.concat(l.preview_attachments);}return m;},hasBubbleTail:function(l,m){var n=this.get(l);if((j.MercuryStoryAttachmentsGK||j.WWWMessengerComerceGK)&&!l.body)return !n.some(function(o){return o.attach_type===h.SHARE&&o.share&&o.share.media.image&&m;});return true;},isVoiceMessage:function(l){return (l===i.AudioClip||l===i.VoiceMessageWithTranscript);}};e.exports=k;},null);
__d("MercurySingletonMixin",["CurrentUser"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={_getInstances:function(){if(!this._instances)this._instances={};return this._instances;},get:function(){return this.getForFBID(g.getID());},getForFBID:function(i){var j=this._getInstances();if(!j[i])j[i]=new this(i);return j[i];}};e.exports=h;},null);
__d("MercuryMessageClientState",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={DO_NOT_SEND_TO_SERVER:'do_not_send_to_server',SEND_TO_SERVER:'send_to_server'};e.exports=g;},null);
__d("MercurySendAttemptLogger",["Banzai","BanzaiLogger","MercuryAttachmentType","MercurySendMessageFields"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=h.create({retry:true}),l=g.isEnabled('mercury_send_attempt_logging'),m=function(o){if(!o.has_attachment)return null;if(o.sticker_id)return i.STICKER;if((o.image_ids&&o.image_ids.length)||(o.photo_fbids&&o.photo_fbids.length))return i.PHOTO;if(o.raw_attachments&&o.raw_attachments.length)return i.FILE;if(o.content_attachment)return i.SHARE;return i.UNKNOWN;},n={log:function(o){if(!l)return;var p={message_id:o.message_id,timestamp_client:Date.now(),attempt_num:o[j.MANUAL_RETRY_CNT],first_attachment_type:m(o),source:o.source,auto_retry_cnt:o[j.AUTO_RETRY_CNT]};k.log('MercurySendAttemptLoggerConfig',p);}};e.exports=n;},null);
__d("MercurySendErrorLogger",["Banzai","BanzaiLogger"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i=h.create({retry:true}),j=g.isEnabled('mercury_send_error_logging'),k={log:function(l){if(!j)return;var m={message_id:l.message_id,timestamp_client:Date.now(),error_type:l.error_data.type,error_code:l.error_data.code,error_description:l.error_data.description,is_transient:l.error_data.is_transient};i.log('MercurySendErrorLoggerConfig',m);}};e.exports=k;},null);
__d("MercuryServerSendMessageQueueSimulatedError",["AsyncRequest","AsyncResponse","copyProperties"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j=9999,k={create:function(l){var m=new g(this.endpoint_uri).setData({message_batch:[l],client:this.client}),n=new h(m,{});i(n,{error:j,silentError:false,transientError:true,request:m});return n;}};e.exports=k;},null);
__d("MercuryServerSendMessageQueue",["BanzaiODS","LogHistory","MercuryLoggingHelper","MercuryServerDispatcher","MercuryServerSendMessageQueueSimulatedError"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l='/ajax/mercury/send_messages.php',m=h.getInstance('mercury_server_send_message_queue');function n(o,p,q,r){"use strict";this.sender_id=o;this.queue_id=p;this.$MercuryServerSendMessageQueue0=q.success_handler;this.$MercuryServerSendMessageQueue1=q.error_handler;this.$MercuryServerSendMessageQueue2=q.transport_error_handler;this.$MercuryServerSendMessageQueue3=q.timeout_handler;this.client=r;var s={};s[l]={request_user_id:this.sender_id,endpoint_id:this.queue_id,mode:j.IMMEDIATE,handler:this.handleSuccess.bind(this),error_handler:this.handleError.bind(this),transport_error_handler:this.handleTransportError.bind(this),timeout:q.timeout,timeout_handler:this.handleTimeout.bind(this),connection_retries:q.connection_retries,send_attempt_logging_handler:q.send_attempt_logging_handler,auto_retries:q.auto_retries};j.registerEndpoints(s);this.pending_message=null;this.queue=[];}n.prototype.enqueue=function(o){"use strict";this.queue.push(o);this.$MercuryServerSendMessageQueue4();};n.prototype.$MercuryServerSendMessageQueue4=function(){"use strict";if(this.pending_message||!this.queue.length){if(this.pending_message)this.$MercuryServerSendMessageQueue5();return;}this.pending_message=this.queue.shift();j.trySend(l,{message_batch:[this.pending_message],client:this.client},null,this.sender_id,this.queue_id);};n.prototype.$MercuryServerSendMessageQueue6=function(){"use strict";while(this.queue.length)this.$MercuryServerSendMessageQueue7(this.queue.shift());};n.prototype.$MercuryServerSendMessageQueue7=function(o){"use strict";this.$MercuryServerSendMessageQueue1(k.create(o));m.error('mark_as_failed',{fbid:this.sender_id,queue_id:this.queue_id,message:i.obfuscateMessage(o)});};n.prototype.handleSuccess=function(o,p){"use strict";this.$MercuryServerSendMessageQueue0(o,p);this.pending_message=null;this.$MercuryServerSendMessageQueue4();};n.prototype.handleError=function(o){"use strict";this.$MercuryServerSendMessageQueue1(o);this.$MercuryServerSendMessageQueue6();this.pending_message=null;};n.prototype.handleTransportError=function(o){"use strict";this.$MercuryServerSendMessageQueue2(o);this.$MercuryServerSendMessageQueue6();this.pending_message=null;};n.prototype.handleTimeout=function(o){"use strict";this.$MercuryServerSendMessageQueue3(o);this.$MercuryServerSendMessageQueue6();this.pending_message=null;};n.prototype.$MercuryServerSendMessageQueue5=function(){"use strict";m.debug('maybe_send_next_pending_message',{fbid:this.sender_id,queue_id:this.queue_id,pending_message:i.obfuscateMessage(this.pending_message),queue:this.queue.map(function(p){return i.obfuscateMessage(p);})});var o='send_queue.delayed.queue_length.'+this.queue.length.toString();g.bumpEntityKey('chat.web',o);};e.exports=n;},null);
__d("MercuryServerSendMessageQueueRouter",["BanzaiODS","LogHistory","Map","MercuryServerSendMessageQueue","MercurySingletonMixin"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=h.getInstance('mercury_server_send_message_queue_router'),m='chat.web.send_queue_router';g.setEntitySample(m,.1);function n(o){"use strict";this.fbid=o;this.queues=new i();}n.prototype.enqueue=function(o,p,q,r){"use strict";if(!this.queues.has(o)){this.queues.set(o,new j(this.fbid,o,p,q));l.debug('added queue',{fbid:this.fbid,queue_id:o});g.bumpEntityKey(m,'new_queue');}this.queues.get(o).enqueue(r);};Object.assign(n,k);e.exports=n;},null);
__d("MercuryMessageIDs",["KeyedCallbackManager"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h=new g(),i={getServerIDs:function(j,k){var l=j.filter(function(n){return n.indexOf('mail.projektitan.com')!==-1;}),m=function(n){var o=j.map(function(p){return n[p]?n[p]:p;});k(o);};return h.executeOrEnqueue(l,m);},addServerID:function(j,k){h.setResource(j,k);}};e.exports=i;},null);
__d("MessagingReliabilityLogger",["PresenceUtil","MercuryServerDispatcher","MessagingReliabilityLoggerInitialData","isEmpty","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l='/ajax/mercury/client_reliability.php',m=60000;function n(t,u){var v={app:i.app,categories:JSON.stringify(t)};if(!j(u))v.extra=JSON.stringify(u);return v;}function o(t,u,v,w){if(t[u]===(void 0))t[u]={};if(t[u][v]===(void 0))t[u][v]=0;t[u][v]+=w;}function p(t,u,v,w){if(t[u]===(void 0))t[u]={};if(t[u][v]===(void 0))t[u][v]=[];for(var x=0;x<w.length;++x)t[u][v].push(w[x]);}function q(t,u){if((t&&!t.categories)||(u&&!u.categories))return;var v=t?JSON.parse(t.categories):{},w=t&&t.extra?JSON.parse(t.extra):{},x=JSON.parse(u.categories),y=u.extra?JSON.parse(u.extra):{};for(var z in x){var aa=x[z],ba=y[z];for(var ca in aa){o(v,z,ca,aa[ca]);if(ba!==(void 0)){var da=ba[ca];if(da!==(void 0))p(w,z,ca,da);}}}return n(v,w);}var r={};r[l]={mode:h.BATCH_SUCCESSIVE_PIGGYBACK_ON_ERROR,batch_function:q};h.registerEndpoints(r);var s={addEntry:function(t,u,v){if(!i.enabled)return;var w={};o(w,t,u,1);var x={};if(v!==(void 0))p(x,t,u,[v]);h.trySend(l,n(w,x));}};(function t(){s.addEntry('page_event','active',g.getSessionID());k(t,m);})();e.exports=s;},null);
__d("MercuryServerSendMessageQueueOptions",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();function g(h,i,j,k,l,m,n,o){"use strict";this.success_handler=h;this.error_handler=i;this.transport_error_handler=j;this.timeout_handler=k;this.send_attempt_logging_handler=l;this.timeout=m;this.connection_retries=n;this.auto_retries=o;}e.exports=g;},null);
__d("MercuryThreadInformer",["ArbiterMixin","LogHistory","MercuryAssert","MercuryLoggingHelper","MercurySingletonMixin","copyProperties","mapObject","mixin"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();'use strict';var o=h.getInstance('mercury_informer'),p=n(g);for(var q in p)if(p.hasOwnProperty(q))s[q]=p[q];var r=p===null?null:p.prototype;s.prototype=Object.create(r);s.prototype.constructor=s;s.__superConstructor__=p;function s(u){this.$MercuryThreadInformer0=u;this.$MercuryThreadInformer1={};this.$MercuryThreadInformer2={};this.$MercuryThreadInformer3={};this.$MercuryThreadInformer4=false;this.$MercuryThreadInformer5=false;this.$MercuryThreadInformer6=false;this.$MercuryThreadInformer7={};this.$MercuryThreadInformer8={};this.$MercuryThreadInformer9={};this.$MercuryThreadInformera=0;}s.prototype.updatedThread=function(u){this.$MercuryThreadInformer2[u]=true;this.$MercuryThreadInformerb();};s.prototype.deletedThread=function(u){this.$MercuryThreadInformer1[u]=true;this.$MercuryThreadInformerb();};s.prototype.updatedThreadlist=function(){this.$MercuryThreadInformer4=true;this.$MercuryThreadInformerb();};s.prototype.updatedUnseenState=function(){this.$MercuryThreadInformer5=true;this.$MercuryThreadInformerb();};s.prototype.updatedUnreadState=function(){this.$MercuryThreadInformer6=true;this.$MercuryThreadInformerb();};s.prototype.changedThreadReadState=function(u,v,w){if(!this.$MercuryThreadInformer3[u]||this.$MercuryThreadInformer3[u].timestamp<w)this.$MercuryThreadInformer3[u]={mark_as_read:v,timestamp:w};this.$MercuryThreadInformerb();};s.prototype.receivedMessage=function(u){i.isThreadID(u.thread_id);var v=u.thread_id;if(!this.$MercuryThreadInformer7[v])this.$MercuryThreadInformer7[v]=[];this.$MercuryThreadInformer7[v].push(u);this.updatedThread(v);};s.prototype.reorderedMessages=function(u,v){this.$MercuryThreadInformer8[u]={source:v};this.$MercuryThreadInformerb();};s.prototype.updatedMessage=function(u,v,w){if(!this.$MercuryThreadInformer9[u])this.$MercuryThreadInformer9[u]={};this.$MercuryThreadInformer9[u][v]={source:w};this.updatedThread(u);};s.prototype.synchronizeInforms=function(u){this.$MercuryThreadInformera++;try{u();}catch(v){throw v;}finally{this.$MercuryThreadInformera--;this.$MercuryThreadInformerb();}};s.prototype.listen=function(u,v){return this.subscribe('threads-updated',function(w,x){if(x[u])v(u);});};s.prototype.$MercuryThreadInformerb=function(){if(!this.$MercuryThreadInformera){var u=this.$MercuryThreadInformer1,v=this.$MercuryThreadInformer2,w=this.$MercuryThreadInformer3,x=this.$MercuryThreadInformer4,y=this.$MercuryThreadInformer5,z=this.$MercuryThreadInformer6,aa=this.$MercuryThreadInformer7,ba=this.$MercuryThreadInformer8,ca=this.$MercuryThreadInformer9;this.$MercuryThreadInformer1={};this.$MercuryThreadInformer2={};this.$MercuryThreadInformer3={};this.$MercuryThreadInformer4=false;this.$MercuryThreadInformer5=false;this.$MercuryThreadInformer6=false;this.$MercuryThreadInformer7={};this.$MercuryThreadInformer8={};this.$MercuryThreadInformer9={};var da=Object.keys(v);if(da.length||x)this.$MercuryThreadInformerc('threadlist-updated',da);if(da.length)this.$MercuryThreadInformerc('threads-updated',v);for(var ea in w){this.$MercuryThreadInformerc('thread-read-changed',w);break;}for(ea in u){this.$MercuryThreadInformerc('threads-deleted',u);break;}if(y)this.$MercuryThreadInformerc('unseen-updated',null);if(z)this.$MercuryThreadInformerc('unread-updated',null);for(ea in aa){this.$MercuryThreadInformerc('messages-received',aa);break;}for(ea in ba){this.$MercuryThreadInformerc('messages-reordered',ba);break;}for(ea in ca){this.$MercuryThreadInformerc('messages-updated',ca);break;}}};s.prototype.$MercuryThreadInformerc=function(u,v){t(u,v);this.inform(u,v);};function t(u,v){var w=v;if(u=='messages-received')w=m(w,function(x){return x.map(function(y){return j.obfuscateMessage(y);});});o.debug(u,w);}l(s,k);e.exports=s;},null);
__d("MercuryServerRequests",["Arbiter","ArbiterMixin","AsyncResponse","BanzaiLogger","BanzaiODS","ChannelConstants","CurrentUser","KeyedCallbackManager","LogHistory","MercuryActionStatus","MercuryActionType","MercuryAPIArgsSource","MercuryAssert","MercuryErrorType","MercuryGlobalActionType","MercuryIDs","MercuryLoggingHelper","MercuryLogMessageType","MercuryMessageClientState","MercuryPayloadSource","MercurySendAttemptLogger","MercurySendErrorLogger","MercuryServerRequestsConfig","MercuryServerSendMessageQueueRouter","MercurySingletonMixin","MercurySourceType","MercuryThreadlistConstants","MercuryMessageIDs","MessagingConfig","MessagingReliabilityLogger","MessagingTag","MercuryServerDispatcher","MercuryServerSendMessageQueueOptions","MercuryThreadInformer","copyProperties","createObjectFrom","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa){b.__markCompiled&&b.__markCompiled();'use strict';var ra=o.getInstance('mercury_server'),sa=r.MERCURY;function ta(ec,fc){if(fc)ec._lastActionTimestamp=Math.max(ec._lastActionTimestamp,fc);}function ua(ec,fc){var gc=fc.thread_fbid;if(fc.canonical_fbid)gc=fc.canonical_fbid;var hc=ec._FBIDToClientIDs.getResource(gc);if(!hc){if(fc.canonical_fbid){hc='user:'+fc.canonical_fbid;}else if(fc.root_message_threading_id)hc='root:'+fc.root_message_threading_id;hc=hc||'thread:'+gc;if(gc)gc=gc.toString();wa(ec,gc,hc);if(fc.thread_id)va(ec,fc.thread_id,hc);}fc.thread_id=hc;}function va(ec,fc,gc){ec._serverToClientIDs.setResource(fc,gc);ec._clientToServerIDs.setResource(gc,fc);ec._newlyAddedClientIDs[fc]=gc;}function wa(ec,fc,gc){ec._clientIDToFBIDs.setResource(gc,fc);ec._FBIDToClientIDs.setResource(fc,gc);ec._newlyAddedClientIDs[fc]=gc;}function xa(ec,fc,gc){var hc=ec._clientIDToFBIDs.executeOrEnqueue(fc,gc),ic=ec._clientIDToFBIDs.getUnavailableResources(hc),jc=v.tokenize(fc);if(ic.length&&jc.type!='root')ec.fetchThreadData(ic);}function ya(ec,fc){return ec._clientIDToFBIDs.getResource(fc);}function za(ec,fc){return !!ec._FBIDToClientIDs.getResource(fc);}function ab(ec,fc){var gc=ec._serverToClientIDs.getResource(fc);if(typeof gc=='undefined')ra.warn('no_client_thread_id',{server_id:fc});return gc;}function bb(ec,fc){var gc=ec._FBIDToClientIDs.getResource(fc);if(typeof gc=='undefined')ra.warn('no_client_thread_id',{thread_fbid:fc});return gc;}function cb(ec,fc,gc){ec._FBIDToClientIDs.executeOrEnqueue(fc,gc);ec.ensureThreadIsFetched(fc);}function db(ec){return ec.thread_fbid||ec.thread_id||ec.client_thread_id;}function eb(ec,fc,gc){if(fc.action_type!=q.SEND_MESSAGE)return;var hc=fc.thread_fbid;if(fc.other_user_fbid)hc=fc.other_user_fbid;var ic=fc.client_thread_id;if(!ic)ic=bb(ec,hc);var jc=null;if(ic)jc=v.tokenize(ic).type;gb(ec,fc,gc==='success');if(fc.status===p.ERROR){ba.log(fc);}else ja.addEntry('send_'+jc,gc,hc+','+fc.message_id);}function fb(ec){return ec.getError()?'_'+ec.getError():'';}function gb(ec,fc,gc){if(Math.floor(Math.random()*20)===0)if(fc.client_message_id in ec._sentMessagesTimestamp){var hc=ec._sentMessagesTimestamp[fc.client_message_id],ic=Date.now()-hc,jc=fc.client_thread_id;if(!jc)jc=bb(ec,fc.thread_fbid);j.log('WebMessagingLatencyLoggerConfig',{has_attachment:fc.attachments&&fc.attachments.length>0,latency:ic,is_canonical:!v.isMultichat(jc),send_successful:gc,source:'client'});}}function hb(ec,fc){var gc=null;switch(fc.status){case p.SUCCESS:gc='success';break;case p.FAILED_UNKNOWN_REASON:gc='confirmed_error';break;case p.UNABLE_TO_CONFIRM:gc='confirm_error';break;default:return;}eb(ec,fc,gc);}function ib(ec,fc){(fc.threads||[]).forEach(function(pc){ua(ec,pc);delete ec._fetchingThreads[pc.thread_id];var qc=ya(ec,pc.thread_id);delete ec._fetchingThreads[qc];ta(ec,pc.timestamp);});(fc.ordered_threadlists||[]).forEach(function(pc){var qc=pc.thread_fbids||[];qc=qc.concat(pc.other_user_fbids||[]);pc.thread_ids=qc.map(bb.bind(null,ec));});if(fc.pinned_threads&&fc.pinned_threads.thread_fbids)fc.pinned_threads.thread_fbids=fc.pinned_threads.thread_fbids.map(bb.bind(null,ec));fc.actions=fc.actions||[];fc.actions.forEach(function(pc){hb(ec,pc);var qc=pc.thread_fbid;if(pc.other_user_fbid)qc=pc.other_user_fbid;if(pc.status&&pc.status!=p.SUCCESS&&!qc){pc.thread_id=pc.client_thread_id;return;}if(pc.action_type==q.SEND_MESSAGE&&pc.client_thread_id&&qc)wa(ec,qc.toString(),pc.client_thread_id);var rc=pc.thread_id;if(qc){pc.thread_id=za(ec,qc)?bb(ec,qc):null;}else if(pc.client_thread_id)pc.thread_id=pc.client_thread_id;if(!pc.thread_id)pc.server_thread_id=rc;if(!fc.payload_source||!fc.payload_source.startsWith('server'))ta(ec,pc.timestamp);});if(fc.end_of_history){var gc=[];for(var hc=0;hc<fc.end_of_history.length;hc++){var ic=fc.end_of_history[hc];if(ic.type=='user'){gc.push('user:'+ic.fbid);}else if(ic.type=='thread'&&za(ec,ic.fbid))gc.push(bb(ec,ic.fbid));}fc.end_of_history=gc;}if(fc.roger){var jc={};for(var kc in fc.roger){var lc=ec._FBIDToClientIDs.getResource(kc);if(lc){var mc=fc.roger[kc];jc[lc]={};for(var nc in mc)if(mc.hasOwnProperty(nc)){var oc=v.getParticipantIDFromUserID(nc);jc[lc][oc]=mc[nc];}}}fc.roger=jc;}}function jb(ec){if(ec._pendingUpdates&&ec._pendingUpdates.length){var fc=ec._pendingUpdates[0];ec._pendingUpdates=ec._pendingUpdates.slice(1);ec.handleUpdate(fc);}}function kb(ec,fc){var gc=oa({},ec),hc;if(fc.threads){if(!gc.threads)gc.threads={};for(hc in fc.threads)gc.threads[hc]=Object.keys(pa((gc.threads[hc]||[]).concat(fc.threads[hc])));}if(fc.messages){if(!gc.messages)gc.messages={};for(hc in fc.messages){if(!gc.messages[hc])gc.messages[hc]={};for(var ic in fc.messages[hc])if(gc.messages[hc][ic]){gc.messages[hc][ic]=nb(gc.messages[hc][ic],fc.messages[hc][ic]);}else gc.messages[hc][ic]=fc.messages[hc][ic];}}gc.client=ec.client||fc.client;return gc;}function lb(ec,fc){var gc=oa(pa(ec.folders,true),pa(fc.folders,true)),hc=ec.client||fc.client;return {folders:Object.keys(gc),client:hc};}function mb(ec,fc){for(var gc in fc)if(ec[gc]&&typeof ec[gc]==='object'){ec[gc]=nb(ec[gc],fc[gc]);}else if(fc[gc]&&typeof fc[gc]==='object'){var hc={};oa(hc,fc[gc]);ec[gc]=hc;}return ec;}function nb(ec,fc){var gc=ec.offset<fc.offset?ec.offset:fc.offset,hc=ec.offset+ec.limit,ic=fc.offset+fc.limit,jc=(hc>ic)?hc:ic,kc=jc-gc;return {offset:gc,limit:kc};}function ob(ec,fc){var gc=ec.client||fc.client,hc={ids:{},client:gc};oa(hc.ids,ec.ids);oa(hc.ids,fc.ids);return hc;}function pb(ec,fc){var gc={},hc,ic=ec.client||fc.client;delete ec.client;delete fc.client;for(hc in ec)oa(gc,pa(ec[hc],hc));for(hc in fc)oa(gc,pa(fc[hc],hc));var jc={client:ic};for(var kc in gc){hc=gc[kc];if(!jc[hc])jc[hc]=[];jc[hc].push(kc);}return jc;}function qb(ec,fc){var gc=ec.client||fc.client,hc=pa(ec.ids,true),ic=pa(fc.ids,true),jc=oa(hc,ic);return {ids:Object.keys(jc),client:gc};}function rb(ec){this._fbid=ec;this._lastActionTimestamp=0;this._serverToClientIDs=new n();this._clientToServerIDs=new n();this._FBIDToClientIDs=new n();this._clientIDToFBIDs=new n();this._pendingUpdates=[];this._fetchingThreads={};this._newlyAddedClientIDs={};this._sentMessagesTimestamp={};this._sendMessageQueueOptions=new ma(ub,yb,zb,ac,aa.log,ca.sendMessageTimeout,ia.SEND_CONNECTION_RETRIES,ca.maxAutoRetries);cc(this);}oa(rb.prototype,h,{getServerThreadID:function(ec,fc){s.isThreadID(ec);xa(this,ec,fc);},getThreadFBID:function(ec,fc){s.isThreadID(ec);xa(this,ec,fc);},getClientThreadID:function(ec,fc){cb(this,ec,fc);},getClientThreadIDNow:function(ec){return bb(this,ec);},getServerThreadIDNow:function(ec){return ya(this,ec);},getClientThreadIDForPermalinks:function(ec){return ab(this,ec);},convertThreadIDIfAvailable:function(ec){var fc=this._FBIDToClientIDs.getResource(ec);if(fc===(void 0)){return ec;}else return fc;},isUser:function(ec){return ec<2.2e+09||(ec>=1e+14&&ec<=100099999989999)||(ec>=8.9e+13&&ec<=89999999999999)||(ec>=6.000001e+13&&ec<=60000019999999);},canLinkExternally:function(ec){s.isThreadID(ec);var fc=v.tokenize(ec);return (fc.type=='user')||!!ya(this,ec);},fetchThreadlistInfo:function(ec,fc,gc,hc,ic){gc=gc||ka.INBOX;ic=ic||sa;var jc=hc?la.IMMEDIATE:null,kc={client:ic};kc[gc]={offset:ec,limit:fc,filter:hc};dc(this,'/ajax/mercury/threadlist_info.php',kc,jc);},fetchPinnedThreads:function(){dc(this,'/mercury/pinned_threads/',{});},fetchUnseenThreadIDs:function(ec,fc){fc=fc||sa;this.fetchThreadlistInfo(ga.RECENT_THREAD_OFFSET,ga.JEWEL_THREAD_COUNT,ec,null,fc);},fetchUnreadThreadIDs:function(ec,fc){fc=fc||sa;dc(this,'/ajax/mercury/unread_threads.php',{folders:[ec],client:fc});},fetchMissedMessages:function(ec,fc){fc=fc||sa;var gc={last_action_timestamp:this._lastActionTimestamp,folders:ec,client:fc};gc.last_action_timestamp=this._lastActionTimestamp;dc(this,'/ajax/mercury/thread_sync.php',gc);},fetchThreadData:function(ec,fc){fc=fc||sa;s.allThreadID(ec);var gc={threads:{},client:fc},hc=[],ic=[];ec.forEach(function(kc){if(this._fetchingThreads[kc])return;this._fetchingThreads[kc]=true;var lc=ya(this,kc),mc=v.tokenize(kc);if(mc.type=='user'){hc.push(mc.value);gc.threads.user_ids=hc;}else if(mc.type=='thread'){if(lc){ic.push(lc);}else ic.push(mc.value);gc.threads.thread_fbids=ic;}else if(mc.type!='root'&&mc.type!='pending')throw new Error('Unknown thread type',mc);}.bind(this));this.inform("fetch-thread-data",gc);for(var jc in gc.threads){dc(this,'/ajax/mercury/thread_info.php',gc);break;}},ensureThreadIsFetched:function(ec,fc){fc=fc||sa;if(!this._FBIDToClientIDs.getResource(ec)&&!this._fetchingThreads[ec]){this._fetchingThreads[ec]=true;dc(this,'/ajax/mercury/thread_info.php',{threads:{thread_fbids:[ec]},client:fc});}},fetchThreadMessages:function(ec,fc,gc,hc,ic){s.isThreadID(ec);ic=ic||sa;var jc,kc,lc=v.tokenize(ec),mc=ya(this,ec),nc=false;if(mc){jc=mc;kc=(lc.type=='user')?'user_ids':'thread_fbids';}else{jc=lc.value;switch(lc.type){case 'user':kc='user_ids';nc=true;break;case 'thread':kc='thread_fbids';break;}}var oc={messages:{},threads:{},client:ic};if(kc){oc.messages[kc]={};oc.messages[kc][jc]={offset:fc,limit:gc};if(nc)oc.threads[kc]=[jc];dc(this,'/ajax/mercury/thread_info.php',oc,hc);}else xa(this,ec,function(pc){oc.messages.thread_fbids={};oc.messages.thread_fbids[pc]={offset:fc,limit:gc};dc(this,'/ajax/mercury/thread_info.php',oc,hc);}.bind(this));},handleThreadInfoError:function(ec){var fc=ec.getRequest().getData(),gc=[];if(fc.messages){for(var hc in fc.messages.thread_fbids)gc.push(sb(bb(this,hc)));for(var ic in fc.messages.user_ids)gc.push(sb('user:'+ic));for(var jc in fc.messages.group_ids)gc.push(sb('group:'+jc));}if(gc.length)this.handleUpdate({actions:gc,from_client:true,payload_source:z.CLIENT_CHANNEL_MESSAGE});if(fc.threads&&(fc.threads.user_ids||fc.threads.group_ids||fc.threads.thread_ids)){var kc=5,lc=true;if(!fc.retry_count){fc.retry_count=0;if(fc.messages)delete fc.messages;}else if(fc.retry_count>=kc){lc=false;(fc.threads.thread_ids||[]).forEach(function(nc){if(nc in this._fetchingThreads)delete this._fetchingThreads[nc];}.bind(this));}if(lc){var mc=fc.retry_count*1000;qa(function(){ra.log('retry_thread',fc);dc(this,'/ajax/mercury/thread_info.php',fc);}.bind(this),mc);fc.retry_count++;}}},markFolderAsRead:function(ec){dc(this,'/ajax/mercury/mark_folder_as_read.php',{folder:ec});var fc=[{action_type:u.MARK_ALL_READ,action_id:null,folder:ec}];this.handleUpdate({global_actions:fc,from_client:true,payload_source:z.CLIENT_CHANGE_READ_STATUS});},changeThreadReadStatus:function(ec,fc,gc){s.isThreadID(ec);xa(this,ec,function(hc){var ic={ids:{},source:gc};ic.ids[hc]=fc;dc(this,'/ajax/mercury/change_read_status.php',ic);}.bind(this));},changeThreadArchivedStatus:function(ec,fc,gc){s.isThreadID(ec);xa(this,ec,function(hc){var ic={ids:{},source:gc};ic.ids[hc]=fc;dc(this,'/ajax/mercury/change_archived_status.php',ic);}.bind(this));},changeThreadFolder:function(ec,fc){s.isThreadID(ec);xa(this,ec,function(gc){var hc={};hc[fc]=[gc];dc(this,'/ajax/mercury/move_thread.php',hc);}.bind(this));},changeMutingOnThread:function(ec,fc){s.isThreadID(ec);xa(this,ec,function(gc){dc(this,'/ajax/mercury/change_mute_thread.php',{thread_fbid:gc,mute_settings:fc,payload_source:sa});}.bind(this));},markThreadSpam:function(ec,fc){s.isThreadID(ec);xa(this,ec,function(gc){dc(this,'/ajax/mercury/mark_spam.php',{id:gc,source:fc});}.bind(this));},markMessagesSpam:function(ec,fc){ha.getServerIDs(fc||[],function(gc){dc(this,'/ajax/mercury/mark_spam_messages.php',{message_ids:gc});}.bind(this));},unmarkThreadSpam:function(ec,fc){s.isThreadID(ec);xa(this,ec,function(gc){dc(this,'/ajax/mercury/unmark_spam.php',{id:gc,source:fc});}.bind(this));},deleteThread:function(ec,fc){s.isThreadID(ec);xa(this,ec,function(gc){var hc={ids:[gc],source:fc};dc(this,'/ajax/mercury/delete_thread.php',hc);}.bind(this));},unpinThread:function(ec){s.isThreadID(ec);xa(this,ec,function(fc){dc(this,'/mercury/unpin_thread/',{id:fc});}.bind(this));},deleteMessages:function(ec,fc){ha.getServerIDs(fc||[],function(gc){dc(this,'/ajax/mercury/delete_messages.php',{message_ids:gc});}.bind(this));},sendDeliveryReceipts:function(ec){ha.getServerIDs(ec||[],function(fc){dc(this,'/ajax/mercury/delivery_receipts.php',{message_ids:fc});}.bind(this));},clearChat:function(ec,fc,gc){s.isThreadID(ec);dc(this,'/ajax/chat/settings.php',{clear_history_id:fc});var hc=[{action_type:q.CLEAR_CHAT,action_id:null,thread_id:ec,clear_time:gc}];this.handleUpdate({actions:hc,from_client:true,payload_source:z.CLIENT_CLEAR_CHAT});k.bumpEntityKey('chat.web','chat.clear_window');},sendNewMessage:function(ec,fc){fc=fc||sa;if(!ec.client_state||ec.client_state==y.SEND_TO_SERVER)ha.getServerIDs(ec.forward_message_ids||[],function(gc){var hc=v.tokenize(ec.thread_id),ic=hc.type,jc=oa({},ec);jc.forward_message_ids=gc;if((ic=='root'&&hc.value==jc.message_id)||(ic=='user')){jc.client_thread_id=jc.thread_id;jc.thread_id=null;this._sendNewMessageToServer(jc,fc);}else xa(this,jc.thread_id,function(kc){hc=v.tokenize(jc.thread_id);if(hc.type=='user'){jc.other_user_fbid=hc.values;}else jc.thread_fbid=kc;jc.thread_id=null;this._sendNewMessageToServer(jc);}.bind(this));}.bind(this));},_sendNewMessageToServer:function(ec,fc){g.inform(l.ATTEMPT_RECONNECT);fc=fc||sa;this._sentMessagesTimestamp[ec.message_id]=Date.now();da.getForFBID(this._fbid).enqueue(db(ec),this._sendMessageQueueOptions,fc,ec);},requestMessageConfirmation:function(ec,fc){fc=fc||sa;var gc={},hc={};for(var ic in ec){var jc=ya(this,ic);if(jc){gc[jc]=ec[ic];}else{var kc=ec[ic];for(var lc=0;lc<kc.length;lc++)hc[kc[lc]]=ic;}}var mc=Object.keys(gc),nc=Object.keys(hc);if(mc.length||nc.length)dc(this,'/ajax/mercury/confirm_messages.php',{thread_message_map:gc,local_messages:hc,client:fc});},handleMessageConfirmError:function(ec){var fc=ec.getRequest().getData().thread_message_map,gc=ec.getRequest().getData().local_messages;if(!fc&&!gc)return;var hc=[];for(var ic in fc){var jc=fc[ic];jc.forEach(function(mc){hc.push({action_type:q.SEND_MESSAGE,client_message_id:mc,message_id:mc,client_thread_id:null,thread_fbid:ic,status:p.UNABLE_TO_CONFIRM});});}for(var kc in gc){var lc=gc[kc];hc.push({action_type:q.SEND_MESSAGE,client_message_id:kc,message_id:kc,client_thread_id:lc,thread_fbid:null,status:p.UNABLE_TO_CONFIRM});}if(hc.length)this.handleUpdate({actions:hc,payload_source:z.CLIENT_HANDLE_ERROR});},markSeen:function(){var ec=this._lastActionTimestamp;dc(this,'/ajax/mercury/mark_seen.php',{seen_timestamp:ec});},handleRoger:function(ec){var fc=ec.thread_fbid?this._FBIDToClientIDs.getResource(ec.thread_fbid):v.getThreadIDFromUserID(ec.reader);if(fc){var gc=v.getParticipantIDFromUserID(ec.reader),hc={};hc[fc]={};hc[fc][gc]=ec.time;this.inform('update-roger',hc);}},handleUpdateWaitForThread:function(ec,fc,gc){gc=gc||sa;var hc=this._FBIDToClientIDs.getResource(fc);if(hc){this.handleUpdate(ec);return;}this._FBIDToClientIDs.executeOrEnqueue(fc,function(){this._pendingUpdates.push(ec);}.bind(this));if(!this._fetchingThreads[fc]){this._fetchingThreads[fc]=true;var ic={threads:{thread_fbids:[fc]},client:gc};if(this.isUser(fc))ic={threads:{user_ids:[fc]},client:gc};dc(this,'/ajax/mercury/thread_info.php',ic);}},handleUpdate:function(ec){var fc=[];if(ec&&ec.threads)for(var gc=0;gc<ec.threads.length;gc++){if(!ec.threads[gc].snippet_attachments)continue;for(var hc=0;hc<ec.threads[gc].snippet_attachments.length;hc++)if(ec.threads[gc].snippet_attachments[hc].share_xhp){fc.push({i:gc,j:hc,xhp:ec.threads[gc].snippet_attachments[hc].share_xhp});ec.threads[gc].snippet_attachments[hc].share_xhp="HTMLDivElement not shown: object contains circular "+"reference, which was breaking JSON.stringify. "+"Look at MercuryServerRequests.handleUpdate";}}var ic={actions:[],threads:[]};if(ec){if(ec.actions)ic.actions=ec.actions.map(function(lc){return w.obfuscateMessage(lc);});if(ec.threads)ic.threads=ec.threads.map(function(lc){return w.obfuscateThread(lc);});}var jc=oa({},ec,ic);ra.debug('update:'+ec.payload_source,{payload:jc,from_client:ec.from_client});for(var kc=0;kc<fc.length;kc++)ec.threads[fc[kc].i].snippet_attachments[fc[kc].j].share_xhp=fc[kc].xhp;for(kc in ec){na.getForFBID(this._fbid).synchronizeInforms(function(){if(!ec.from_client){ib(this,ec);this.inform('payload-preprocessed',ec);}this.inform('update-thread-ids',this._newlyAddedClientIDs);this._newlyAddedClientIDs={};this.inform('update-participants',ec);this.inform('update-threads',ec);this.inform('update-unread',ec);this.inform('update-threadlist',ec);this.inform('update-pinned-threads',ec);this.inform('update-messages',ec);this.inform('update-unseen',ec);this.inform('update-typing-state',ec);this.inform('update-roger',ec.roger);this.inform('model-update-completed',null);jb(this);}.bind(this));break;}},_handleSendMessageErrorCommon:function(ec,fc,gc,hc){ra.debug('handle_send_message_error_common',{reliability_error_status:gc,request_error_status:fc});var ic=ec.getData(),jc=ic.message_batch,kc=jc.map(function(mc){var nc={action_type:q.SEND_MESSAGE,thread_fbid:mc.thread_fbid,client_message_id:mc.message_id,message_id:mc.message_id,client_thread_id:mc.client_thread_id,status:fc,error_data:hc};return nc;});kc.forEach(function(mc){eb(this,mc,gc);},this);var lc={actions:kc,payload_source:z.CLIENT_HANDLE_ERROR};this.handleUpdate(lc);},handleSendMessageError:function(ec){var fc=ec.getPayload(),gc=null,hc=null;if(fc&&fc.error_payload){gc=p.UNCONFIRMED;hc='send_error';}else{gc=p.ERROR;hc='request_error'+fb(ec);}var ic=ec.error;if(ic===1404102)i.verboseErrorHandler(ec);var jc=/<.*>/.test(ec.getErrorDescription())?ec.getErrorSummary():ec.getErrorDescription();this._handleSendMessageErrorCommon(ec.getRequest(),gc,hc,{type:t.SERVER,code:ec.getError(),description:jc,is_transient:ec.isTransient()});},handleSendMessageTransportError:function(ec){this._handleSendMessageErrorCommon(ec.getRequest(),p.ERROR,'transport_error'+fb(ec),{type:t.TRANSPORT,code:ec.getError(),is_transient:true});},handleSendMessageTimeout:function(ec){this._handleSendMessageErrorCommon(ec,p.ERROR,'transport_timeout',{type:t.TIMEOUT,is_transient:true});},getLastActionTimestamp:function(){return this._lastActionTimestamp;}});oa(rb,ea);function sb(ec){return {action_type:q.LOG_MESSAGE,thread_id:ec,message_id:ec,timestamp:Date.now(),timestamp_absolute:'',timestamp_relative:'',is_unread:false,source:fa.UNKNOWN,log_message_type:x.SERVER_ERROR,log_message_data:{}};}function tb(ec){var fc=ec.getData(),gc=fc.request_user_id?fc.request_user_id:m.getID();return rb.getForFBID(gc);}function ub(ec,fc){tb(fc).handleUpdate(ec);}function vb(ec,fc){var gc={};oa(gc,ec.ids);oa(gc,fc.ids);var hc=ec.client||fc.client;return {ids:gc,client:hc};}function wb(ec,fc){return fc;}function xb(ec){var fc=tb(ec.getRequest());fc.handleThreadInfoError(ec);}function yb(ec){var fc=tb(ec.getRequest());fc.handleSendMessageError(ec);}function zb(ec){var fc=tb(ec.getRequest());fc.handleSendMessageTransportError(ec);}function ac(ec){var fc=tb(ec);fc.handleSendMessageTimeout(ec);}function bc(ec){var fc=tb(ec.getRequest());fc.handleMessageConfirmError(ec);}function cc(ec){var fc={'/ajax/mercury/thread_sync.php':{request_user_id:ec._fbid,mode:la.IDEMPOTENT,handler:ub},'/ajax/mercury/thread_info.php':{request_user_id:ec._fbid,mode:la.BATCH_DEFERRED_MULTI,batch_function:kb,handler:ub,error_handler:xb},'/ajax/mercury/mark_folder_as_read.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub},'/ajax/mercury/change_read_status.php':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE,batch_function:vb,handler:ub},'/ajax/mercury/mark_seen.php':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE,batch_function:wb,handler:ub},'/ajax/mercury/confirm_messages.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub,error_handler:bc},'/ajax/mercury/threadlist_info.php':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE_UNIQUE,batch_function:mb,handler:ub},'/ajax/mercury/mark_spam.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub},'/ajax/mercury/mark_spam_messages.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub},'/ajax/mercury/unmark_spam.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub},'/ajax/mercury/unread_threads.php':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE_UNIQUE,batch_function:lb,handler:ub},'/ajax/chat/settings.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE},'/ajax/mercury/change_archived_status.php':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE,batch_function:ob,handler:ub},'/ajax/mercury/delete_thread.php':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE,batch_function:qb,handler:ub},'/ajax/mercury/delete_messages.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub},'/ajax/mercury/delivery_receipts.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub},'/ajax/mercury/move_thread.php':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE,batch_function:pb,handler:ub},'/ajax/mercury/change_mute_thread.php':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub},'/mercury/pinned_threads/':{request_user_id:ec._fbid,mode:la.BATCH_SUCCESSIVE_UNIQUE,handler:ub},'/mercury/unpin_thread/':{request_user_id:ec._fbid,mode:la.IMMEDIATE,handler:ub}};la.registerEndpoints(fc);}function dc(ec,fc,gc,hc){la.trySend(fc,gc,hc,ec._fbid);}e.exports=rb;},null);
__d("MercuryThreads",["EventEmitter","ImmutableObject","KeyedCallbackManager","LogHistory","Map","MercuryActionType","MercuryAssert","MercuryAttachment","MercuryGlobalActionType","MercuryIDs","MercuryLogMessageType","MercuryLoggingHelper","MercuryPayloadSource","MercurySingletonMixin","MercuryThreadMode","MessagingTag","MercuryServerRequests","Set","MercuryThreadInformer","setImmediate"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){b.__markCompiled&&b.__markCompiled();'use strict';var aa=new g(),ba=j.getInstance('mercury_threads');function ca(da){this.$MercuryThreads0=da;this.$MercuryThreads1=w.getForFBID(this.$MercuryThreads0);this.$MercuryThreads2=y.getForFBID(this.$MercuryThreads0);this.$MercuryThreads3=p.getParticipantIDFromUserID(this.$MercuryThreads0);this.$MercuryThreads4=false;this.$MercuryThreads5=new i();this.$MercuryThreads6=new x();this.$MercuryThreads7=false;this.$MercuryThreads8=new x();this.$MercuryThreads9=new x();this.$MercuryThreadsa();}ca.prototype.getThreadMetaNow=function(da){m.isThreadID(da);return this.$MercuryThreads5.getResource(da);};ca.prototype.getOrFetch=function(da){var ea=this.getThreadMetaNow(da);if(!ea&&!this.$MercuryThreads9.has(da))this.$MercuryThreads8.add(da);if(this.$MercuryThreads8.size>0&&!this.$MercuryThreads7)this.$MercuryThreadsb();return ea;};ca.prototype.$MercuryThreadsb=function(){if(this.$MercuryThreads7)return;this.$MercuryThreads7=true;z(function(){this.$MercuryThreads7=false;this.$MercuryThreads8.forEach(function(da){return this.$MercuryThreads9.add(da);}.bind(this));this.getMultiThreadMeta(Array.from(this.$MercuryThreads8),function(da){for(var ea in da)da.hasOwnProperty(ea)&&this.$MercuryThreads9["delete"](ea);}.bind(this));this.$MercuryThreads8.clear();}.bind(this));};ca.prototype.getThreadMeta=function(da,ea,fa){return this.getMultiThreadMeta([da],function(ga){return ea(ga[da]);},fa);};ca.prototype.getMultiThreadMeta=function(da,ea,fa){m.allThreadID(da);var ga=this.$MercuryThreads5.executeOrEnqueue(da,ea),ha=this.$MercuryThreads5.getUnavailableResources(ga);if(ha.length){var ia=[];for(var ja=0;ja<ha.length;ja++){var ka=ha[ja],la=p.tokenize(ka),ma=la.type,na=la.value;if(ma=='user'){var oa=p.getParticipantIDFromUserID(na);this.createNewLocalThread(ka,oa===this.$MercuryThreads3?[this.$MercuryThreads3]:[this.$MercuryThreads3,oa]);}else ia.push(ka);}if(ia.length)this.$MercuryThreads1.fetchThreadData(ia,fa);}return ga;};ca.addListener=function(da,ea){return aa.addListener(da,ea);};ca.prototype.unsubscribe=function(da){this.$MercuryThreads5.unsubscribe(da);};ca.prototype.getCanonicalThreadToParticipant=function(da,ea,fa,ga){var ha=p.getThreadIDFromParticipantID(da),ia=this.$MercuryThreads5.getResource(ha);if(typeof ia=='undefined'){ia=this.createNewLocalThread(ha,this.$MercuryThreads3===da?[this.$MercuryThreads3]:[this.$MercuryThreads3,da],ea);!ga&&this.$MercuryThreads1.fetchThreadData([ha],fa);}return ia;};ca.prototype.createNewLocalThread=function(da,ea,fa){var ga=this.$MercuryThreads5.getResource(da);if(!ga){var ha=p.tokenize(da),ia=ha.type,ja=ha.value;ga=new h({thread_id:da,last_action_id:null,participants:Array.from(ea),name:null,snippet:'',snippet_has_attachment:false,snippet_sender:null,unread_count:fa?fa:0,message_count:0,image_src:null,timestamp_absolute:null,timestamp_relative:null,timestamp:null,canonical_fbid:ia==='user'?ja:null,is_canonical_user:ia=='user',is_canonical:this.$MercuryThreadsc(ea),is_subscribed:true,root_message_threading_id:null,folder:v.INBOX,is_archived:false,mode:u.TITAN_ORIGINATED});this.$MercuryThreads5.setResource(da,ga);}return ga;};ca.prototype.isEmptyLocalThread=function(da){var ea=this.$MercuryThreads5.getResource(da);if(!ea)return false;var fa=p.tokenize(da),ga=fa.type;return ga=='root'&&!ea.timestamp;};ca.prototype.isNewEmptyLocalThread=function(da){if(!this.isEmptyLocalThread(da))return false;var ea=this.$MercuryThreads5.getResource(da);return !!ea.participants&&ea.participants.length===0;};ca.prototype.$MercuryThreadsd=function(da,ea){if(!da||!da.length)return;var fa=new k(),ga=new k(),ha=new k(),ia=[];for(var ja=0;ja<da.length;ja++){var ka=da[ja];if(ka.is_forward)continue;var la=ka.action_type;if(la==l.LOG_MESSAGE&&ka.log_message_type==q.SERVER_ERROR)continue;var ma=!!(ka.sync_id||ka.action_id),na=ka.thread_id;m.isThreadID(na);var oa=this.$MercuryThreads5.getResource(na);if(!oa&&!ma&&la==l.USER_GENERATED_MESSAGE){oa=this.$MercuryThreadse(ka);this.$MercuryThreads5.setResource(na,oa);}if(!oa)continue;if(la==l.LOG_MESSAGE||la==l.USER_GENERATED_MESSAGE)ma=!ea;if(oa.server_timestamp&&ka.timestamp<=oa.server_timestamp&&ma)continue;if(!ha.has(na))ha.set(na,Object.assign({},oa));this.$MercuryThreadsf(ha.get(na),ka,ea);if(la==l.USER_GENERATED_MESSAGE)fa.set(na,ka);if(la==l.USER_GENERATED_MESSAGE||la==l.LOG_MESSAGE||la==l.SEND_MESSAGE)if(ka&&ka.timestamp&&(!ga.has(na)||ka.timestamp>ga.get(na).timestamp))ga.set(na,ka);}ha.forEach(function(pa,qa){var ra=fa.get(qa);if(ra)this.$MercuryThreadsg(pa,ra);var sa=ga.get(qa),ta=pa.timestamp;if(sa){if(sa.timestamp>ta)Object.assign(pa,{timestamp_absolute:sa.timestamp_absolute,timestamp_relative:sa.timestamp_relative,timestamp:sa.timestamp});var ua=pa.server_timestamp;if(!ea&&sa.timestamp>ua)pa.server_timestamp=sa.timestamp;}var va=new h(pa);this.$MercuryThreads5.setResource(qa,va);ia.push(r.obfuscateThread(va));}.bind(this),this);ia.length&&ba.debug('threads_updated',{threads:ia});};ca.prototype.$MercuryThreadsf=function(da,ea,fa){var ga=ea.action_type;if(ga==l.USER_GENERATED_MESSAGE||ga==l.LOG_MESSAGE){ea.is_unread&&da.unread_count++;da.message_count++;da.is_archived=false;}switch(ga){case l.DELETE_THREAD:da.message_count=0;this.$MercuryThreadsh(ea.thread_id);break;case l.USER_GENERATED_MESSAGE:if(da.last_read_timestamp>=ea.timestamp)this.$MercuryThreadsi(da,ea,true);this.$MercuryThreadsj(da,ea.author);break;case l.SEND_MESSAGE:var ha=ea.log_message_type;if(ha==q.THREAD_IMAGE)da.image_src=ea.log_message_data.image?ea.log_message_data.image.preview_url:null;da.snippet_attachments=ea.attachments;break;case l.LOG_MESSAGE:var ha=ea.log_message_type;if(ha==q.SUBSCRIBE){this.$MercuryThreadsk(da,ea.log_message_data.added_participants);this.$MercuryThreadsl(ea.thread_id);}else if(ha==q.UNSUBSCRIBE){this.$MercuryThreadsm(da,ea.log_message_data.removed_participants);this.$MercuryThreadsl();}else if(ha==q.THREAD_IMAGE){if(!fa)da.image_src=ea.log_message_data.image?ea.log_message_data.image.preview_url:null;}else if(ha==q.THREAD_NAME){if(da.name!==ea.log_message_data.name)this.$MercuryThreadsl(ea.thread_id);da.name=ea.log_message_data.name;}break;case l.CHANGE_READ_STATUS:var ia=this.$MercuryThreadsi(da,ea,ea.mark_as_read);if(ia&&ea.timestamp)da.last_read_timestamp=ea.timestamp;if(ia&&fa)this.$MercuryThreads1.changeThreadReadStatus(da.thread_id,ea.mark_as_read,ea.source);break;case l.CLEAR_CHAT:this.$MercuryThreadsn(da,ea.clear_time);break;case l.CHANGE_ARCHIVED_STATUS:if(da.is_archived!=ea.archived){da.is_archived=ea.archived;this.$MercuryThreadsl(ea.thread_id);}break;case l.CHANGE_FOLDER:if(da.folder!=ea.new_folder){da.folder=ea.new_folder;this.$MercuryThreadsl(ea.thread_id);}break;case l.DELETE_MESSAGES:if(fa){da.snippet='...';da.snippet_has_attachment=false;da.snippet_attachments=null;da.snippet_sender=null;da.is_forwarded_snippet=false;this.$MercuryThreadsl(ea.thread_id);}else if(ea.message_ids)da.message_count=da.message_count-ea.message_ids.length;break;case l.CHANGE_MUTE_SETTINGS:if(ea.mute_settings!==(void 0)){var ja=this.$MercuryThreads0+'@facebook.com';if(da.mute_settings){if(ea.mute_settings){var ka={};ka[ja]=ea.mute_settings;da.mute_settings=Object.assign({},da.mute_settings,ka);}else{da.mute_settings=Object.assign({},da.mute_settings);delete da.mute_settings[ja];}this.$MercuryThreadsl(da.thread_id);}}break;case l.ADD_PARTICIPANTS:this.$MercuryThreadsk(da,ea.participants);this.$MercuryThreadsl(da.thread_id);break;}};ca.prototype.$MercuryThreadse=function(da){var ea=p.tokenize(da.thread_id),fa=ea.type,ga=ea.value,ha=this.$MercuryThreadsc(da.specific_to_list);return new h({thread_id:da.thread_id,last_action_id:null,participants:da.specific_to_list,name:null,snippet:da.body,snippet_has_attachment:false,snippet_attachments:[],snippet_sender:da.author,unread_count:0,message_count:0,image_src:null,timestamp_absolute:da.timestamp_absolute,timestamp_relative:da.timestamp_relative,timestamp:da.timestamp,canonical_fbid:fa==='user'?ga:null,is_canonical_user:fa==='user',is_canonical:ha,is_subscribed:true,root_message_threading_id:da.message_id,folder:v.INBOX,is_archived:false,mode:u.TITAN_ORIGINATED});};ca.prototype.$MercuryThreadsi=function(da,ea,fa){if(ea.timestamp)this.$MercuryThreadso(da.thread_id,fa,ea.timestamp);if(!da||!da.thread_id)return false;if(!da.timestamp){this.$MercuryThreads6.add(da.thread_id);return false;}var ga=!da.unread_count;if(fa==ga)return false;da.unread_count=fa?0:1;this.$MercuryThreadsl(da.thread_id);return true;};ca.prototype.$MercuryThreadsp=function(da){var ea=this.$MercuryThreads5.getAllResources();for(var fa in ea)if(ea.hasOwnProperty(fa)){var ga=ea[fa];if(ga.folder==da){this.$MercuryThreads5.setResource(fa,h.setProperty(ga,'unread_count',0));this.$MercuryThreadsl(fa);}}};ca.prototype.$MercuryThreadsn=function(da,ea){if(!da||da.chat_clear_time===ea)return;da.chat_clear_time=ea;this.$MercuryThreads2.reorderedMessages(da.thread_id);};ca.prototype.$MercuryThreadsk=function(da,ea){var fa=new x(da.participants);da.participants=Array.from(da.participants);ea.forEach(function(ga){if(!fa.has(ga)){da.participants.push(ga);if(ga===this.$MercuryThreads3)da.is_subscribed=true;}}.bind(this));};ca.prototype.$MercuryThreadsm=function(da,ea){var fa=new x(ea);da.participants=da.participants.filter(function(ga){return !fa.has(ga);});if(fa.has(this.$MercuryThreads3))da.is_subscribed=false;};ca.prototype.$MercuryThreadsj=function(da,ea){if(da.participants[0]!=ea){da.participants=da.participants.filter(function(fa){return fa!=ea;});da.participants.unshift(ea);}};ca.prototype.$MercuryThreadsg=function(da,ea){var fa=ea.body,ga=ea.subject,ha='';if(ga){ga=ga.toLowerCase();if(fa.slice(0,ga.length).toLowerCase()==ga){ha=fa;}else if(fa){ha=ga+' \u00B7 '+fa;}else ha=ga;}else ha=fa;da.snippet=ha;da.snippet_has_attachment=ea.has_attachment;if(ea.raw_attachments&&ea.raw_attachments.length>0){var ia=n.convertRaw(ea.raw_attachments);da.snippet_attachments=ia;}else da.snippet_attachments=ea.attachments;da.is_forwarded_snippet=!!ea.forward_count;da.snippet_sender=ea.author;};ca.prototype.$MercuryThreadsc=function(da){return da.filter(function(ea){return ea!=this.$MercuryThreads3;}.bind(this)).length<=1;};ca.prototype.$MercuryThreadsa=function(){this.$MercuryThreads1.subscribe('update-threads',function(da,ea){var fa=(ea.actions||[]).filter(function(ga){return ga.thread_id;});if(ea.threads&&ea.payload_source==s.SERVER_FETCH_THREAD_INFO)ea.threads.forEach(function(ga){var ha=ga.thread_id;if(this.$MercuryThreads6.has(ha)){this.$MercuryThreads6["delete"](ha);if(ga.unread_count)this.$MercuryThreads1.changeThreadReadStatus(ga.thread_id,true);}}.bind(this));this.$MercuryThreadsq(ea.threads);this.$MercuryThreadsd(fa,ea.from_client);ea.threads&&ea.threads.forEach(function(ga){this.$MercuryThreadsl(ga.thread_id);}.bind(this));if(ea.global_actions)ea.global_actions.forEach(function(ga){if(ga.action_type==o.MARK_ALL_READ)this.$MercuryThreadsp(ga.folder);}.bind(this));if(this.$MercuryThreads4){this.$MercuryThreads4=false;aa.emit('change');}}.bind(this));};ca.prototype.$MercuryThreadsq=function(da){if(!da||!da.length)return;var ea={},fa=[];da.forEach(function(ga){var ha=new h(ga);ea[ga.thread_id]=ha;fa.push(r.obfuscateThread(ha));});fa.length&&ba.debug('threads_added',{threads:fa});this.$MercuryThreads5.addResourcesAndExecute(ea);};ca.prototype.$MercuryThreadsl=function(da){this.$MercuryThreads4=true;this.$MercuryThreads2.updatedThread(da);};ca.prototype.$MercuryThreadsh=function(da){this.$MercuryThreads4=true;this.$MercuryThreads2.deletedThread(da);};ca.prototype.$MercuryThreadso=function(da,ea,fa){this.$MercuryThreads4=true;this.$MercuryThreads2.changedThreadReadState(da,ea,fa);};Object.assign(ca,t);e.exports=ca;},null);
__d("WebMessengerPermalinkConstants",["URI"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={ARCHIVED_PATH:'/messages/archived',BASE_PATH:'/messages',OTHER_PATH:'/messages/other',SPAM_PATH:'/messages/spam',COMPOSE_POSTFIX_PATH:'/new',SEARCH_POSTFIX_PATH:'/search',TID_POSTFIX_PARTIAL_PATH:'/conversation-',overriddenVanities:'(archived|other|spam|new|search|conversation-.*)',getURIPathForThreadID:function(i,j){return (j||h.BASE_PATH)+h.TID_POSTFIX_PARTIAL_PATH+g.encodeComponent(g.encodeComponent(i));},getThreadIDFromURI:function(i){var j=i.getPath().match(h.BASE_PATH+'(/[^/]*)*'+h.TID_POSTFIX_PARTIAL_PATH+'([^/]+)');if(j){var k=g.decodeComponent(g.decodeComponent(j[2]));return k;}},getURIPathForIDOrVanity:function(i,j){if(i.match('^'+h.overriddenVanities+'$'))i='.'+i;return (j||h.BASE_PATH)+'/'+i;},getUserIDOrVanity:function(i){var j=i.match(h.BASE_PATH+'.*/([^/]+)/?$'),k=j&&j[1],l=h.overriddenVanities;if(!k||k.match('^'+l+'$')){return false;}else if(k.match('^\\.'+l+'$')){return k.substr(1);}else return k;}};e.exports=h;},null);
__d("ChatTypeaheadConstants",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={USER_TYPE:'user',THREAD_TYPE:'thread',FRIEND_TYPE:'friend',NON_FRIEND_TYPE:'non_friend',FB4C_TYPE:'fb4c',PAGE_TYPE:'page',HEADER_TYPE:'header'};e.exports=g;},null);
__d("ChatOpenTab",["Event","requireWeak","ChatWelcomeMessage","ContextualThing","DOM","csx","cx","MercuryIDs","Parent","curry"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q=null;h(['ChatApp'],function(aa){return q=aa;});var r=null;h(['ChatTabModel'],function(aa){return r=aa;});var s=716,t='messaging_tracking';function u(){d(['Toggler'],function(aa){var ba=aa.getInstance(k.scry(document,"div._1z4y")[0]);if(ba&&ba.getActive())ba.hide();});}function v(aa,ba){d(['LogHistory','MercuryThreads','WebMessengerPermalinkConstants','goURI'],function(ca,da,ea,fa){da.get().getThreadMeta(aa,function(ga){if(q&&q.isInitialized()){q.tabController.openTab(aa,q.tabsViewport,ba);}else fa(ea.getURIPathForThreadID(aa));if(!z.canOpenTab())ca.getInstance('mercury').error('Unable to open chat tab',ga);});});if(document.documentElement.clientHeight<=s)u();}function w(aa,ba,ca,da){g.listen(aa,'click',function(ea){if(z.canOpenTab()){da(ba,ca);return ea.kill();}});}function x(aa,ba,ca,da){var ea={referrer:aa||'',message_thread_id:ba,message_view:'chat',timestamp_send:Date.now()};if(ca!==(void 0))ea.message_target_ids=[ca];d(['ChatImpressionLogger'],function(fa){fa.logImpression(aa,ca,da);});d(['Banzai'],function(fa){fa.post(t,ea,{delay:0,retry:true});});}function y(aa){var ba=j.getContext(aa);return (ba&&o.byClass(ba,"_3qw")!==null);}var z={canOpenTab:function(){return q&&!q.isHidden();},openEmptyTab:function(aa,ba,ca){if(z.canOpenTab()&&r){var da=r.getEmptyTab();v(da);x(ba,da,null,ca);u();return da;}return null;},listenOpenEmptyTab:function(aa,ba){w(aa,null,ba,z.openEmptyTab);},openThread:function(aa,ba,ca,da){d(['MercuryServerRequests'],function(ea){if(n.isValid(aa)){v(aa);}else ea.get().getClientThreadID(aa,function(fa){return v(fa,da);});x(ba,aa,null,ca);u();});},listenOpenThread:function(aa,ba,ca){w(aa,ba,ca,z.openThread);},openUserTab:function(aa,ba,ca){var da=n.getThreadIDFromUserID(aa);v(da);x(ba,da,aa,ca);return true;},openPageTab:function(aa,ba,ca){d(['MercuryThreads'],function(da){var ea=n.getThreadIDFromUserID(ba);da.get().getThreadMeta(ea,function(fa){if(aa&&aa.length>0){var ga=(Date.now()-fa.timestamp)/1000,ha=ga/3600;if(fa.message_count===0||ha>24)i.setWelcomeMessage(ea,n.getParticipantIDFromUserID(ba),aa);}});v(ea);x(ca,ea,ba);});return true;},listenOpenUserTab:function(aa,ba,ca){if(!y(aa))w(aa,ba,ca,z.openUserTab);},listenOpenPageTab:function(aa,ba,ca,da){if(!y(aa))w(aa,ba,da,p(z.openPageTab,ca));},openTabByType:function(aa,ba,ca){d(['ChatTypeaheadConstants','MercuryParticipantTypes'],function(da,ea){if(ba===da.THREAD_TYPE){if(aa){z.openThread(aa,ca);}else z.openEmptyTab(null,ca);}else if(!ba||ba===ea.FRIEND||ba===da.FRIEND_TYPE||ba===da.PAGE_TYPE||ba===da.USER_TYPE)z.openUserTab(aa,ca);});}};e.exports=z;},null);
__d("NotificationConstants",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={PayloadSourceType:{UNKNOWN:0,USER_ACTION:1,LIVE_SEND:2,ENDPOINT:3,INITIAL_LOAD:4,OTHER_APPLICATION:5,SYNC:6}};},null);
__d("NotificationTokens",["CurrentUser"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={tokenizeIDs:function(i){return i.map(function(j){return g.getID()+':'+j;});},untokenizeIDs:function(i){return i.map(function(j){return j.split(':')[1];});}};e.exports=h;},null);
__d("NotificationUpdates",["Arbiter","BizSiteIdentifier.brands","ChannelConstants","JSLogger","NotificationConstants","NotificationTokens","LiveTimer","copyProperties","createObjectFrom"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p={},q={},r={},s={},t={},u=[],v=0,w=j.create('notification_updates');function x(){if(v)return;var ba=p,ca=q,da=r,ea=s,fa=t;p={};q={};r={};s={};t={};z('notifications-updated',ba);if(Object.keys(ca).length)z('seen-state-updated',ca);if(Object.keys(da).length)z('read-state-updated',da);if(Object.keys(ea).length)z('hidden-state-updated',ea);if(Object.keys(fa).length)z('gnf-state-updated',fa);u.pop();}function y(){if(u.length)return u[u.length-1];return k.PayloadSourceType.UNKNOWN;}function z(event,ba){aa.inform(event,{updates:ba,source:y()});}g.subscribe(i.getArbiterType('notification_json'),function(ba,ca){var da=Date.now(),ea=ca.obj.nodes;if(ea){ea.forEach(function(fa){fa.receivedTime=da;});w.debug('notifications_received',ea);aa.handleUpdate(k.PayloadSourceType.LIVE_SEND,ca.obj);}});g.subscribe(i.getArbiterType('notifications_seen'),function(ba,ca){var da=l.tokenizeIDs(ca.obj.alert_ids);aa.handleUpdate(k.PayloadSourceType.LIVE_SEND,{seenState:o(da)});});g.subscribe(i.getArbiterType('notifications_read'),function(ba,ca){var da=l.tokenizeIDs(ca.obj.alert_ids);aa.handleUpdate(k.PayloadSourceType.LIVE_SEND,{readState:o(da)});});var aa=n(new g(),{handleUpdate:function(ba,ca){if(ca.nodes&&Array.isArray(ca.nodes))ca.nodes=this._filterNodesBasedOnBusinessID(ca.nodes);if(ca.servertime)m.restart(ca.servertime);if(Object.keys(ca).length)this.synchronizeInforms(function(){u.push(ba);var da=n({payloadsource:y()},ca);this.inform('update-notifications',da);this.inform('update-seen',da);this.inform('update-read',da);this.inform('update-hidden',da);this.inform('update-gnf',da);}.bind(this));},didUpdateNotifications:function(ba){n(p,o(ba));x();},didUpdateSeenState:function(ba){n(q,o(ba));x();},didUpdateReadState:function(ba){n(r,o(ba));x();},didUpdateHiddenState:function(ba){n(s,o(ba));x();},didUpdateGNFState:function(ba){n(t,o(ba));x();},synchronizeInforms:function(ba){v++;try{ba();}catch(ca){throw ca;}finally{v--;x();}},_filterNodesBasedOnBusinessID:function(ba){return ba.filter(function(ca){return ca.business_id?(parseInt(h.getBusinessID(),10)==ca.business_id):!h.isBizSite();});}});e.exports=aa;},null);
__d("mergeObjects",["copyProperties"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();function h(){var i={};for(var j=0;j<arguments.length;j++)g(i,arguments[j]);return i;}e.exports=h;},null);
__d("NotificationSeenState",["NotificationConstants","NotificationUpdates","copyProperties","createObjectFrom","mergeObjects"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l={},m=1,n=2,o=0,p=m,q=m|n,r=g.PayloadSourceType.INITIAL_LOAD,s={UNSEEN_AND_UNREAD:o,SEEN_BUT_UNREAD:p,SEEN_AND_READ:q};function t(w){var x=[],y=[];Object.keys(w).forEach(function(z){var aa=w[z],ba=l[z];l[z]=aa;if(ba===(void 0)){x.push(z);y.push(z);return;}var ca=ba^aa;if(ca&m)x.push(z);if(ca&n)y.push(z);});x.length&&h.didUpdateSeenState(x);y.length&&h.didUpdateReadState(y);}h.subscribe('update-notifications',function(w,x){var y=x.nodes;if(!y||!y.length)return;var z=x.payloadsource,aa=g.PayloadSourceType,ba=z==aa.ENDPOINT,ca={};x.nodes.forEach(function(da){var ea=da.alert_id;if(!ba||l[ea]===(void 0))ca[ea]=s[da.seen_state];});t(ca);});h.subscribe('update-seen',function(w,x){if(!x.seenState)return;var y=[],z={};Object.keys(x.seenState).forEach(function(ba){if(!x.seenState[ba]){y.push(ba);return;}var ca=l[ba];if(ca!==(void 0))z[ba]=ca|m;});var aa=k(j(y,o),z);t(aa);});h.subscribe('update-read',function(w,x){if(!x.readState)return;var y=[],z={};Object.keys(x.readState).forEach(function(ba){if(x.readState[ba]){y.push(ba);return;}var ca=l[ba];if(ca!==(void 0)){z[ba]=ca&~n;}else if(x.payloadsource==r)z[ba]=p;});var aa=k(j(y,q),z);t(aa);});function u(w){var x=l[w];return x;}var v={isRead:function(w){return u(w)===q;},isSeen:function(w){return u(w)!==o;},getUnseenCount:function(){return v.getUnseenIDs().length;},getUnseenIDs:function(){return Object.keys(l).filter(function(w){return l[w]===o;});},getUnreadCount:function(){return v.getUnreadIDs().length;},getUnreadIDs:function(){return Object.keys(l).filter(function(w){return l[w]!==q;});}};e.exports=v;},null);
__d("RangedCallbackManager",["CallbackManagerController","createObjectFrom"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();function i(j,k,l){"use strict";this.$RangedCallbackManager0=[];this.$RangedCallbackManager1=false;this.$RangedCallbackManager2=false;this.$RangedCallbackManager3={};this.$RangedCallbackManager4=new g(this.$RangedCallbackManager5.bind(this));this.$RangedCallbackManager6=j;this.$RangedCallbackManager7=k;this.$RangedCallbackManager8=l;}i.prototype.executeOrEnqueue=function(j,k,l,m,n){"use strict";return this.$RangedCallbackManager4.executeOrEnqueue({start:j,limit:k},l,{strict:!!m,skipOnStrictHandler:n});};i.prototype.unsubscribe=function(j){"use strict";this.$RangedCallbackManager4.unsubscribe(j);};i.prototype.getUnavailableResources=function(j){"use strict";var k=this.$RangedCallbackManager4.getRequest(j),l=[];if(k&&!this.$RangedCallbackManager1){var m=k.request,n=this.$RangedCallbackManager9(k.options),o=m.start+m.limit;for(var p=n.length;p<o;p++)l.push(p);}return l;};i.prototype.addResources=function(j){"use strict";j.forEach(function(k){if(!this.$RangedCallbackManager3[k]){this.$RangedCallbackManager3[k]=true;this.$RangedCallbackManager0.push(k);this.$RangedCallbackManager2=null;}}.bind(this));this.resortResources();this.$RangedCallbackManager4.runPossibleCallbacks();};i.prototype.addResourcesWithoutSorting=function(j,k){"use strict";var l=this.$RangedCallbackManager0.slice(0,k);l=l.concat(j);l=l.concat(this.$RangedCallbackManager0.slice(k));this.$RangedCallbackManager0=l;Object.assign(this.$RangedCallbackManager3,h(j,true));this.$RangedCallbackManager2=null;this.$RangedCallbackManager4.runPossibleCallbacks();};i.prototype.removeResources=function(j){"use strict";j.forEach(function(k){if(this.$RangedCallbackManager3[k]){this.$RangedCallbackManager3[k]=false;var l=this.$RangedCallbackManager0.indexOf(k);if(l!=-1)this.$RangedCallbackManager0.splice(l,1);}}.bind(this));};i.prototype.removeAllResources=function(){"use strict";this.$RangedCallbackManager0=[];this.$RangedCallbackManager3={};};i.prototype.resortResources=function(){"use strict";this.$RangedCallbackManager0=this.$RangedCallbackManager0.sort(function(j,k){return this.$RangedCallbackManager7(this.$RangedCallbackManager6(j),this.$RangedCallbackManager6(k));}.bind(this));};i.prototype.setReachedEndOfArray=function(){"use strict";if(!this.$RangedCallbackManager1){this.$RangedCallbackManager1=true;this.$RangedCallbackManager2=null;this.$RangedCallbackManager4.runPossibleCallbacks();}};i.prototype.hasReachedEndOfArray=function(){"use strict";return this.$RangedCallbackManager1;};i.prototype.setError=function(j){"use strict";if(this.$RangedCallbackManager2!==j){this.$RangedCallbackManager2=j;this.$RangedCallbackManager4.runPossibleCallbacks();}};i.prototype.getError=function(j,k,l){"use strict";var m=this.$RangedCallbackManager9({strict:l});return j+k>m.length?this.$RangedCallbackManager2:null;};i.prototype.hasResource=function(j){"use strict";return this.$RangedCallbackManager3[j];};i.prototype.getResourceAtIndex=function(j){"use strict";return this.$RangedCallbackManager0[j];};i.prototype.getAllResources=function(){"use strict";return this.$RangedCallbackManager0.concat();};i.prototype.getCurrentArraySize=function(j){"use strict";return this.$RangedCallbackManager9(j).length;};i.prototype.$RangedCallbackManager9=function(j){"use strict";var k=this.$RangedCallbackManager0;if(j&&j.strict){var l=j.skipOnStrictHandler||this.$RangedCallbackManager8;if(l)k=k.filter(l);}return k;};i.prototype.$RangedCallbackManager5=function(j,k){"use strict";var l=this.$RangedCallbackManager9(k);if(!this.$RangedCallbackManager1&&!this.$RangedCallbackManager2&&j.start+j.limit>l.length){return false;}else{var m=l.slice(j.start,j.start+j.limit),n=j.start+j.limit>l.length?this.$RangedCallbackManager2:null;return [m,n];}};i.prototype.getElementsUntil=function(j){"use strict";var k=[];for(var l=0;l<this.$RangedCallbackManager0.length;l++){var m=this.$RangedCallbackManager6(this.$RangedCallbackManager0[l]);if(this.$RangedCallbackManager7(m,j)>0)break;k.push(this.$RangedCallbackManager0[l]);}return k;};e.exports=i;},null);
__d("NotificationStore",["KeyedCallbackManager","NotificationConstants","NotificationUpdates","RangedCallbackManager","MercuryServerDispatcher"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=new g(),m=new j(function(q){var r=l.getResource(q);return r.creation_time;},function(q,r){return r-q;}),n={},o=null;i.subscribe('update-notifications',function(q,r){if(r.page_info)n=r.page_info;if(r.nodes===(void 0))return;var s,t=[],u={},v=r.nodes||[],w;v.forEach(function(x){s=x.alert_id;w=l.getResource(s);if(!w||w.creation_time<x.creation_time){t.push(s);u[s]=x;}});l.addResourcesAndExecute(u);m.addResources(t);i.didUpdateNotifications(t);});k.registerEndpoints({'/ajax/notifications/client/get.php':{mode:k.IMMEDIATE,handler:function(q){i.handleUpdate(h.PayloadSourceType.ENDPOINT,q);}}});var p={getNotifications:function(q,r){var s=m.executeOrEnqueue(0,q,function(z){var aa=l.executeOrEnqueue(z,r);}),t=m.getUnavailableResources(s);if(t.length){m.unsubscribe(s);if(!p.canFetchMore()){l.executeOrEnqueue(m.getAllResources(),r);return;}var u=n,v=(u&&u.end_cursor)||null,w;if(v){var x=Math.max.apply(null,t),y=m.getCurrentArraySize();w=x-y+1;}else w=q;k.trySend('/ajax/notifications/client/get.php',{businessID:o,cursor:v,length:w});}},getAll:function(q){p.getNotifications(p.getCount(),q);},getCount:function(){return m.getAllResources().length;},canFetchMore:function(){var q=n;return (!q||!q.hasOwnProperty('has_next_page')||q.has_next_page);},setBusinessID:function(q){o=q;}};e.exports=p;},null);
__d("NotificationInitialLoadController",["Arbiter","NotificationConstants","NotificationUpdates","NotificationSeenState","NotificationStore"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();b('NotificationSeenState');b('NotificationStore');function j(k){i.handleUpdate(h.PayloadSourceType.INITIAL_LOAD,k);g.inform('jewel/count-updated',{jewel:'notifications',count:k.nodes.length});}e.exports=j;},null);
__d("NotificationPhotoThumbnail",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();function g(i){if(!i.media||!i.style_list||!i.style_list.length)return null;switch(i.style_list[0]){case 'new_album':case 'album':case 'application':case 'photo':case 'video':case 'video_autoplay':case 'video_inline':return i.media.image;default:return null;}}var h={getThumbnail:function(i,j,k){var l;if(i&&i.length){l=g(i[0]);if(l)return l;}if(k){var m=k.relevant_comments;if(m&&m.length){var n=m[0].attachments;if(n&&n.length){l=g(n[0]);if(l)return l;}}}if(j){var o=j.attachments;if(o&&o.length)return g(o[0]);}return null;}};e.exports=h;},null);
__d("NotificationURI",["BusinessURI.brands","URI","isFacebookURI"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j={localize:function(k){k=g(k);if(!i(k))return k.toString();var l=k.getSubdomain();return k.getUnqualifiedURI().getQualifiedURI().setSubdomain(l).toString();},snowliftable:function(k){if(!k)return false;k=h(k);var l=k.getQueryData();return i(k)&&('fbid' in l||'v' in l);},isVaultSetURI:function(k){return this._areEquals(k,'/ajax/vault/sharer_preview.php');},isAlbumDraftRecoveryDialogURI:function(k){return this._areEquals(k,'/ajax/photos/upload/overlay/');},_areEquals:function(k,l){if(!k)return false;k=h(k);return i(k)&&k.getPath()===l;}};e.exports=j;},null);
__d("XNotificationsGenericNegativeFeedbackController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/notifications\/feedback\/generic\/negative\/",{notif_id:{type:"Int",required:true},undo:{type:"Bool",defaultValue:false}});},null);
__d("NotificationUserActions",["AsyncRequest","AsyncSignal","NotificationConstants","NotificationStore","NotificationTokens","NotificationUpdates","URI","XNotificationsGenericNegativeFeedbackController","createObjectFrom","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q=i.PayloadSourceType.USER_ACTION,r='mark_spam',s='turn_off',t='undo',u='original_subscription_level',v=false;function w(ca){var da=m('/ajax/notifications/mark_read.php').getQualifiedURI().toString();new h(da,ca).send();}function x(ca){var da={};ca.forEach(function(ea,fa){da['alert_ids['+fa+']']=ea;});return da;}function y(ca,da,ea,fa,ga){var ha=k.untokenizeIDs([ca])[0],ia={notification_id:ha,client_rendered:true,request_type:da};Object.assign(ia,ea);new g('/ajax/notifications/negative_req.php').setData(ia).setHandler(fa||p).setErrorHandler(ga||p).send();}function z(ca,da,ea,fa){var ga=n.getURIBuilder().setInt('notif_id',k.untokenizeIDs([ca])[0]).setBool('undo',fa).getURI(),ha=function(ia){if(fa){l.handleUpdate(q,{hiddenState:o([ca],false),gnfState:o([ca],false)});da();}else{var ja=ia.payload.show_after_ok;l.handleUpdate(q,{hiddenState:o([ca],!ja),gnfState:o([ca],true)});da(ia.payload.confirmation);}};new g(ga).setHandler(ha||p).setErrorHandler(ea||p).send();}function aa(ca,da,ea,fa,ga){var ha=ga?t:s;j.getAll(function(ia){var ja=Object.keys(ia).filter(function(ka){var la=ia[ka];return !!(la.application&&la.application.id&&la.application.id==da);});y(ca,ha,null,function(ka){ea(ka);l.handleUpdate(q,{hiddenState:o(ja,!ga)});},fa);});}var ba={markNotificationsAsSeen:function(ca){l.handleUpdate(q,{seenState:o(ca)});var da=k.untokenizeIDs(ca),ea=x(da);ea.seen=true;w(ea);},setNextIsFromReadButton:function(ca){v=ca;},markNotificationsAsRead:function(ca){l.handleUpdate(q,{readState:o(ca)});var da=k.untokenizeIDs(ca),ea=x(da);if(v){ea.from_read_button=true;v=false;}w(ea);},giveGenericNegativeFeedback:function(ca,da,ea){z(ca,da,ea,false);},undoGenericNegativeFeedback:function(ca,da,ea){z(ca,da,ea,true);},markNotificationAsHidden:function(ca,da,ea){l.handleUpdate(q,{hiddenState:o([ca])});y(ca,s,null,da,ea);},markNotificationAsVisible:function(ca,da,ea,fa){l.handleUpdate(q,{hiddenState:o([ca],false)});var ga=null;if(da!==null){ga={};ga[u]=da;}y(ca,t,ga,ea,fa);},markNotificationAsSpam:function(ca,da,ea){l.handleUpdate(q,{hiddenState:o([ca],true)});y(ca,r,null,da,ea);},markAppAsHidden:function(ca,da,ea,fa){var ga=false;aa(ca,da,ea,fa,ga);},markAppAsVisible:function(ca,da,ea,fa){var ga=true;aa(ca,da,ea,fa,ga);}};e.exports=ba;},null);
__d("SplitImage.react",["React","Image.react","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=g.createClass({displayName:"SplitImage",render:function(){var l=this.props.size;return (g.createElement("div",g.__spread({},this.props,{className:j(this.props.className,"_55lt"),style:Object.assign({},(this.props.style||{}),{width:l,height:l})}),this.renderImages()));},renderImages:function(){if(!this.props.srcs)return null;var l=this.props.srcs,m=Array.isArray(l);if(!m||l.length==1)return this.renderOne(m?l[0]:l);return l.length==2?this.renderTwo(l):this.renderThree(l);},renderOne:function(l){return (g.createElement(h,{src:l,width:this.props.size,height:this.props.size,alt:""}));},renderTwo:function(l){var m=this.props.size,n=Math.floor(m/2),o=-Math.floor(n/2),p=(("_55lu")+(this.props.border?' '+"_57xo":''));return (g.createElement("div",null,g.createElement("div",{className:"_55lu",style:{width:n}},g.createElement(h,{src:l[0],width:m,height:m,style:{marginLeft:o}})),g.createElement("div",{className:p,style:{width:n}},g.createElement(h,{src:l[1],width:m,height:m,style:{marginLeft:o}}))));},renderThree:function(l){var m=this.props.size,n=Math.floor(m/3*2),o=-Math.floor((m-n)/2),p=Math.floor(m/2),q=m-n,r=-Math.floor((p-q)/2),s=(("_55lu")+(this.props.border?' '+"_57pl":'')),t=(("_55lu")+(this.props.border?' '+"_57pm":''));return (g.createElement("div",null,g.createElement("div",{className:s,style:{width:n}},g.createElement(h,{src:l[0],width:m,height:m,style:{marginLeft:o}})),g.createElement("div",{className:t,style:{width:q,height:p}},g.createElement(h,{src:l[1],width:p,height:p,style:{marginLeft:r}})),g.createElement("div",{className:"_55lu",style:{width:q,height:p}},g.createElement(h,{src:l[2],width:p,height:p,style:{marginLeft:r}}))));}});e.exports=k;},null);
__d("FBOverlayBase.react",["React"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h=g.createClass({displayName:"FBOverlayBase",render:function(){return g.Children.only(this.props.children);}});e.exports=h;},null);
__d("FBOverlayElement.react",["React","cloneWithProps","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=g,l=k.PropTypes,m={horizontal:{left:"_32rg",right:"_32rh",fit:j("_32rg","_32rh")},vertical:{top:"_32ri",bottom:"_32rj",fit:j("_32ri","_32rj")}},n=g.createClass({displayName:"FBOverlayElement",propTypes:{horizontal:l.oneOf(['left','right','fit']),vertical:l.oneOf(['top','bottom','fit'])},getDefaultProps:function(){return {horizontal:'fit',vertical:'fit'};},render:function(){var o=j("_32rk",m.horizontal[this.props.horizontal],m.vertical[this.props.vertical]);return h(g.Children.only(this.props.children),{className:o});}});e.exports=n;},null);
__d("FBOverlayContainer.react",["FBOverlayBase.react","FBOverlayElement.react","React","cx","invariant","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=i.createClass({displayName:"FBOverlayContainer",propTypes:{children:function(n,o){var p=n[o],q=0;i.Children.forEach(p,function(r){if(r===null||r===(void 0))return;switch(r.type){case g:q++;break;case h:break;default:k(false);}});k(q===1);}},render:function(){return (i.createElement("div",i.__spread({},this.props,{className:l(this.props.className,"_23n-")}),this.props.children));}});e.exports=m;},null);
__d("InputLabel.react",["React","cx","invariant","joinClasses"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=g,l=k.PropTypes,m=0;function n(){return 'js_input_label_'+(m++);}var o=g.createClass({displayName:"InputLabel",propTypes:{display:l.oneOf(['block','inline'])},getDefaultProps:function(){return {display:'block'};},render:function(){i(this.props.children.length===2);var p=this.props.children[0],q=this.props.children[1],r=p.type==='input';p=g.cloneElement(p,{className:j(p.props.className,(("uiInputLabelInput")+(r&&p.props.type==='radio'?' '+"uiInputLabelRadio":'')+(r&&p.props.type==='checkbox'?' '+"uiInputLabelCheckbox":''))),id:p.props.id||n()});q=g.cloneElement(q,{className:j(q.props.className,'uiInputLabelLabel'),htmlFor:p.props.id});var s=(("uiInputLabel")+(' '+"clearfix")+(this.props.display==='inline'?' '+"inlineBlock":'')+(r?' '+"uiInputLabelLegacy":''));return (g.createElement("div",g.__spread({},this.props,{className:j(this.props.className,s)}),p,q));}});e.exports=o;},null);
__d("XUINotice.react",["React","Image.react","XUICloseButton.react","cx","fbt","ix","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();'use strict';var n=g,o=n.PropTypes,p={notify:{altText:k._("Notice"),className:null,iconSrc:l('/images/deprecated/glyphs/flat/info-flat_m.png')},success:{altText:k._("Success"),className:"_3qh4",iconSrc:l('/images/deprecated/glyphs/flat/checkmark_white_m.png')},warn:{altText:k._("Warning"),className:"_585o",iconSrc:l('/images/deprecated/glyphs/flat/error-flat_m.png')}},q=g.createClass({displayName:"XUINotice",propTypes:{onDismiss:o.func,use:o.oneOf(Object.keys(p)),size:o.oneOf(['medium','small'])},getDefaultProps:function(){return {use:'notify',size:'medium'};},render:function(){var r=this.props,s=r.children,t=r.className,u=r.onDismiss,v=r.use,w=(function(aa,ba){var ca={},da=Object.prototype.hasOwnProperty;if(aa==null)throw new TypeError();for(var ea in aa)if(da.call(aa,ea)&&!da.call(ba,ea))ca[ea]=aa[ea];return ca;})(r,{children:1,className:1,onDismiss:1,use:1}),x=p[v];t=m("_585n",x.className,t);var y=null;if(u)y=g.createElement(i,{className:"_585q",href:"#",onClick:u});var z=(("_585r")+(this.props.size==='medium'?' '+"_50f4":'')+(this.props.size==='small'?' '+"_50f3":''));return (g.createElement("div",g.__spread({},w,{className:t}),g.createElement(h,{alt:x.altText,className:"_585p",src:x.iconSrc}),y,g.createElement("div",{className:z},s)));}});e.exports=q;},null);
__d("XUIRadioInput.react",["React","cx","joinClasses","invariant"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=g.createClass({displayName:"XUIRadioInput",render:function(){j(!this.props.children||this.props.children.length===0);var l=i(this.props.className,"_55sh"),m=g.createElement("input",g.__spread({},this.props,{className:null,type:"radio"}),undefined);return (g.createElement("label",{className:l},m,g.createElement("span",null)));}});e.exports=k;},null);
__d("XUIRadioList.react",["InputLabel.react","React","ReactChildren","XUIRadioInput.react","cloneWithProps"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=h,m=l.PropTypes,n=h.createClass({displayName:"XUIRadioList",propTypes:{name:m.string,onValueChange:m.func,selectedValue:m.any},render:function(){var o=i.map(this.props.children,function(p){return k(p,{name:this.props.name,onSelect:this.props.onValueChange,selectedValue:this.props.selectedValue});},this);return h.createElement("ul",h.__spread({},this.props,{name:null}),o);}});n.Item=h.createClass({displayName:"Item",propTypes:{name:m.string,onSelect:m.func,selectedValue:m.any,value:m.any,disabled:m.bool},render:function(){return (h.createElement("li",{className:this.props.className},h.createElement(g,{display:"inline"},h.createElement(j,{checked:this.props.selectedValue===this.props.value,name:this.props.name,onChange:this._handleChange,value:this.props.value,disabled:!!this.props.disabled}),h.createElement("label",null,this.props.children))));},_handleChange:function(event){this.props.onSelect&&this.props.onSelect(event.target.value);}});e.exports=n;},null);
__d("XUITextInput.react",["AbstractTextInput.react","React","XUIError.react","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=h.createClass({displayName:"XUITextInput",propTypes:Object.assign({},g.propTypes,i.propTypes),render:function(){var m=(("_55r1")+(this.props.height=='tall'?' '+"_55r2":'')),n=(h.createElement(g,h.__spread({},this.props,{ref:"textInput",className:k(this.props.className,m)})));return (h.createElement(i,h.__spread({},this.props),n));},focusInput:function(){this.refs.textInput.focusInput();}});e.exports=l;},null);
__d("str2rstr",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();function g(h){var i="",j,k;for(var l=0;l<h.length;l++){j=h.charCodeAt(l);k=l+1<h.length?h.charCodeAt(l+1):0;if(55296<=j&&j<=56319&&56320<=k&&k<=57343){j=65536+((j&1023)<<10)+(k&1023);l++;}if(j<=127){i+=String.fromCharCode(j);}else if(j<=2047){i+=String.fromCharCode(192|((j>>>6)&31),128|(j&63));}else if(j<=65535){i+=String.fromCharCode(224|((j>>>12)&15),128|((j>>>6)&63),128|(j&63));}else if(j<=2097151)i+=String.fromCharCode(240|((j>>>18)&7),128|((j>>>12)&63),128|((j>>>6)&63),128|(j&63));}return i;}e.exports=g;},null);
__d("md5",["str2rstr"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();function h(u,v){var w=u[0],x=u[1],y=u[2],z=u[3];w=j(w,x,y,z,v[0],7,-680876936);z=j(z,w,x,y,v[1],12,-389564586);y=j(y,z,w,x,v[2],17,606105819);x=j(x,y,z,w,v[3],22,-1044525330);w=j(w,x,y,z,v[4],7,-176418897);z=j(z,w,x,y,v[5],12,1200080426);y=j(y,z,w,x,v[6],17,-1473231341);x=j(x,y,z,w,v[7],22,-45705983);w=j(w,x,y,z,v[8],7,1770035416);z=j(z,w,x,y,v[9],12,-1958414417);y=j(y,z,w,x,v[10],17,-42063);x=j(x,y,z,w,v[11],22,-1990404162);w=j(w,x,y,z,v[12],7,1804603682);z=j(z,w,x,y,v[13],12,-40341101);y=j(y,z,w,x,v[14],17,-1502002290);x=j(x,y,z,w,v[15],22,1236535329);w=k(w,x,y,z,v[1],5,-165796510);z=k(z,w,x,y,v[6],9,-1069501632);y=k(y,z,w,x,v[11],14,643717713);x=k(x,y,z,w,v[0],20,-373897302);w=k(w,x,y,z,v[5],5,-701558691);z=k(z,w,x,y,v[10],9,38016083);y=k(y,z,w,x,v[15],14,-660478335);x=k(x,y,z,w,v[4],20,-405537848);w=k(w,x,y,z,v[9],5,568446438);z=k(z,w,x,y,v[14],9,-1019803690);y=k(y,z,w,x,v[3],14,-187363961);x=k(x,y,z,w,v[8],20,1163531501);w=k(w,x,y,z,v[13],5,-1444681467);z=k(z,w,x,y,v[2],9,-51403784);y=k(y,z,w,x,v[7],14,1735328473);x=k(x,y,z,w,v[12],20,-1926607734);w=l(w,x,y,z,v[5],4,-378558);z=l(z,w,x,y,v[8],11,-2022574463);y=l(y,z,w,x,v[11],16,1839030562);x=l(x,y,z,w,v[14],23,-35309556);w=l(w,x,y,z,v[1],4,-1530992060);z=l(z,w,x,y,v[4],11,1272893353);y=l(y,z,w,x,v[7],16,-155497632);x=l(x,y,z,w,v[10],23,-1094730640);w=l(w,x,y,z,v[13],4,681279174);z=l(z,w,x,y,v[0],11,-358537222);y=l(y,z,w,x,v[3],16,-722521979);x=l(x,y,z,w,v[6],23,76029189);w=l(w,x,y,z,v[9],4,-640364487);z=l(z,w,x,y,v[12],11,-421815835);y=l(y,z,w,x,v[15],16,530742520);x=l(x,y,z,w,v[2],23,-995338651);w=m(w,x,y,z,v[0],6,-198630844);z=m(z,w,x,y,v[7],10,1126891415);y=m(y,z,w,x,v[14],15,-1416354905);x=m(x,y,z,w,v[5],21,-57434055);w=m(w,x,y,z,v[12],6,1700485571);z=m(z,w,x,y,v[3],10,-1894986606);y=m(y,z,w,x,v[10],15,-1051523);x=m(x,y,z,w,v[1],21,-2054922799);w=m(w,x,y,z,v[8],6,1873313359);z=m(z,w,x,y,v[15],10,-30611744);y=m(y,z,w,x,v[6],15,-1560198380);x=m(x,y,z,w,v[13],21,1309151649);w=m(w,x,y,z,v[4],6,-145523070);z=m(z,w,x,y,v[11],10,-1120210379);y=m(y,z,w,x,v[2],15,718787259);x=m(x,y,z,w,v[9],21,-343485551);u[0]=s(w,u[0]);u[1]=s(x,u[1]);u[2]=s(y,u[2]);u[3]=s(z,u[3]);}function i(u,v,w,x,y,z){v=s(s(v,u),s(x,z));return s((v<<y)|(v>>>(32-y)),w);}function j(u,v,w,x,y,z,aa){return i((v&w)|((~v)&x),u,v,y,z,aa);}function k(u,v,w,x,y,z,aa){return i((v&x)|(w&(~x)),u,v,y,z,aa);}function l(u,v,w,x,y,z,aa){return i(v^w^x,u,v,y,z,aa);}function m(u,v,w,x,y,z,aa){return i(w^(v|(~x)),u,v,y,z,aa);}function n(u){var v=u.length,w=[1732584193,-271733879,-1732584194,271733878],x;for(x=64;x<=u.length;x+=64)h(w,o(u.substring(x-64,x)));u=u.substring(x-64);var y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(x=0;x<u.length;x++)y[x>>2]|=u.charCodeAt(x)<<((x&3)<<3);y[x>>2]|=128<<((x&3)<<3);if(x>55){h(w,y);for(x=0;x<16;x++)y[x]=0;}y[14]=v*8;h(w,y);return w;}function o(u){var v=[],w=0;while(w<64)v[w>>2]=u.charCodeAt(w++)|(u.charCodeAt(w++)<<8)|(u.charCodeAt(w++)<<16)|(u.charCodeAt(w++)<<24);return v;}var p='0123456789abcdef'.split('');function q(u){var v='',w=0;for(;w<4;w++)v+=p[(u>>((w<<3)+4))&15]+p[(u>>(w<<3))&15];return v;}function r(u){for(var v=0;v<u.length;v++)u[v]=q(u[v]);return u.join('');}var s=function(u,v){return (u+v)&4294967295;};function t(u){if(null===u||(void 0)===u){return null;}else{for(var v=0;v<u.length;v++)if(u[v]>"\u007F"){u=g(u);break;}return r(n(u));}}if(t('hello')!='5d41402abc4b2a76b9719d911017c592')s=function(u,v){var w=(u&65535)+(v&65535),x=(u>>16)+(v>>16)+(w>>16);return (x<<16)|(w&65535);};e.exports=t;},null);
__d("PlatformDialogClient",["Arbiter","AsyncDialog","AsyncRequest","DOMEventListener","guid","PlatformBaseVersioning","PlatformDialog","PopupWindow","QueryString","URI","UserAgent_DEPRECATED"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();var r=575,s='FB_DIALOG_RESPONSE';h.getLoadingDialog().setWidth(r);j.add(window,'message',function(event){if((/\.facebook\.com$/).test(event.origin)&&new RegExp('^'+s+':').test(event.data))g.inform(m.RESPONSE,JSON.parse(event.data.substr(s.length+1)));});var t={};g.subscribe(m.RESPONSE,function(event,w){var x=w.state;if(t[x]){t[x].callback(w);w.state=t[x].state;delete t[x];}},g.SUBSCRIBE_NEW);function u(w){return function(){g.inform(m.RESPONSE,Object.assign({state:w},v.REQUEST_ABORTED_ERROR));};}var v={REQUEST_ABORTED_ERROR:{error_code:-200,error_message:'Request aborted.'},async:function(w,x,y){var z=k(),aa=x.state;x.state=z;x.redirect_uri=new p('/dialog/return/arbiter').setSubdomain('www').setFragment(o.encode({origin:x.redirect_uri})).getQualifiedURI().toString();x.display='async';t[z]={callback:y||function(){},state:aa};h.send(new i(this.getURI(w,x)).setMethod('GET').setReadOnly(true).setAbortHandler(u(z)));},popup:function(w,x,y,z,aa){var ba=k(),ca=y.state;y.state=ba;y.client_id=y.app_id=x;y.redirect_uri=new p('/dialog/return/arbiter').setSecure(p.getRequestURI().isSecure()).setSubdomain('www').setFragment(o.encode({origin:y.redirect_uri})).addQueryData(z||{}).addQueryData({relation:'opener',close:true}).toString();y.display=q.mobile()?'touch':'popup';t[ba]={callback:aa||function(){},state:ca};var da=p.getRequestURI(),ea=da.getDomain(),fa=ea.replace('developers','www');n.open(new p(this.getURI(w,y)).setDomain(fa).setProtocol('https').toString(),210,r);},getURI:function(w,x){if(x.version){var y=p('/'+x.version+'/dialog/'+w);delete x.version;return y.addQueryData(x);}return l.versionAwareURI(p('/dialog/'+w).addQueryData(x));}};e.exports=v;},null);
__d("mergeDeepInto",["invariant","mergeHelpers"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();"use strict";var i=h.ArrayStrategies,j=h.checkArrayStrategy,k=h.checkMergeArrayArgs,l=h.checkMergeLevel,m=h.checkMergeObjectArgs,n=h.isTerminal,o=h.normalizeMergeArg,p=function(t,u,v,w){m(t,u);l(w);var x=u?Object.keys(u):[];for(var y=0;y<x.length;y++){var z=x[y];r(t,u,z,v,w);}},q=function(t,u,v,w){k(t,u);l(w);var x=Math.max(t.length,u.length);for(var y=0;y<x;y++)r(t,u,y,v,w);},r=function(t,u,v,w,x){var y=u[v],z=u.hasOwnProperty(v),aa=z&&n(y),ba=z&&Array.isArray(y),ca=z&&!ba&&!ba,da=t[v],ea=t.hasOwnProperty(v),fa=ea&&n(da),ga=ea&&Array.isArray(da),ha=ea&&!ga&&!ga;if(fa){if(aa){t[v]=y;}else if(ba){t[v]=[];q(t[v],y,w,x+1);}else if(ca){t[v]={};p(t[v],y,w,x+1);}else if(!z)t[v]=da;}else if(ga){if(aa){t[v]=y;}else if(ba){g(i[w]);if(w===i.Clobber)da.length=0;q(da,y,w,x+1);}else if(ca){t[v]={};p(t[v],y,w,x+1);}else !z;}else if(ha){if(aa){t[v]=y;}else if(ba){t[v]=[];q(t[v],y,w,x+1);}else if(ca){p(da,y,w,x+1);}else !z;}else if(!ea)if(aa){t[v]=y;}else if(ba){t[v]=[];q(t[v],y,w,x+1);}else if(ca){t[v]={};p(t[v],y,w,x+1);}else !z;},s=function(t,u,v){var w=o(u);j(v);p(t,w,v,0);};e.exports=s;},null);
__d("mergeDeep",["mergeHelpers","mergeDeepInto"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();"use strict";var i=g.checkArrayStrategy,j=g.checkMergeObjectArgs,k=g.normalizeMergeArg,l=function(m,n,o){var p=k(m),q=k(n);j(p,q);i(o);var r={};h(r,p,o);h(r,q,o);return r;};e.exports=l;},null);
__d("StoreBasedStateMixinHelper",["SubscriptionsHandler","invariant"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';function i(j){h(j.length>0);this.$StoreBasedStateMixinHelper0=j;this.$StoreBasedStateMixinHelper1=new g();}i.prototype.subscribeCallback=function(j){var k=this.$StoreBasedStateMixinHelper0.map(function(l){if(l.hasChanged&&l.getDispatchToken&&l.addListener){return l.addListener(j);}else if(l.subscribe){return l.subscribe('change',j);}else if(l.addListener){return l.addListener('change',j);}else h(false);});this.$StoreBasedStateMixinHelper1.addSubscriptions.apply(this.$StoreBasedStateMixinHelper1,k);};i.prototype.release=function(){this.$StoreBasedStateMixinHelper1.release();};e.exports=i;},null);
__d("StoreAndPropBasedStateMixin",["StoreBasedStateMixinHelper","invariant","setImmediate"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=function(){for(var k=[],l=0,m=arguments.length;l<m;l++)k.push(arguments[l]);return {getInitialState:function(){return this.constructor.calculateState(this.props);},componentWillMount:function(){h(this.constructor.calculateState);this._recalculateStateID=null;var n=function(){if(this.isMounted())this.setState(this.constructor.calculateState(this.props));this._recalculateStateID=null;}.bind(this);this._mixin=new g(k);this._mixin.subscribeCallback(function(){if(this._recalculateStateID===null)this._recalculateStateID=i(n);}.bind(this));},componentWillReceiveProps:function(n){this.setState(this.constructor.calculateState(n));},componentWillUnmount:function(){this._mixin.release();this._mixin=null;}};}.bind(this);e.exports=j;},null);
__d("getNormalizedClientRect",["getDocumentScrollElement"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();"use strict";function h(i){var j=i.getBoundingClientRect(),k=0,l=0,m=g(i.ownerDocument),n=m.getBoundingClientRect();if(n.left>0){k=-n.left;}else{var o=m.scrollWidth+n.left,p=n.width;if(p>o)k=p-o;}if(n.top>0)l=-n.top;return {bottom:j.bottom+l,height:j.height,left:j.left+k,right:j.right+k,top:j.top+l,width:j.width};}e.exports=h;},null);
__d("URLMatcher",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g='!"#%&\'()*,-./:;<>?@[\\]^_`{|}',h='\u2000-\u206F\u00ab\u00bb\uff08\uff09',i='(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])',j='(?:(?:ht|f)tps?)://',k='(?:(?:'+i+'[.]){3}'+i+')',l='\\[(?:(?:[A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})\\]',m='(?:\\b)www\\d{0,3}[.]',n='[^\\s'+g+h+']',o='(?:(?:(?:[.:\\-_%@]|'+n+')*'+n+')|'+l+')',p='(?:[.][a-z]{2,4})',q='(?::\\d+){0,1}',r='(?=[/?#])',s='(?:'+'(?:'+j+o+q+')|'+'(?:'+k+q+')|'+'(?:'+l+q+')|'+'(?:'+m+o+p+q+')|'+'(?:'+o+p+q+r+')'+')',t='[/#?]',u='\\([^\\s()<>]+\\)',v='[^\\s()<>?#]+',w=new RegExp(s,'im'),x='^\\[[0-9]{1,4}:[0-9]{1,4}:[A-Fa-f0-9]{1,4}\\]',y=new RegExp(x,'im'),z='(?:'+'(?:'+t+')'+'(?:'+'(?:'+u+'|'+v+')*'+')*'+')*',aa=new RegExp('('+'(?:'+s+')'+'(?:'+z+')'+')','im'),ba=new RegExp('('+'(?:'+j+o+q+')|'+'(?:'+m+o+p+q+')'+')'),ca=/[\s'";]/,da=new RegExp(t,'im'),ea=new RegExp('[\\s!"#%&\'()*,./:;<>?@[\\]^`{|}\u00ab\u00bb\u2000-\u206F\uff08\uff09]','im'),fa=new RegExp('[\\s()<>?#]','im'),ga=new RegExp('\\s()<>'),ha=function(oa){if(oa&&oa.indexOf('@')!=-1){return (ba.exec(oa))?oa:null;}else return oa;},ia=function(oa){return ja(oa,aa);},ja=function(oa,pa){var qa=(pa.exec(oa)||[])[1]||null;return ha(qa);},ka=function(oa){return w.exec(oa);},la=function(oa){return !ca.test(oa.charAt(oa.length-1));},ma=function(oa){do{var pa=w.exec(oa);if(!pa)return null;var qa=false;if(pa[0][0]==='['&&pa.index>0&&oa[pa.index-1]==='@'){var ra=y.exec(pa[0]);if(ra){qa=true;oa=oa.substr(pa.index+ra[0].length);}}}while(qa);var sa=oa.substr(pa.index+pa[0].length);if(sa.length===0||!(da.test(sa[0])))return ha(pa[0]);var ta=0,ua=0,va=1,wa=0,xa=ua;for(var ya=1;ya<sa.length;ya++){var za=sa[ya];if(xa===ua){if(za==='('){wa=wa+1;xa=va;}else if(da.test(za)||!(ea.test(za))){ta=ya;}else if(fa.test(za))break;}else if(za==='('){wa=wa+1;}else if(za===')'){wa=wa-1;if(wa===0){xa=ua;ta=ya;}}else if(ga.test(za))break;}return ha(pa[0]+sa.substring(0,ta+1));},na={};na.permissiveMatch=ia;na.matchToPattern=ja;na.matchHost=ka;na.trigger=la;na.match=ma;e.exports=na;},null);
__d("PaymentMethodUtils",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g=16,h=4,i=[{pattern:/^5[1-5]/,name:'mc',cscDigits:3,digits:16,supported:true,code:77},{pattern:/^4/,name:'visa',cscDigits:3,digits:16,supported:true,code:86},{pattern:/^3[47]/,name:'amex',cscDigits:4,digits:15,supported:true,code:65},{pattern:/^35(2[8-9]|[3-8])/,name:'jcb',cscDigits:3,digits:16,supported:true,code:74},{pattern:/^(6011|65|64[4-9]|622([2-8]|1[3-9]|12[6-9]|9[0-1]|92[0-5]))/,name:'disc',cscDigits:3,digits:16,supported:true,code:68},{pattern:/^30[0-5]/,name:'diners',digits:14,cscDigits:3,supported:false,code:64},{name:'unknown',digits:16,cscDigits:3,supported:false,code:85}],j=function(l){return l.replace(/[iIl]/g,'1').replace(/[Oo]/g,'0').replace(/[^\d]/gi,'');},k={getCardType:function(l){l=j(l);l=l.substr(0,6);for(var m=0;m<i.length;m++)if(l.match(i[m].pattern))return i[m];},isValidCCNumber:function(l){l=j(l);var m=k.getCardType(l);if(m.digits!==l.length)return false;if(!m.supported)return false;return k.isValidLuhn(l);},isValidLuhn:function(l){l=j(l);var m=l.split('').reverse(),n='';for(var o=0;o<m.length;o++){var p=parseInt(m[o],10);if(o%2!==0)p=p*2;n=n+p;}var q=0;for(o=0;o<n.length;o++)q=q+parseInt(n.charAt(o),10);return !!(q!==0&&q%10===0);},getMaxCardLength:function(l){return g;},getMaxCSCLength:function(){return h;}};e.exports=k;},null);
__d("GamesAddToFavorites.react",["AsyncRequest","Animation","CSS","cx","fbt","Grid.react","Image.react","React","TooltipLink.react","xuiglyph"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q=l.GridItem,r=n.createClass({displayName:"GamesAddToFavorites",getInitialState:function(){return {isFavorite:this.props.isFavorite,isTransitioning:false};},setIsFavorite:function(s){clearTimeout(this.timeout);var t=s?'/ajax/bookmark/add/':'/ajax/bookmark/delete/';new g().setURI(t).setData({id:'app_'+this.props.appID}).setHandler(function(){this.setState({isFavorite:s,isTransitioning:s});}.bind(this)).send();},render:function(){if(this.state.isFavorite){var s=n.createElement(o,{alignH:"center",className:(("_cny")+(this.state.isTransitioning?' '+"hidden_elem":'')),onClick:function(){return this.setIsFavorite(false);}.bind(this),position:"below",ref:"favorited",tooltip:k._("Remove {app_name} from your bookmarks on News Feed.",[k.param("app_name",this.props.appName)])},n.createElement(l,{className:"_cnz",cols:2},n.createElement(q,null,n.createElement(m,{className:"_cn-",src:p({name:'checkmark',size:'medium'})})),n.createElement(q,null,n.createElement("span",{className:"_cn_"},k._("Added to Bookmarks"))))),t=n.createElement("a",{className:(("_cny")+(' '+"_co0")+(!this.state.isTransitioning?' '+"hidden_elem":'')),onClick:function(){return this.setIsFavorite(false);}.bind(this),ref:"transitioning"},n.createElement(l,{cols:2,style:{opacity:1},ref:"transitioningGrid"},n.createElement(q,null,n.createElement(m,{className:"_cn-",src:p({name:'checkmark',shade:'accent',size:'medium'})})),n.createElement(q,null,n.createElement("span",{className:"_cn_"},k._("Added to Bookmarks")))));if(this.state.isTransitioning)this.timeout=setTimeout(function(){new h(n.findDOMNode(this.refs.transitioningGrid)).to('opacity',.6).from(1).duration(500).ondone(function(){i.hide(n.findDOMNode(this.refs.transitioning));i.show(n.findDOMNode(this.refs.favorited));}.bind(this)).go();}.bind(this),1500);return (n.createElement("div",null,t,s));}else return (n.createElement(o,{alignH:"center",className:"_cny",onClick:function(){return this.setIsFavorite(true);}.bind(this),position:"below",tooltip:k._("Add {app_name} to your bookmarks to access it from your News Feed.",[k.param("app_name",this.props.appName)])},n.createElement(l,{className:"_cnz",cols:2},n.createElement(q,null,n.createElement(m,{className:"_cn-",src:p({name:'plus',size:'medium'})})),n.createElement(q,null,n.createElement("span",{className:"_cn_"},k._("Add to Bookmarks"))))));}});e.exports=r;},null);
__d("GiftCredits",["AsyncRequest","Dialog","URI"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j={dialog:null,callback:null,purchaseLock:false,purchaseLockExpiryThreshold:5000,purchaseLockTimeoutId:null,getPurchaseCreditPrompt:function(k,l,m,n){j.main(k,null,null,null,m,null,null,null,'BuyCredits',{},n);},redeemGiftcard:function(k,l,m){var n=i(document.location).setPath('/giftcards').toString();j.main(k,null,null,n,null,null,null,null,l,{},m);},getPrompt:function(k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha){j.main(k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha);},main:function(k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha){if(j.isPurchaseLocked())return false;j.setPurchaseLock(true);var ia={_path:'pay',method:'pay',display:'async',app_id:k,receiver:l,api_key:q,credits_purchase:x,action:s,next:n,dev_purchase_params:JSON.stringify(t),additional_params:JSON.stringify(u),order_info:JSON.stringify(m),product:v,package_id:w,request_id:y,sdk:z,quantity:aa,quantity_min:ba,quantity_max:ca,test_currency:da,pricepoint_id:ea,user:fa,user_hash:ga,ingame_gift_data:ha},ja=new g().setURI('/fbml/ajax/dialog/').setData(ia).setMethod('GET').setReadOnly(true).setStatusElement('commerce_get_more_loading');j.callback=o;j.dialog=new h().setAsync(ja).setModal(true).setCloseHandler(function(ka){j.setPurchaseLock(false);o(ka);}).show();},isPurchaseLocked:function(){return j.purchaseLock;},setPurchaseLock:function(k){j.purchaseLock=k;if(k){j.purchaseLockTimeoutId=setTimeout(function(){j.setPurchaseLock(false);},j.purchaseLockExpiryThreshold);}else clearTimeout(j.purchaseLockTimeoutId);return true;}};e.exports=j;},null);
__d("legacy:giftcredits",["GiftCredits"],function(a,b,c,d){b.__markCompiled&&b.__markCompiled();a.GiftCredits=b('GiftCredits');},3);
__d("MercuryLocalIDs",["PresenceUtil","randomInt"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';var i={generateMessageID:function(j){var k=j||Date.now(),l=h(0,4294967295),m=g.getSessionID();return ("<"+k+":"+l+"-"+m+"@mail.projektitan.com>");},generateThreadID:function(j){return 'root:'+i.generateMessageID(j);}};e.exports=i;},null);
__d("MercuryMessageObject",["MercuryActionStatus","MercuryActionType","MercuryIDs","MercuryLocalIDs","MercuryMessageClientState","MercuryMessageSourceTags","MercurySingletonMixin","MercurySourceType","MercuryTimePassed","MercurySendMessageFields","fbt","formatDate"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();function s(v){"use strict";this.$MercuryMessageObject0=v;}s.prototype.constructUserGeneratedMessageObject=function(v,w,x,y,z){"use strict";var aa=t(this.$MercuryMessageObject0,h.USER_GENERATED_MESSAGE,w,x);if(typeof v=='string')v=v.replace(/^\s+/,'').replace(/\s+$/,'');aa.body=v;aa.has_attachment=false;aa.html_body=false;aa.attachments=[];aa.specific_to_list=y||[];aa.creator_info=z;return aa;};s.prototype.constructStickerMessageObject=function(v,w,x){"use strict";var y=t(this.$MercuryMessageObject0,h.USER_GENERATED_MESSAGE,w,x);y.has_attachment=true;y.html_body=false;y.attachments=[];y.sticker_id=v;y.specific_to_list=[];return y;};s.prototype.constructAttachmentMessageObject=function(v,w){"use strict";var x=t(this.$MercuryMessageObject0,h.USER_GENERATED_MESSAGE,v,w);x.attachments=[];x.specific_to_list=[];return x;};s.prototype.constructLogMessageObject=function(v,w,x,y){"use strict";var z=t(this.$MercuryMessageObject0,h.LOG_MESSAGE,v,w);z.log_message_type=x;z.log_message_data=y;return z;};s.prototype.normalizeNewMessage=function(v){"use strict";if(v.status===undefined)v.status=g.UNSENT;v.timestamp_absolute=q._("Today");v.message_id=v.message_id||j.generateMessageID(v.timestamp);var w=i.getParticipantIDFromUserID(this.$MercuryMessageObject0);v.specific_to_list=v.specific_to_list||[];if(v.specific_to_list.length&&v.specific_to_list.indexOf(w)===-1)v.specific_to_list.push(w);if(!v.thread_id){if(v.specific_to_list.length==1){v.thread_id='user:'+this.$MercuryMessageObject0;}else if(v.specific_to_list.length==2){var x=v.specific_to_list[0]==w?v.specific_to_list[1]:v.specific_to_list[0];v.thread_id=i.getThreadIDFromParticipantID(x);}v.thread_id=v.thread_id||'root:'+v.message_id;}if(!v.specific_to_list.length){var y=i.tokenize(v.thread_id),z=y.type,aa=y.value;if(z=='user')v.specific_to_list=['fbid:'+aa,w];}if(!v[p.MANUAL_RETRY_CNT])v[p.MANUAL_RETRY_CNT]=0;};s.prototype.normalizeResendMessage=function(v){"use strict";v.status=g.RESENDING;v.timestamp=Date.now();v[p.MANUAL_RETRY_CNT]+=1;};s.prototype.normalizeAddAttachmentPlaceholder=function(v,w,x){"use strict";if(x.preview_attachments.length>0){v.has_attachment=true;v.preview_attachments=x.preview_attachments;}v.client_state=k.DO_NOT_SEND_TO_SERVER;v.status=g.RESENDING;v.upload_id=w;};function t(v,w,x,y){var z=u(x)?[l.CHAT]:[],aa=Date.now(),ba=r(new Date(aa),'g:ia'),ca={action_type:w,thread_id:y,author:i.getParticipantIDFromUserID(v),author_email:null,coordinates:null,timestamp:aa,timestamp_absolute:(new Date(aa)).toLocaleDateString(),timestamp_relative:ba,timestamp_time_passed:o.TODAY,is_unread:false,is_cleared:false,is_forward:false,is_filtered_content:false,is_spoof_warning:false,source:x,source_tags:z};return ca;}function u(v){switch(v){case n.CHAT_WEB:case n.CHAT_JABBER:case n.CHAT_IPHONE:case n.CHAT_MEEBO:case n.CHAT_ORCA:case n.CHAT_TEST:case n.CHAT:case n.DESKTOP:return true;default:return false;}}Object.assign(s,m);e.exports=s;},null);
__d("MercuryMessageActions",["CurrentUser","MercuryActionType","MercuryMessageObject","MercuryPayloadSource","MercuryServerRequests","MercurySingletonMixin"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';function m(n){this.$MercuryMessageActions0=n;this.$MercuryMessageActions1=i.getForFBID(this.$MercuryMessageActions0);this.$MercuryMessageActions2=k.getForFBID(this.$MercuryMessageActions0);}m.prototype.send=function(n,o,p){o=o||Function.prototype;this.$MercuryMessageActions1.normalizeNewMessage(n);this.$MercuryMessageActions2.handleUpdate(this.$MercuryMessageActions3(Object.assign({},n),j.CLIENT_SEND_MESSAGE));this.$MercuryMessageActions2.sendNewMessage(n,p);o(n.thread_id);};m.prototype.resend=function(n,o){var p=Object.assign({},n);this.$MercuryMessageActions1.normalizeResendMessage(p);this.send(p,(void 0),o);};m.prototype.addAttachmentPlaceholder=function(n,o,p){this.$MercuryMessageActions1.normalizeAddAttachmentPlaceholder(n,o,p);this.$MercuryMessageActions1.normalizeNewMessage(n);this.$MercuryMessageActions2.handleUpdate(this.$MercuryMessageActions3(Object.assign({},n),j.CLIENT_SEND_MESSAGE));};m.prototype.cancelAttachmentPlaceholder=function(n,o){this.$MercuryMessageActions2.handleUpdate(this.$MercuryMessageActions3({upload_id:n,upload_data:o,action_type:h.CANCEL_ATTACHMENT_PLACEHOLDER},j.CLIENT_SEND_MESSAGE));};m.prototype.confirmAttachmentPlaceholder=function(n,o){this.$MercuryMessageActions2.handleUpdate(this.$MercuryMessageActions3({upload_id:n,upload_data:o,action_type:h.CONFIRM_ATTACHMENT_PLACEHOLDER},j.CLIENT_SEND_MESSAGE));};m.addShareDataToExistingMessage=function(n,o,p,q){q=q||g.getID();m.getForFBID(q).addShareDataToExistingMessage(n,o,p);};m.prototype.addShareDataToExistingMessage=function(n,o,p){this.$MercuryMessageActions2.handleUpdate(this.$MercuryMessageActions4({server_id:n,attach_key:o,attach_data:p,action_type:h.ADD_SHARE_DATA_TO_EXISTING_MESSAGE},j.SERVER_ADD_SHARE_DATA_TO_EXISTING_MESSAGE));};m.prototype.markSpam=function(n,o){this.$MercuryMessageActions2.handleUpdate(this.$MercuryMessageActions5(n,o,h.MARK_MESSAGES_SPAM,j.CLIENT_MARK_MESSAGES_SPAM));};m.prototype["delete"]=function(n,o,p){this.$MercuryMessageActions2.handleUpdate(this.$MercuryMessageActions5(n,o,h.DELETE_MESSAGES,p||j.CLIENT_DELETE_MESSAGES));};m.prototype.$MercuryMessageActions3=function(n,o){return {actions:[n],from_client:true,payload_source:o};};m.prototype.$MercuryMessageActions4=function(n,o){return {actions:[n],from_client:false,payload_source:o};};m.prototype.$MercuryMessageActions5=function(n,o,p,q){return {actions:[{action_type:p,action_id:null,thread_id:n,message_ids:o}],from_client:true,payload_source:q};};Object.assign(m,l);e.exports=m;},null);
__d("MercuryThreadActions",["MercuryActionType","MercuryPayloadSource","MercuryServerRequests","MercurySingletonMixin","MessagingTag","merge"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';function m(n){this.$MercuryThreadActions0=n;this.$MercuryThreadActions1=i.getForFBID(this.$MercuryThreadActions0);}m.prototype.markRead=function(n,o){this.batchMarkRead([n],o);};m.prototype.batchMarkRead=function(n,o){this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions2(n,true,o));};m.prototype.markUnread=function(n,o){this.batchMarkUnread([n],o);};m.prototype.batchMarkUnread=function(n,o){this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions2(n,false,o));};m.prototype.markSeen=function(n,o){this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions3([n],g.MARK_THREAD_SEEN,h.CLIENT_MARK_THREAD_SEEN,{persistent:o}));};m.prototype.archive=function(n,o){this.batchArchive([n],o);};m.prototype.batchArchive=function(n,o){n.forEach(function(p){this.$MercuryThreadActions1.changeThreadArchivedStatus(p,true,o);}.bind(this));this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions4(n,true));};m.prototype.unarchive=function(n,o){this.batchUnarchive([n],o);};m.prototype.batchUnarchive=function(n,o){n.forEach(function(p){this.$MercuryThreadActions1.changeThreadArchivedStatus(p,false,o);}.bind(this));this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions4(n,false));};m.prototype.markSpam=function(n,o){this.batchMarkSpam([n],o);};m.prototype.batchMarkSpam=function(n,o){n.forEach(function(p){this.$MercuryThreadActions1.markThreadSpam(p,o);}.bind(this));this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions5(n,k.SPAM));};m.prototype.unmarkSpam=function(n,o){this.batchUnmarkSpam([n],o);};m.prototype.batchUnmarkSpam=function(n,o){n.forEach(function(p){this.$MercuryThreadActions1.unmarkThreadSpam(p,o);}.bind(this));this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions5(n,k.INBOX));};m.prototype.changeFolder=function(n,o){this.batchChangeFolder([n],o);};m.prototype.batchChangeFolder=function(n,o){n.forEach(function(p){this.$MercuryThreadActions1.changeThreadFolder(p,o);}.bind(this));this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions5(n,o));};m.prototype["delete"]=function(n,o){this.batchDelete([n],o);};m.prototype.batchDelete=function(n,o){n.forEach(function(p){this.$MercuryThreadActions1.deleteThread(p,o);}.bind(this));this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions3(n,g.DELETE_THREAD,h.CLIENT_DELETE_THREAD));};m.prototype.unmute=function(n){this.updateMuteSetting(n,0);};m.prototype.updateMuteSetting=function(n,o){this.$MercuryThreadActions1.changeMutingOnThread(n,o);this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions3([n],g.CHANGE_MUTE_SETTINGS,h.CLIENT_CHANGE_MUTE_SETTINGS,{mute_settings:o}));};m.prototype.addParticipants=function(n,o){this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions3([n],g.ADD_PARTICIPANTS,h.CLIENT_ADD_PARTICIPANTS,{participants:o}));};m.prototype.unpinThread=function(n){this.$MercuryThreadActions1.unpinThread(n);this.$MercuryThreadActions1.handleUpdate(this.$MercuryThreadActions3([n],g.UNPIN_THREAD,h.CLIENT_UNPIN_THREAD));};m.prototype.$MercuryThreadActions2=function(n,o,p){return this.$MercuryThreadActions3(n,g.CHANGE_READ_STATUS,h.CLIENT_CHANGE_READ_STATUS,{mark_as_read:o,source:p});};m.prototype.$MercuryThreadActions4=function(n,o){return this.$MercuryThreadActions3(n,g.CHANGE_ARCHIVED_STATUS,h.CLIENT_CHANGE_ARCHIVED_STATUS,{archived:o});};m.prototype.$MercuryThreadActions5=function(n,o){return this.$MercuryThreadActions3(n,g.CHANGE_FOLDER,h.CLIENT_CHANGE_FOLDER,{new_folder:o});};m.prototype.$MercuryThreadActions3=function(n,o,p,q){return {actions:n.map(function(r){return l({action_type:o,action_id:null,thread_id:r},q);}),from_client:true,payload_source:p};};Object.assign(m,j);e.exports=m;},null);
__d("MercuryFolders",["MessagingTag","arrayContains"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i=[g.INBOX,g.OTHER,g.ACTION_ARCHIVED,g.SPAM],j={getSupportedFolders:function(){return i.concat();},isSupportedFolder:function(k){return h(i,k);},getFromMeta:function(k){var l=k.folder;if(k.is_archived)l=g.ACTION_ARCHIVED;return l;}};e.exports=j;},null);
__d("MercuryUnreadState",["MercuryFolders","LogHistory","KeyedCallbackManager","MercuryActionType","MercuryGlobalActionType","MercurySingletonMixin","MercuryThreadlistConstants","MessagingTag","MercuryServerRequests","MercuryThreadInformer","MercuryThreads","arrayContains","copyProperties","createObjectFrom"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){b.__markCompiled&&b.__markCompiled();var u=(g.getSupportedFolders()||[]).filter(function(ma){return ma!=n.ACTION_ARCHIVED;}),v='unread_thread_hash',w='unseen_thread_list',x=m.MAX_UNREAD_COUNT,y=h.getInstance('mercury_unread_state');function z(ma){this._fbid=ma;this._serverRequests=o.getForFBID(this._fbid);this._threadInformer=p.getForFBID(this._fbid);this._threads=q.getForFBID(this._fbid);this._allReadTimestamp={};this._threadReadTimestamp={};this._initialUnreadCount={};this._maxCount={};this._unreadResources={};u.forEach(function(na){this._initialUnreadCount[na]=0;this._maxCount[na]=false;this._unreadResources[na]=new i();}.bind(this));this._serverRequests.subscribe('update-unread',function(na,oa){ea(this,oa);var pa=oa.global_actions||[];for(var qa=0;qa<pa.length;qa++){var ra=pa[qa];if(ra.action_type==k.MARK_ALL_READ)ha(this,ra.folder,ra.timestamp);}}.bind(this));this._serverRequests.subscribe('update-thread-ids',function(na,oa){ja(this,oa);}.bind(this));}s(z.prototype,{getUnreadCount:function(ma){if(this.exceedsMaxCount(ma)){y.error('unguarded_unread_count_fetch',{});return 0;}return da(this,ma);},exceedsMaxCount:function(ma){return this._maxCount[ma]||(da(this,ma)>x);},markFolderAsRead:function(ma){if(this._maxCount[ma]||da(this,ma)>0)this._serverRequests.markFolderAsRead(ma);}});s(z,l);function aa(ma,na,oa){ma._unreadResources[na].setResource(v,oa);ma._unreadResources[na].setResource(w,Object.keys(oa));}function ba(ma,na,oa){var pa=ma._unreadResources[na].executeOrEnqueue(v,oa),qa=ma._unreadResources[na].getUnavailableResources(pa);if(qa.length)ma._serverRequests.fetchUnreadThreadIDs(na);}function ca(ma,na){return ma._unreadResources[na].getResource(v);}function da(ma,na){var oa=ma._unreadResources[na].getResource(w);if(oa){return oa.length;}else return ma._initialUnreadCount[na];}function ea(ma,na){var oa;(na.unread_thread_fbids||[]).forEach(function(pa){oa=pa.folder;if(!la(oa))return;var qa=pa.thread_fbids||[];qa=qa.concat(pa.other_user_fbids||[]);var ra=ia(ma,qa);aa(ma,oa,t(ra,true));if(ra.length>x)ma._maxCount[oa]=true;ma._threadInformer.updatedUnreadState();});(na.message_counts||[]).forEach(function(pa){if(pa.unread_count===(void 0))return;oa=pa.folder;if(pa.unread_count>x){ma._maxCount[oa]=true;aa(ma,oa,{});ma._threadInformer.updatedUnreadState();}else{ma._initialUnreadCount[oa]=pa.unread_count;if(ma._initialUnreadCount[oa]===0)aa(ma,oa,{});ma._threadInformer.updatedUnreadState();}});(na.actions||[]).forEach(function(pa){if(pa.is_forward)return;var qa=j,ra=pa.other_user_fbid?pa.other_user_fbid:pa.thread_fbid,sa=pa.thread_id?pa.thread_id:ra;if(pa.action_type==qa.DELETE_THREAD){u.forEach(function(ua){ga(ma,ua,sa);});}else if(pa.action_type==qa.CHANGE_ARCHIVED_STATUS||pa.action_type==qa.CHANGE_FOLDER){var ta=ma._threads.getThreadMetaNow(pa.thread_id);oa=g.getFromMeta(ta);if(la(oa)&&ta.unread_count>0)fa(ma,oa,sa);u.forEach(function(ua){if(ua!=oa)ga(ma,ua,sa);});}else{oa=ka(ma,pa);if(!la(oa))return;if(pa.action_type==qa.CHANGE_READ_STATUS){if(pa.mark_as_read){ga(ma,oa,sa,pa.timestamp);}else fa(ma,oa,sa,pa.timestamp);}else if(pa.action_type==qa.USER_GENERATED_MESSAGE||pa.action_type==qa.LOG_MESSAGE)if(pa.is_unread)fa(ma,oa,sa,pa.timestamp);}});}function fa(ma,na,oa,pa){if(ma._maxCount[na])return;ba(ma,na,function(qa){var ra=ma._allReadTimestamp[na]||0,sa=ma._threadReadTimestamp[oa]||0,ta=pa||Number.POSITIVE_INFINITY;if(ta>=ra&&ta>=sa&&!qa[oa]){qa[oa]=pa||0;aa(ma,na,qa);ma._threadInformer.updatedUnreadState();}});}function ga(ma,na,oa,pa){if(ma._maxCount[na])return;ba(ma,na,function(qa){if(pa){var ra=ma._threadReadTimestamp[oa];if(!ra||ra<pa)ma._threadReadTimestamp[oa]=pa;}var sa=qa[oa];if(pa&&typeof sa=='number'&&pa<sa)return;if(oa in qa){delete qa[oa];aa(ma,na,qa);ma._threadInformer.updatedUnreadState();}});}function ha(ma,na,oa){ma._maxCount[na]=false;aa(ma,na,{});ma._allReadTimestamp[na]=Math.max(ma._allReadTimestamp[na]||0,oa||0);ma._threadInformer.updatedUnreadState();}function ia(ma,na){return na.map(ma._serverRequests.convertThreadIDIfAvailable,ma._serverRequests);}function ja(ma,na){u.forEach(function(oa){var pa=ca(ma,oa);if(!pa)return;for(var qa in na){var ra=na[qa];if(pa[qa]){pa[ra]=pa[qa];delete pa[qa];}}aa(ma,oa,pa);});}function ka(ma,na){var oa=na.thread_id?ma._threads.getThreadMetaNow(na.thread_id):null;return oa?g.getFromMeta(oa):na.folder;}function la(ma){return r(u,ma);}e.exports=z;},null);
__d("MercuryLeftNav",["Arbiter","MessagingTag","NavigationMessage","MercuryThreadInformer","MercuryUnreadState"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j=b('MercuryThreadInformer').get(),k=b('MercuryUnreadState').get(),l=false;function m(){var o=k.getUnreadCount(h.INBOX);g.inform(i.NAVIGATION_COUNT_UPDATE,{key:'inbox',hide:true});g.inform(i.NAVIGATION_COUNT_UPDATE,{key:'inbox',count:o});}var n={bootstrap:function(){if(l)return;j.subscribe('unread-updated',m);l=true;}};e.exports=n;},null);
__d("P2PMercuryAttachmentSnippet.react",["CurrentUser","Image.react","React","cx","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=i,n=m.PropTypes,o=i.createClass({displayName:"P2PMercuryAttachment",propTypes:{sender:n.object,receiver:n.object,amount:n.string,currency:n.string},getDefaultProps:function(){return {sender:{},receiver:{}};},render:function(){var p;if(g.getID()===this.props.sender.id){p=k._("You sent {currency}{amount}.",[k.param("currency",this.props.currency),k.param("amount",this.props.amount)]);}else p=k._("{name} sent you {currency}{amount}.",[k.param("name",this.props.sender.name),k.param("currency",this.props.currency),k.param("amount",this.props.amount)]);return (i.createElement("span",{className:"uiIconText _3l6h _3_io"},i.createElement(h,{height:12,src:l('/images/p2p/attachment-snippet-icon.png'),width:12}),p));}});e.exports=o;},null);
__d("MercuryShareAttachmentReactShape",["React"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';var h=g,i=h.PropTypes;function j(){return i.shape({description:i.string,media:i.shape({image:i.string,duration:i.number,playable:i.bool,source:i.string}),source:i.string,style_list:i.arrayOf(i.string),subattachments:i.Object,title:i.string,properties:i.Object,uri:i.string}).isRequired;}e.exports=j;},null);
__d("MercuryFallbackShareAttachmentSnippet.react",["Image.react","React","cx","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=h,m=l.PropTypes,n=h.createClass({displayName:"MercuryFallbackShareAttachmentSnippet",propTypes:{isSenderViewer:m.bool,senderName:m.string},render:function(){var o;if(this.props.isViewerSender){o=(j._("You shared a link"));}else o=(j._("{sender name} shared a link.",[j.param("sender name",this.props.senderName)]));return (h.createElement("span",{className:"uiIconText _3l6h"},h.createElement(g,{src:k('/images/messaging/docs/generic.png')}),o));}});e.exports=n;},null);
__d("P2PMercuryShareAttachmentSnippet.react",["MercuryShareAttachmentReactShape","P2PMercuryAttachmentSnippet.react","React"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=i.createClass({displayName:"P2PMercuryShareAttachmentSnippet",propTypes:{attachment:g()},render:function(){var k=this.props.attachment?this.props.attachment.target:{};return (i.createElement(h,i.__spread({},k)));}});e.exports=j;},null);
__d("MercuryShareAttachmentSnippet.react",["Map","MercuryShareAttachmentReactShape","React","StoryAttachmentStyle","MercuryFallbackShareAttachmentSnippet.react","P2PMercuryShareAttachmentSnippet.react"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();'use strict';var k=i,l=k.PropTypes,m=new g();m.set(j.FALLBACK,b('MercuryFallbackShareAttachmentSnippet.react'));m.set(j.ORION,b('P2PMercuryShareAttachmentSnippet.react'));var n=i.createClass({displayName:"MercuryShareAttachmentSnippet",propTypes:{attachment:h(),isSenderViewer:l.bool,senderName:l.string},render:function(){var o=this.props.attachment;if(!o.style_list)return null;var p=null;for(var q=0;q<o.style_list.length;q++){p=m.get(o.style_list[q]);if(p)break;}if(!p)return null;return (i.createElement(p,i.__spread({},this.props)));}});e.exports=n;},null);
__d("ImageSourceType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={PROFILE_PICTURE:'profile_picture',IMAGE:'image'};e.exports=g;},null);
__d("ImageSourceRequest",["CurrentUser","ImageSourceType","KeyedCallbackManager","PhotoResizeModeConst","MercuryServerDispatcher","arrayContains","extendArray"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();function n(){"use strict";this._request={fbid:null,type:null,width:null,height:null,resize_mode:null};this._callback=null;}n.prototype.setFBID=function(r){"use strict";this._request.fbid=r;return this;};n.prototype.setType=function(r){"use strict";if(!l([h.PROFILE_PICTURE,h.IMAGE],r))throw new TypeError('ImageSourceRequest.setType: invalid type '+r);this._request.type=r;return this;};n.prototype.setDimensions=function(r,s){"use strict";this._request.width=r;this._request.height=s;return this;};n.prototype.setResizeMode=function(r){"use strict";if(!l([j.COVER,j.CONTAIN],r))throw new TypeError('ImageSourceRequest.setResizeMode: invalid resize mode '+r);this._request.resize_mode=r;return this;};n.prototype.setCallback=function(r){"use strict";this._callback=r;return this;};n.prototype.send=function(){"use strict";if(!this._request.fbid||!this._request.width||!this._request.height||!this._request.type||!this._request.resize_mode||!this._callback)throw new Error('ImageSourceRequest: You must set all the fields');var r=p(),s=q(this._request);r.executeOrEnqueue(s,this._callback);if(r.getUnavailableResourcesFromRequest(s).length===1){k.trySend('/ajax/image_source.php',{requests:[this._request]});return true;}return false;};var o=null;function p(){if(o)return o;var r=new i();o=r;k.registerEndpoints({'/ajax/image_source.php':{request_user_id:g.getID(),mode:k.BATCH_DEFERRED_MULTI,batch_function:function(s,t){m(s.requests,t.requests);return s;},handler:function(s,t){var u=t.getData().requests;for(var v=0;v<u.length;++v)r.setResource(q(u[v]),s[v]);}}});return r;}function q(r){return [r.fbid,r.type,r.width,r.height,r.resize_mode].join('|');}e.exports=n;},null);
__d("MercuryParticipantFetcher",["MercuryIDs","MercuryPayloadSource","MercuryServerRequests","Set","ShortProfiles","setImmediate"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';function m(o){this.$MercuryParticipantFetcher0=i.getForFBID(o);this.$MercuryParticipantFetcher1=false;this.$MercuryParticipantFetcher2=new j();this.$MercuryParticipantFetcher3=new j();}m.prototype.fetch=function(o){this.$MercuryParticipantFetcher4(o);this.$MercuryParticipantFetcher5();};m.prototype.fetchMulti=function(o){o.forEach(function(p){return this.$MercuryParticipantFetcher4(p);}.bind(this));this.$MercuryParticipantFetcher5();};m.prototype.$MercuryParticipantFetcher4=function(o){if(!this.$MercuryParticipantFetcher3.has(o))this.$MercuryParticipantFetcher2.add(o);};m.prototype.$MercuryParticipantFetcher5=function(){if(this.$MercuryParticipantFetcher1||this.$MercuryParticipantFetcher2.size===0)return;this.$MercuryParticipantFetcher1=true;l(function(){this.$MercuryParticipantFetcher1=false;this.$MercuryParticipantFetcher2.forEach(function(o){return this.$MercuryParticipantFetcher3.add(o);}.bind(this));this.$MercuryParticipantFetcher6(this.$MercuryParticipantFetcher2,function(o){o.forEach(function(p){return this.$MercuryParticipantFetcher3["delete"](p.id);}.bind(this));this.$MercuryParticipantFetcher7(o);}.bind(this));this.$MercuryParticipantFetcher2.clear();}.bind(this));};m.prototype.$MercuryParticipantFetcher6=function(o,p){var q=[];o.forEach(function(r){var s=g.tokenize(r),t=s.type,u=s.value;t==='fbid'&&q.push(u);});if(q.length>0)k.getMulti(q,function(r){var s=[];for(var t in r)s.push(n(r[t],t));p(s);});};m.prototype.$MercuryParticipantFetcher7=function(o){this.$MercuryParticipantFetcher0.handleUpdate({participants:o,from_client:false,payload_source:h.SERVER_FETCH_PARTICIPANTS});};function n(o,p){var q=Object.assign({gender:o.gender,href:o.uri,id:g.getParticipantIDFromUserID(o.id||p),image_src:o.thumbSrc,name:o.name,short_name:o.firstName,employee:o.employee,is_employee_away:o.is_employee_away,type:o.type,vanity:o.vanity,is_friend:o.is_friend,is_messenger_user:o.is_messenger_user,orion_eligible:o.orionEligible,social_snippets:o.social_snippets},{});if(o.officeStatus){q.officeStatus=o.officeStatus;q.officeStatusStartDate=o.officeStatusStartDate;q.officeStatusEndDate=o.officeStatusEndDate;q.officeStatusComment=o.officeStatusComment;q.officeStatusLocation=o.officeStatusLocation;}return q;}e.exports=m;},null);
__d("MercuryParticipants",["CurrentUser","EventEmitter","ImageSourceRequest","ImageSourceType","ImmutableObject","KeyedCallbackManager","Map","MercuryAssert","MercuryIDs","MercuryParticipantFetcher","MercuryParticipantTypes","MercuryParticipantsConstants","MercuryServerRequests","PhotoResizeModeConst","Set","fbt","mapObject"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){b.__markCompiled&&b.__markCompiled();'use strict';var x='change';function y(aa){this.$MercuryParticipants0=aa;this.$MercuryParticipants1=new h();this.$MercuryParticipants2=new l();this.$MercuryParticipants3=new p(this.$MercuryParticipants0);this.$MercuryParticipants4=new m();this.$MercuryParticipants5=s.getForFBID(this.$MercuryParticipants0);this.$MercuryParticipants5.subscribe('update-participants',function(ba,ca){if(ca.participants&&ca.participants.length>0){var da={};ca.participants.forEach(function(ea){da[ea.id]=ea;});this.$MercuryParticipants6(da);}}.bind(this));}y.prototype.addListener=function(aa,ba){return this.$MercuryParticipants1.addListener(aa,ba);};y.prototype.getIDFromVanityOrFBID=function(aa){if(!aa)return;if(this.$MercuryParticipants4.has(aa))return this.$MercuryParticipants4.get(aa);if(/^\d+$/.test(aa))return o.getParticipantIDFromUserID(aa);};y.prototype.getNow=function(aa){return this.$MercuryParticipants7(aa);};y.prototype.getOrFetch=function(aa){var ba=this.$MercuryParticipants7(aa);if(!ba)this.$MercuryParticipants3.fetch(aa);return ba;};y.prototype.get=function(aa,ba){n.isParticipantID(aa);return this.$MercuryParticipants8([aa],function(ca){ba(ca[aa]);});};y.prototype.getMulti=function(aa,ba){return this.$MercuryParticipants8(aa,ba);};y.prototype.getBigImageMulti=function(aa,ba){n.allParticipantIDs(aa);var ca=r.BIG_IMAGE_SIZE;return this.$MercuryParticipants8(aa,function(da){var ea={},fa=0,ga=new u(),ha=function(la,ma){fa++;ea[la]=ma;if(fa===aa.length){ba(ea);if(ga.size>0)this.$MercuryParticipants9(ga);}}.bind(this),ia=function(la,ma){this.$MercuryParticipants2.setResource(la,k.set(this.$MercuryParticipants2.getResource(la),{big_image_src:ma.uri}));ga.add(la);ha(la,ma.uri);}.bind(this);for(var ja in da){var ka=da[ja];if(!ka.big_image_src){new i().setFBID(o.getUserIDFromParticipantID(ja)).setType(j.PROFILE_PICTURE).setDimensions(ca,ca).setResizeMode(t.COVER).setCallback(ia.bind(null,ja)).send();}else ha(ka.id,ka.big_image_src);}}.bind(this));};y.prototype.getOrderedBigImageMulti=function(aa,ba){return this.getBigImageMulti(aa,function(ca){ba(aa.map(function(da){return ca[da];}));});};y.prototype.$MercuryParticipants8=function(aa,ba){n.allParticipantIDs(aa);var ca=this.$MercuryParticipants2.executeOrEnqueue(aa,ba),da=this.$MercuryParticipants2.getUnavailableResources(ca).filter(function(ea){var fa=o.tokenize(ea),ga=fa.type,ha=fa.value;if(ga==='email'){this.$MercuryParticipantsa(ea,ha);return false;}return true;}.bind(this));this.$MercuryParticipants3.fetchMulti(da);return this.$MercuryParticipantsb(ca);};y.prototype.$MercuryParticipants7=function(aa){var ba=this.$MercuryParticipants2.getResource(aa);if(!ba){var ca=o.tokenize(aa),da=ca.type,ea=ca.value;if(da==='email')ba=this.$MercuryParticipantsa(aa,ea);}return ba;};y.prototype.$MercuryParticipantsa=function(aa,ba){var ca=new k(z(aa,ba));this.$MercuryParticipants2.setResource(aa,ca);return ca;};y.prototype.$MercuryParticipants9=function(aa){this.$MercuryParticipants1.emit(x,aa);};y.prototype.$MercuryParticipants6=function(aa){aa=w(aa,function(ba,ca){if(ba.vanity)this.$MercuryParticipants4.set(ba.vanity,ca);return new k(this.$MercuryParticipantsc(ba));}.bind(this));this.$MercuryParticipants2.addResourcesAndExecute(aa);this.$MercuryParticipants9(new u(Object.keys(aa)));};y.prototype.$MercuryParticipantsc=function(aa){var ba=aa.type===q.USER||aa.type===q.FRIEND;if(!ba)return aa;if(!aa.name&&!aa.href&&!aa.vanity){var ca=v._("Facebook User");aa.name=ca;aa.short_name=ca;}return aa;};y.prototype.$MercuryParticipantsb=function(aa){return {remove:function(){this.$MercuryParticipants2.unsubscribe(aa);}.bind(this)};};function z(aa,ba){return {gender:r.UNKNOWN_GENDER,href:null,id:aa,image_src:r.EMAIL_IMAGE,big_image_src:r.EMAIL_IMAGE,name:ba,short_name:ba,employee:false};}e.exports=new y(g.getID());},null);
__d("MercuryAttachmentSnippet.react",["EmoticonsList","Image.react","MercuryAttachment","MercuryAttachmentType","MercuryConstants","MercuryIDs","P2PMercuryAttachmentSnippet.react","MercuryShareAttachmentSnippet.react","MercuryParticipants","React","StickerConstants","TextWithEmoticons.react","cx","fbt","ix","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){b.__markCompiled&&b.__markCompiled();'use strict';var w=p,x=w.PropTypes,y=p.createClass({displayName:"MercuryAttachmentSnippet",propTypes:{thread:x.object.isRequired,viewer:x.string.isRequired},componentWillMount:function(){this._ensureParticipant(this.props.thread.snippet_sender);this._setVariables(this.props);},componentWillReceiveProps:function(da){this._ensureParticipant(da.thread.snippet_sender);this._setVariables(da);},componentWillUnmount:function(){this._cancelParticipantFetch();},render:function(){var da=this._getSenderName();if(this._hasOnlyPhotos())return this._renderPhotoSnippet(da);if(this._hasOnlyAnimatedImages())return this._renderAnimatedImageSnippet(da);if(this._hasOnlyVideo())return this._renderVideoSnippet(da);if(this._hasAudioClip())return this._renderAudioClipSnippet(da);if(this._hasSticker())return this._renderStickerSnippet(da);if(this._hasOrion())return this._renderOrionSnippet(da);if(this._hasShoerackInvitation())return this._renderShoerackInvitationSnippet(da);if(this._hasShare())return this._renderShareSnippet(da);if(this._hasError())return this._renderError(da);return this._renderMixedSnippet(da);},_renderPhotoSnippet:function(da){var ea;if(this._photos.length===1){if(this._isViewerSender){ea=(t._("You sent a photo."));}else ea=(t._("{name} sent a photo.",[t.param("name",da)]));}else if(this._isViewerSender){ea=(t._({"*":"You sent {num_photos} photos."},[t.param("num_photos",this._photos.length,[0])]));}else ea=(t._({"*":"{name} sent {num_photos} photos."},[t.param("name",da),t.param("num_photos",this._photos.length,[0])]));return this._renderSnippet(ea);},_renderAnimatedImageSnippet:function(da){var ea;if(this._animatedImages.length===1){if(this._isViewerSender){ea=(t._("You sent a GIF."));}else ea=(t._("{name} sent a GIF.",[t.param("name",da)]));}else if(this._isViewerSender){ea=(t._("You sent {num_animated_images} GIFs.",[t.param("num_animated_images",this._animatedImages.length)]));}else ea=(t._("{name} sent {num_animated_images} GIFs.",[t.param("name",da),t.param("num_animated_images",this._animatedImages.length)]));return this._renderSnippet(ea);},_renderVideoSnippet:function(da){var ea;if(this._isViewerSender){ea=(t._("You sent a video."));}else ea=(t._("{sender name} sent a video.",[t.param("sender name",da)]));return this._renderSnippet(ea);},_renderAudioClipSnippet:function(da){var ea;if(this._isViewerSender){ea=(t._("You sent a voice message."));}else ea=(t._("{name} sent a voice message.",[t.param("name",da)]));return this._renderSnippet(ea);},_renderStickerSnippet:function(da){if(ba(this._attachments[0].metadata.stickerID)){return (p.createElement(r,{renderEmoticons:true,text:g.symbols.like}));}else if(this._isViewerSender){return (p.createElement("span",null,t._("You sent a sticker.")));}else return (p.createElement("span",null,t._("{name} sent a sticker.",[t.param("name",da)])));},_renderOrionSnippet:function(da){return (p.createElement("span",null,p.createElement(m,p.__spread({},this._attachments[0].metadata))));},_renderShoerackInvitationSnippet:function(da){var ea;if(this._isViewerSender){ea=(t._("You sent a Moments invitation."));}else ea=(t._("{sender name} invited you to share photos using Moments.",[t.param("sender name",da)]));return this._renderSnippet(ea);},_renderShareSnippet:function(da){if(!!this._attachments[0].share)return (p.createElement(n,{attachment:this._attachments[0].share,senderName:da,isViewerSender:this._isViewerSender}));var ea;if(this._isViewerSender){ea=(t._("You shared a link"));}else ea=(t._("{sender name} shared a link.",[t.param("sender name",da)]));return this._renderSnippet(ea);},_renderMixedSnippet:function(da){return (p.createElement("span",null,this._attachments.filter(function(ea){return ea.attach_type===j.FILE||ea.attach_type===j.PHOTO||ea.attach_type===j.VIDEO;}).map(function(ea,fa){return this._renderSnippet(ea.name,ea.icon_type,fa);}.bind(this))));},_renderSnippet:function(da,ea,fa){var ga=i.getAttachIconClass(ea||this._attachments[0].icon_type),ha=v(ga,"uiIconText _3l6h");return (p.createElement("span",{className:ha,key:fa},p.createElement(h,{src:u('/images/messaging/docs/generic.png')}),da));},_renderError:function(da){var ea;if(this._isViewerSender){ea=(t._("You sent an attachment."));}else ea=(t._("{sender name} sent an attachment.",[t.param("sender name",da)]));return this._renderSnippet(ea);},_hasOnlyPhotos:function(){return this._photos.length===this._attachments.length;},_hasOnlyAnimatedImages:function(){return this._animatedImages.length===this._attachments.length;},_hasOnlyVideo:function(){return (this._attachments.length===1&&this._attachments[0].attach_type===j.VIDEO);},_hasAudioClip:function(){return !!(this._attachments.length===1&&this._attachments[0].metadata&&i.isVoiceMessage(this._attachments[0].metadata.type));},_hasSticker:function(){return (this._attachments.length===1&&this._attachments[0].attach_type===j.STICKER);},_hasOrion:function(){return this._hasSingleAttachmentOfShareDataType(k.MercurySupportedShareType.FB_ORION);},_hasShoerackInvitation:function(){return this._hasSingleAttachmentOfShareDataType(k.MercurySupportedShareType.FB_SHOERACK_INVITATION);},_hasSingleAttachmentOfShareDataType:function(da){return (this._attachments.length===1&&this._attachments[0].share_data_type===da);},_hasShare:function(){return (this._attachments.length===1&&this._attachments[0].attach_type===j.SHARE);},_hasError:function(){return (this._attachments.length===1&&this._attachments[0].attach_type===j.ERROR);},_setVariables:function(da){this._viewer=da.viewer;this._sender=da.thread.snippet_sender;this._attachments=da.thread.snippet_attachments;this._photos=z(this._attachments);this._animatedImages=aa(this._attachments);this._isViewerSender=ca(this._sender,this._viewer);},_getSenderName:function(){if(!this._sender||this._isViewerSender)return null;var da=o.getNow(this._sender);if(!da)return null;return da.short_name;},_ensureParticipant:function(da){if(!da)return;this._cancelParticipantFetch();if(!o.getNow(da))this._sub=o.get(da,function(ea){return this.forceUpdate();}.bind(this));},_cancelParticipantFetch:function(){this._sub&&this._sub.remove();}});function z(da){if(!da)return [];return da.filter(function(ea){return ea.attach_type===j.PHOTO;});}function aa(da){if(!da)return [];return da.filter(function(ea){return ea.attach_type===j.ANIMATED_IMAGE;});}function ba(da){return (da==q.LIKE_STICKER_ID||da==q.HOT_LIKE_SMALL_STICKER_ID||da==q.HOT_LIKE_MEDIUM_STICKER_ID||da==q.HOT_LIKE_LARGE_STICKER_ID);}function ca(da,ea){return !!(da&&l.getParticipantIDFromUserID(ea)==da);}e.exports=y;},null);
__d("MercuryThreadImage.react",["ImmutableObject","MercuryIDs","MercuryParticipants","MercuryParticipantsConstants","Pixelz.react","React","SplitImage.react","areEqual"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();'use strict';var o=l,p=o.PropTypes,q=l.createClass({displayName:"MercuryThreadImage",propTypes:{thread:p.instanceOf(g).isRequired,viewer:p.string.isRequired,size:p.number},getInitialState:function(){return {participantImages:[]};},componentDidMount:function(){this._getParticipantImages(this.props);},componentWillReceiveProps:function(r,s){this._getParticipantImages(r);},shouldComponentUpdate:function(r,s){return (r.thread.image_src!==this.props.thread.image_src||r.size!==this.props.size||!n(s.participantImages,this.state.participantImages));},render:function(){var r=this.props.size||j.BIG_IMAGE_SIZE;if(this.props.thread.image_src)return (l.createElement(k,{height:r,resizeMode:'cover',src:this.props.thread.image_src,width:r}));if(this.state.participantImages.length>0)return (l.createElement(m,{srcs:this.state.participantImages,border:true,size:r}));return null;},_getParticipantImages:function(r){var s=r.thread,t=r.viewer;if(s.image_src)return;var u=h.getParticipantIDFromUserID(t),v=s.participants.filter(function(x){return x!=u;}),w=[];if(!v.length){w=[u];}else if(v.length==1){w=v;}else w=v.slice(0,3);i.getOrderedBigImageMulti(w,function(x){this.isMounted()&&this.setState({participantImages:x});}.bind(this));}});e.exports=q;},null);
__d("MercuryParticipantListRenderer",["fbt"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';function h(){this.$MercuryParticipantListRenderer0=false;this.$MercuryParticipantListRenderer1=false;this.$MercuryParticipantListRenderer2=false;this.$MercuryParticipantListRenderer3=function(r){return this.$MercuryParticipantListRenderer1?r.short_name:r.name;}.bind(this);}h.prototype.renderParticipantList=function(r){var s=r.map(this.$MercuryParticipantListRenderer3);switch(s.length){case 0:return i(this.$MercuryParticipantListRenderer0);case 1:return j(s);case 2:return this.$MercuryParticipantListRenderer2?l(s):k(s);case 3:return this.$MercuryParticipantListRenderer2?n(s):m(s);default:return this.$MercuryParticipantListRenderer2?p(s):o(s);}};h.prototype.setIsNewThread=function(r){this.$MercuryParticipantListRenderer0=r;return this;};h.prototype.setNameRenderer=function(r){this.$MercuryParticipantListRenderer3=r;return this;};h.prototype.setUseShortName=function(r){this.$MercuryParticipantListRenderer1=r;return this;};h.prototype.setUseAndSeparator=function(r){this.$MercuryParticipantListRenderer2=r;return this;};function i(r){if(r){return (g._("New message"));}else return (g._("No Participants"));}function j(r){return r[0];}function k(r){return (g._("{participant1}, {participant2}",[g.param("participant1",r[0]),g.param("participant2",r[1])]));}function l(r){return (g._("{participant1} and {participant2}",[g.param("participant1",r[0]),g.param("participant2",r[1])]));}function m(r){return (g._("{participant1}, {participant2}, {participant3}",[g.param("participant1",r[0]),g.param("participant2",r[1]),g.param("participant3",r[2])]));}function n(r){return (g._("{participant1}, {participant2}  and {participant3}",[g.param("participant1",r[0]),g.param("participant2",r[1]),g.param("participant3",r[2])]));}function o(r){return (g._("{participant1}, {participant2}, {participant3}, {others_link}",[g.param("participant1",r[0]),g.param("participant2",r[1]),g.param("participant3",r[2]),g.param("others_link",q(r.length-3))]));}function p(r){return (g._("{participant1}, {participant2} and {others_link}",[g.param("participant1",r[0]),g.param("participant2",r[1]),g.param("others_link",q(r.length-2))]));}function q(r){if(r>1){return (g._({"*":"{others_count} others"},[g.param("others_count",r,[0])]));}else return (g._("1 other"));}e.exports=h;},null);
__d("MercuryThreadTitle.react",["MercuryIDs","MercuryParticipantListRenderer","MercuryParticipants","React","TextWithEmoticons.react","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=j,n=m.PropTypes,o=j.createClass({displayName:"MercuryThreadTitle",propTypes:{isNewThread:n.bool,thread:n.object.isRequired,viewer:n.string.isRequired,showUnreadCount:n.bool,useShortName:n.bool,useAndSeparator:n.bool},getDefaultProps:function(){return {isNewThread:false,showUnreadCount:false,useShortName:false,useAndSeparator:false};},getInitialState:function(){return {participantNames:''};},componentDidMount:function(){this._renderParticipantsList(this.props);},componentWillReceiveProps:function(p){this._renderParticipantsList(p);},render:function(){return (j.createElement("span",{className:this.props.className},this.props.thread.name?this._renderThreadTitle():this.state.participantNames));},getTitle:function(){return this.state.participantNames;},_renderThreadTitle:function(){var p=this.props.thread,q=j.createElement(k,{renderEmoticons:true,renderEmoji:true,text:p.name});if(!p.unread_count||!this.props.showUnreadCount)return q;return this._renderTitleWithUnreadCount(q,p.unread_count);},_renderParticipantsList:function(p){if(p.thread.name)return;var q=g.getParticipantIDFromUserID(p.viewer),r=p.thread.participants;if(r.length>1)r=r.filter(function(s){return s!=q;});i.getMulti(r,function(s){if(!this.isMounted())return;var t=r.map(function(w){return s[w];}),u=new h().setUseShortName(this.props.useShortName).setUseAndSeparator(this.props.useAndSeparator).setIsNewThread(this.props.isNewThread).renderParticipantList(t),v=(p.showUnreadCount&&p.thread.unread_count)?this._renderTitleWithUnreadCount(u,p.thread.unread_count):u;this.setState({participantNames:v});}.bind(this));},_renderTitleWithUnreadCount:function(p,q){return (l._("{conversation-title} ({unread-count})",[l.param("conversation-title",p),l.param("unread-count",q)]));}});e.exports=o;},null);
__d("WebMessengerThreadPermalinks",["MercuryIDs","MessagingTag","URI","WebMessengerPermalinkConstants","WWWBase","requireWeak"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m={getThreadURI:function(q,r,s){if(g.isCanonical(q)){n(q,r,s);}else o(q,r,s);}};function n(q,r,s){var t=new i(k.uri),u=g.tokenize(q).value;t.setPath(p(s)+'/'+u);r&&r(t.toString());}function o(q,r,s){l(['MercuryServerRequests'],function(t){var u=t.get();u.getServerThreadID(q,function(v){var w=new i(k.uri);w.setPath(j.getURIPathForThreadID(v,p(s)));r&&r(w.toString());});});}function p(q){var r=j.BASE_PATH;if(q&&q!=h.INBOX)r+='/'+q;return r;}e.exports=m;},null);
__d("MercuryViewer",["CurrentUser","MercuryAssert"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';var i='fbid:'+g.getID(),j={getID:function(){return i;},isViewer:function(k){h.isParticipantID(k);return k===i;}};e.exports=j;},null);
__d("MercuryMessageInfo",["MercuryActionStatus","MercuryViewer"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';var i={isOutbound:function(j){return j.author===h.getID();},isInbound:function(j){return !i.isOutbound(j);},isSending:function(j){return (j.status===g.UNSENT||j.status===g.UNCONFIRMED||j.status===g.UNABLE_TO_CONFIRM||j.status===g.RESENDING);},hasError:function(j){return (j.status===g.FAILED_UNKNOWN_REASON||j.status===g.UNABLE_TO_CONFIRM||j.status===g.ERROR);}};e.exports=i;},null);
__d("MercuryThreadInfo",["CurrentUser","MercuryThreadMode"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';var i={canReply:function(k){return !!(k.is_subscribed&&k.mode!=h.OBJECT_ORIGINATED&&!k.has_email_participant&&!k.read_only&&(k.recipients_loadable||k.recipients_loadable===(void 0)));},getMuteSetting:function(k){return (k.mute_settings&&k.mute_settings[j(g.getID())]);},isMuted:function(k){return i.getMuteSetting(k)!==(void 0);}};function j(k){return k+'@facebook.com';}e.exports=i;},null);
__d("MercuryMessages",["AsyncRequest","BanzaiODS","CurrentUser","EventEmitter","ImmutableObject","LogHistory","Map","MercuryActionStatus","MercuryActionType","MercuryAssert","MercuryAttachmentType","MercuryLogMessageType","MercuryMessageClientState","MercuryMessageInfo","MercuryPayloadSource","MercurySingletonMixin","MercuryMessageActions","MercuryMessageIDs","RangedCallbackManager","MercurySendMessageFields","MercuryServerRequests","MercuryThreadActions","MercuryThreadInformer","MercuryThreads","copyProperties","debounceAcrossTransitions","invariant","mergeDeep"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha){b.__markCompiled&&b.__markCompiled();'use strict';var ia=new j(),ja=l.getInstance('mercury_messages');function ka(wa,xa){var ya=xa;if(wa._localIdsMap[xa])ya=wa._localIdsMap[xa];return wa._messages.get(ya);}function la(wa){switch(wa){case u.UNKNOWN:case u.SERVER_INITIAL_DATA:case u.SERVER_FETCH_THREAD_INFO:case u.SERVER_THREAD_SYNC:return true;}return false;}function ma(wa){return wa&&wa.substr(0,6)==='server';}function na(wa,xa){if(!wa._threadsToMessages[xa])wa._threadsToMessages[xa]=new y(function(ya){return ka(wa,ya).timestamp;},function(ya,za){return za-ya;});return wa._threadsToMessages[xa];}function oa(wa,xa,ya){xa.forEach(function(za){var ab=na(wa,za);ab.setReachedEndOfArray();wa._emitReorderedChange(za,ya);});}function pa(wa){this._fbid=wa;this._messageActions=w.getForFBID(this._fbid);this._serverRequests=aa.getForFBID(this._fbid);this._threadInformer=ca.getForFBID(this._fbid);this._threads=da.getForFBID(this._fbid);this._threadActions=ba.getForFBID(this._fbid);this._didChange=false;this._failedHistoryFetchThreads={};this._threadsToMessages={};this._localTitanMessagesCount={};this._messages=new m();this._attachmentData={};this._messagesNeedingAttachmentData={};this._localIdsMap={};this._serverRequests.subscribe('update-messages',function(xa,ya){var za=(ya.actions||[]).filter(function(bb){var cb=bb.action_type,db=((bb.is_forward||bb.thread_id)&&(cb==o.LOG_MESSAGE||cb==o.USER_GENERATED_MESSAGE||cb==o.SEND_MESSAGE||cb==o.CLEAR_CHAT||cb==o.DELETE_THREAD||cb==o.DELETE_MESSAGES||cb==o.MARK_MESSAGES_SPAM)),eb=((bb.upload_id&&bb.upload_data)&&(cb==o.CANCEL_ATTACHMENT_PLACEHOLDER||cb==o.CONFIRM_ATTACHMENT_PLACEHOLDER)),fb=(cb==o.ADD_SHARE_DATA_TO_EXISTING_MESSAGE&&(bb.server_id&&bb.attach_key&&bb.attach_data));return (db||eb||fb);}),ab=la(ya.payload_source);if(ma(ya.payload_source))za.forEach(function(bb){if(!bb.is_forward&&bb.action_type!==o.ADD_SHARE_DATA_TO_EXISTING_MESSAGE){var cb=this._threads.getThreadMetaNow(bb.thread_id);if(cb)bb.is_cleared=bb.timestamp<cb.chat_clear_time;}}.bind(this));this.handleUpdates(za,ab,ya.payload_source,ya.from_client);if(ya.end_of_history)oa(this,ya.end_of_history,ya.payload_source);if(this._didChange){this._didChange=false;ia.emit('change');}}.bind(this));ja.debug('constructed',{fbid:this._fbid});}ea(pa.prototype,{getMessagesFromIDs:function(wa){return (wa||[]).map(ka.bind(null,this)).filter(function(xa){return xa;});},hasLoadedNMessages:function(wa,xa){var ya=na(this,wa);return ya.hasReachedEndOfArray()||ya.getCurrentArraySize()>=xa;},hasLoadedExactlyNMessages:function(wa,xa){var ya=na(this,wa);return ya.getCurrentArraySize()==xa;},clearMercuryInternalState_DO_NOT_USE:function(){this._failedHistoryFetchThreads={};this._threadsToMessages={};this._localTitanMessagesCount={};this._messages=new m();this._attachmentData={};this._messagesNeedingAttachmentData={};this._localIdsMap={};},getThreadMessagesRange:function(wa,xa,ya,za,ab,bb){var cb=na(this,wa),db=function(lb){za(qa(this,lb));}.bind(this),eb=cb.executeOrEnqueue(xa,ya,db),fb=cb.getUnavailableResources(eb),gb=this._failedHistoryFetchThreads[wa];if(fb.length&&!gb){var hb=cb.getCurrentArraySize(),ib=this._localTitanMessagesCount[wa]||0,jb=hb-ib,kb=fb.length+ib;ja.debug('fetch_missing_messages',{threadID:wa,offset:xa,limit:ya,missingIndices:fb,messageCount:hb,localMessageCount:ib});this._serverRequests.fetchThreadMessages(wa,jb,kb,ab,bb);}else this._failedHistoryFetchThreads[wa]=false;return eb;},getThreadMessagesRangeNow:function(wa,xa,ya){var za=na(this,wa),ab=[];for(var bb=xa;bb<xa+ya;bb++){var cb=za.getResourceAtIndex(bb),db=ka(this,cb);db&&ab.push(db);}return ab;},getThreadMessagesSinceTimestamp:function(wa,xa){var ya=na(this,wa),za=ya.getElementsUntil(xa);return qa(this,za);},hasLoadedAllMessages:function(wa){return na(this,wa).hasReachedEndOfArray();},getCurrentlyLoadedMessages:function(wa){var xa=na(this,wa).getAllResources();return qa(this,xa);},unsubscribe:function(wa,xa){p.isThreadID(xa);var ya=na(this,xa);ya.unsubscribe(wa);},_addNewMessage:function(wa,xa){ta(this,xa);this._messages.set(wa,new k(xa));},_updateMessage:function(wa,xa,ya){var za=k.set(xa,ya);this._messages.set(wa,za);return za;},_addAttachmentData:function(wa,xa,ya){var za=ka(this,wa);if(za){var ab=za.attachments.indexOf(xa);if(ab!=-1){this._updateMessage(wa,za,{attachments:za.attachments.map(function(bb,cb){return (cb===ab)?ya:bb;})});this._emitUpdatedChange(za.thread_id,za.message_id,'attach');}}else{if(!this._attachmentData[wa])this._attachmentData[wa]=[];this._attachmentData[wa].push({attach_key:xa,data:ya});}},_shouldSortOutOfOrderMessages:function(wa,xa,ya){if(wa==u.CLIENT_CHANNEL_MESSAGE){var za=this.getThreadMessagesSinceTimestamp(xa,ya);if(za.length>0){h.bumpEntityKey('chat.web','channel.messages_reordered');return true;}}return false;},_preprocessIncomingAction:function(wa,xa){var ya=wa.action_type;if(xa==u.CLIENT_CHANNEL_MESSAGE&&ya==o.USER_GENERATED_MESSAGE&&wa.threading_id&&this._localIdsMap[wa.threading_id]===wa.threading_id){wa.client_message_id=wa.threading_id;wa.status=n.SUCCESS;wa.action_type=o.SEND_MESSAGE;ya=wa.action_type;}if(xa===u.CLIENT_CHANNEL_MESSAGE&&ya==o.USER_GENERATED_MESSAGE){var za=this._threads.getThreadMetaNow(wa.thread_id);if(za&&za.folder)wa.folder=za.folder;}return wa;},handleUpdates:function(wa,xa,ya,za){var ab,bb={},cb={};for(var db=0;db<wa.length;db++){var eb=this._preprocessIncomingAction(wa[db],ya),fb=eb.action_type,gb=ka(this,eb.message_id);if(eb.is_forward||ya==u.SERVER_SEARCH){if(!this._messages.has(eb.message_id))this._addNewMessage(eb.message_id,eb);continue;}else if(eb.client_state===s.SEND_TO_SERVER){this._addNewMessage(eb.message_id,eb);continue;}else if(fb==o.SEND_MESSAGE){var hb=eb.client_message_id;if(hb&&this._localIdsMap[hb]&&eb.status){var ib=ka(this,hb),jb=ib.status;if(ib.status==n.SUCCESS)continue;if(eb.status==n.UNCONFIRMED){if(!cb[eb.thread_id])cb[eb.thread_id]=[];cb[eb.thread_id].push(hb);}else if(!bb[eb.thread_id])bb[eb.thread_id]=[];this._updateLocalMessage(eb);if(typeof jb!==(void 0)||eb.status==n.FAILED_UNKNOWN_REASON||eb.status==n.UNABLE_TO_CONFIRM||eb.status==n.SUCCESS||eb.status==n.ERROR)this._emitUpdatedChange(eb.thread_id,ka(this,hb).message_id,ya);}continue;}else if(fb==o.DELETE_THREAD){na(this,eb.thread_id).removeAllResources();continue;}else if(fb==o.DELETE_MESSAGES){this._deleteMessages(eb.thread_id,eb.message_ids,ya);continue;}else if(fb==o.CLEAR_CHAT){var kb=na(this,eb.thread_id).getAllResources(),lb={is_cleared:true};kb.forEach(function(rb){var sb=ka(this,rb);this._updateMessage(this._localIdsMap[rb]||rb,sb,lb);}.bind(this));continue;}else if(fb===o.MARK_MESSAGES_SPAM){this._markMessagesSpam(eb,ya);continue;}else if((eb.threading_id&&this._localIdsMap[eb.threading_id])||(gb&&!gb.is_forward)){if(gb&&eb.ranges&&eb.ranges.length>0){var mb=gb.message_id;this._updateMessage(this._localIdsMap[mb]||mb,gb,{ranges:wa.ranges});this._emitUpdatedChange(gb.thread_id,gb.message_id,'link_shim');}continue;}else if(fb===o.CONFIRM_ATTACHMENT_PLACEHOLDER){this._confirmAttachmentPlaceholder(eb.upload_id,eb.upload_data);continue;}else if(fb===o.CANCEL_ATTACHMENT_PLACEHOLDER){this._cancelAttachmentPlaceholder(eb.upload_id,eb.upload_data);continue;}else if(fb===o.ADD_SHARE_DATA_TO_EXISTING_MESSAGE){this._addAttachmentData(eb.server_id,eb.attach_key,eb.attach_data);continue;}else{if(ya===u.CLIENT_SEND_MESSAGE){this._localIdsMap[eb.message_id]=eb.message_id;if(eb.thread_id=='root:'+eb.message_id)na(this,eb.thread_id).setReachedEndOfArray();}if(fb==o.LOG_MESSAGE&&eb.log_message_type==r.SERVER_ERROR)this._failedHistoryFetchThreads[eb.thread_id]=true;if(eb.client_state===s.DO_NOT_SEND_TO_SERVER&&eb.upload_id)this._uploadMessages[eb.upload_id]=eb;if(!bb[eb.thread_id])bb[eb.thread_id]=[];bb[eb.thread_id].push(eb.message_id);this._addNewMessage(eb.message_id,eb);if(eb.threading_id&&eb.threading_id!=eb.message_id)x.addServerID(eb.threading_id,eb.message_id);if(eb[z.MANUAL_RETRY_CNT]>0){ab=na(this,eb.thread_id);ab.resortResources([eb.message_id]);this._emitReorderedChange(eb.thread_id,u.CLIENT_SEND_MESSAGE);}xa=xa||this._shouldSortOutOfOrderMessages(ya,eb.thread_id,eb.timestamp);if(!xa)this._emitReceivedChange(ka(this,eb.message_id));continue;}}for(var nb in bb){ab=na(this,nb);var ob=ab.getAllResources(),pb=ob.filter(function(rb){var sb=this._messages.get(rb);return sb.action_type==o.LOG_MESSAGE&&sb.log_message_type==r.SERVER_ERROR;}.bind(this));ab.removeResources(pb);if(za)ra(this,nb,bb[nb]);if(xa){ab.addResources(bb[nb]);this._emitReorderedChange(nb,ya);}else ab.addResourcesWithoutSorting(bb[nb].reverse(),0);this._threadInformer.updatedThread(nb);}var qb=Object.keys(cb);if(qb.length)this._serverRequests.requestMessageConfirmation(cb);ja.debug('handle_updates',{localMessageCounts:ha(this._localTitanMessagesCount)});},isFirstMessage:function(wa){var xa=na(this,wa.thread_id);if(xa.getCurrentArraySize()===0)return false;var ya=xa.getResourceAtIndex(xa.getCurrentArraySize()-1),za=ka(this,ya).message_id,ab=ka(this,wa.message_id).message_id;return xa.hasReachedEndOfArray()&&za==ab;},_markMessagesSpam:function(wa,xa){var ya=wa,za=ya.thread_id,ab=ya.message_ids;if(!ab.length)return;this._deleteIndividualMessages(za,ab,xa);this._serverRequests.markMessagesSpam(za,ab);},_deleteMessages:function(wa,xa,ya){if(!xa.length)return;this._deleteIndividualMessages(wa,xa,ya);if(ya!==u.CLIENT_CHANNEL_MESSAGE)this._serverRequests.deleteMessages(wa,xa);},_deleteIndividualMessages:function(wa,xa,ya){var za=xa.map(function(bb){return ka(this,bb).message_id;},this),ab=na(this,wa);ab.removeResources(za);this._emitReorderedChange(wa,ya);},_updateLocalMessage:function(wa){var xa=ka(this,wa.client_message_id),ya={};ya.status=wa.status;if(wa.status===n.SUCCESS||wa.error_data)ya.error_data=wa.error_data;var za=wa.message_id,ab=wa.client_message_id;if(this._messages.has(za)){this._updateMessage(za,xa,ya);return false;}if(wa.timestamp)ya.timestamp=wa.timestamp;if(wa.log_message_data)ya.log_message_data=wa.log_message_data;if(wa.ranges&&wa.ranges.length)ya.ranges=wa.ranges;if(wa.attachments&&wa.attachments.length){ya.raw_attachments=null;ya.attachments=wa.attachments;ta(this,ya,za);}this._localIdsMap[ab]=za;x.addServerID(ab,za);var bb=this._updateMessage(za,xa,ya);this._messages.set(ab,new k());if(sa(bb))this._localTitanMessagesCount[bb.thread_id]--;return true;},getNumberLocalMessages:function(wa){return this._localTitanMessagesCount[wa]||0;},_uploadMessages:{},_confirmAttachmentPlaceholder:function(wa,xa){var ya=this._popPendingAttachmentMessage(wa,xa);this._serverRequests.sendNewMessage(ya);},_cancelAttachmentPlaceholder:function(wa,xa){var ya=this._popPendingAttachmentMessage(wa,xa);this._deleteIndividualMessages(ya.thread_id,[ya.message_id]);if(this._localTitanMessagesCount[ya.thread_id])this._localTitanMessagesCount[ya.thread_id]--;},_popPendingAttachmentMessage:function(wa,xa){var ya=this._uploadMessages[wa];ga(ya);ya.image_ids=xa.image_ids;ya.file_ids=xa.file_ids;ya.audio_ids=xa.audio_ids;ya.gif_ids=xa.gif_ids;ya.client_state=s.SEND_TO_SERVER;delete this._uploadMessages[wa];return ya;},_emitUpdatedChange:function(wa,xa,ya){this._didChange=true;this._threadInformer.updatedMessage(wa,xa,ya);},_emitReceivedChange:function(wa){this._didChange=true;this._threadInformer.receivedMessage(wa);},_emitReorderedChange:function(wa,xa){this._didChange=true;this._threadInformer.reorderedMessages(wa,xa);}});Object.assign(pa,v,{addListener:function(wa,xa){return ia.addListener(wa,xa);}});function qa(wa,xa){var ya=xa.map(ka.bind(null,wa));return ya.reverse();}function ra(wa,xa,ya){var za=ya.filter(function(ab){return sa(ka(wa,ab));});if(!wa._localTitanMessagesCount[xa])wa._localTitanMessagesCount[xa]=0;wa._localTitanMessagesCount[xa]+=za.length;}function sa(wa){var xa=wa.action_type;if(xa==o.USER_GENERATED_MESSAGE)return true;switch(wa.log_message_type){case r.SUBSCRIBE:case r.UNSUBSCRIBE:case r.SERVER_ERROR:case r.LIVE_LISTEN:return false;default:return true;}}function ta(wa,xa,ya){ya=ya||xa.message_id;var za=wa._attachmentData[ya];if(za){za.forEach(function(ab){var bb=xa.attachments.indexOf(ab.attach_key);if(bb!==-1)xa.attachments[bb]=ab.data;});delete wa._attachmentData[ya];}else if(!xa.is_forward&&ua(wa,xa)){wa._messagesNeedingAttachmentData[ya]=true;va(wa);}}function ua(wa,xa){if(!xa||!xa.attachments)return false;for(var ya=0;ya<xa.attachments.length;ya++){var za=xa.attachments[ya];if(typeof za==='string'&&za.indexOf(q.SHARE)===0)return true;}var ab=xa.forward_message_ids||[];for(ya=0;ya<ab.length;ya++){var bb=ka(wa,ab[ya]);if(ua(wa,bb))return true;}return false;}var va=fa(function(wa){var xa={};for(var ya in wa._messagesNeedingAttachmentData){var za=ka(wa,ya);if(ua(wa,za))xa[ya]=true;}var ab=Object.keys(xa);if(ab.length){var bb={message_ids:ab};if(wa._fbid!=i.getID())bb.request_user_id=wa._fbid;new g('/ajax/mercury/attachments/fetch_shares.php').setData(bb).setAllowCrossPageTransition(true).send();}wa._messagesNeedingAttachmentData={};},0,this);e.exports=pa;},null);
__d("MercuryChannelHandler",["Arbiter","ChannelConstants","MercuryActionType","MercuryGlobalActionType","MercuryMessages","MercuryPayloadSource","MercuryServerRequests","MercurySingletonMixin","MercuryThreadInformer","MercuryViewer","MessagingEvent","MessagingReliabilityLogger","MessagingTag","PresenceUtil","copyProperties","mixin"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){b.__markCompiled&&b.__markCompiled();var w=v(n);for(var x in w)if(w.hasOwnProperty(x))z[x]=w[x];var y=w===null?null:w.prototype;z.prototype=Object.create(y);z.prototype.constructor=z;z.__superConstructor__=w;function z(aa){"use strict";this.$MercuryChannelHandler0=aa;this.$MercuryChannelHandler1=m.getForFBID(this.$MercuryChannelHandler0);this.$MercuryChannelHandler2=o.getForFBID(this.$MercuryChannelHandler0);this.$MercuryChannelHandler3=k.getForFBID(this.$MercuryChannelHandler0);this.$MercuryChannelHandler4=[];}z.prototype.getInstanceFBID=function(){"use strict";return this.$MercuryChannelHandler0;};z.prototype.$MercuryChannelHandler5=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||!ba.obj||!ba.obj.message){r.addEntry('channel_receive','invalid_data');return;}var ca=ba.obj.message,da=ca.other_user_fbid?ca.other_user_fbid:ca.thread_fbid,ea={author:ca.mercury_author_id,author_email:ca.mercury_author_email,body:ca.body,subject:ca.subject,has_attachment:ca.has_attachment,attachments:ca.attachments,html_body:ca.html_body,thread_id:ca.tid,thread_fbid:ca.thread_fbid,other_user_fbid:ca.other_user_fbid,message_id:ca.mid,coordinates:ca.mercury_coordinates,is_spoof_warning:ca.is_spoof_warning,ranges:ca.ranges,source:ca.mercury_source,source_tags:ca.mercury_source_tags,threading_id:ca.threading_id,timestamp:ca.timestamp,timestamp_absolute:ca.timestamp_absolute,timestamp_relative:ca.timestamp_relative,timestamp_time_passed:ca.timestamp_time_passed,action_type:i.USER_GENERATED_MESSAGE,is_unread:ca.is_unread,is_forward:false,forward_count:ca.forward_count||ca.forward,forward_message_ids:ca.forward_msg_ids,location_text:ca.location_text,folder:ba.obj.folder};if("sync_id" in ca){ea.sync_id=ca.sync_id;}else ea.action_id=ca.action_id;var fa=[u({},ea)];fa=fa.concat(ca.forward_actions||[]);var ga=l.CLIENT_CHANNEL_MESSAGE;this.$MercuryChannelHandler1.handleUpdateWaitForThread({actions:fa,payload_source:ga},da);if(!ca.is_unread&&p.isViewer(ca.mercury_author_id)){var ha={};ha[da]=ba.obj.folder;this.$MercuryChannelHandler7(this.__getMessagingPayloadType(),{obj:{event:q.READ,thread_fbids:ca.thread_fbid?[ca.thread_fbid]:[],other_user_fbids:ca.other_user_fbid?[ca.other_user_fbid]:[],folder_info:ha,timestamp:ca.timestamp}});}r.addEntry('channel_receive','success',[da,ea.message_id,t.getSessionID()]);};z.prototype.$MercuryChannelHandler7=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||!ba.obj||(!ba.obj.thread_fbids&&!ba.obj.other_user_fbids))return;var ca=[],da=ba.obj.event==q.READ;(ba.obj.thread_fbids||[]).forEach(function(ea){ca.push({action_type:i.CHANGE_READ_STATUS,action_id:null,thread_fbid:ea,mark_as_read:da,timestamp:ba.obj.timestamp||0,folder:ba.obj.folder_info[ea]});});(ba.obj.other_user_fbids||[]).forEach(function(ea){ca.push({action_type:i.CHANGE_READ_STATUS,action_id:null,other_user_fbid:ea,mark_as_read:da,timestamp:ba.obj.timestamp||0,folder:ba.obj.folder_info[ea]});});this.$MercuryChannelHandler1.handleUpdate({actions:ca,payload_source:l.CLIENT_CHANNEL_MESSAGE});};z.prototype.$MercuryChannelHandler8=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||!ba.obj||!(ba.obj.thread_fbids||ba.obj.other_user_fbids))return;var ca=[];(ba.obj.thread_fbids||[]).forEach(function(da){ca.push({action_type:i.DELETE_THREAD,action_id:null,thread_fbid:da});});(ba.obj.other_user_fbids||[]).forEach(function(da){ca.push({action_type:i.DELETE_THREAD,action_id:null,other_user_fbid:da});});this.$MercuryChannelHandler1.handleUpdate({actions:ca,payload_source:l.CLIENT_CHANNEL_MESSAGE});};z.prototype.$MercuryChannelHandler9=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||!ba.obj||(!ba.obj.thread_fbids&&!ba.obj.other_user_fbids)||!ba.obj.mids)return;var ca=ba.obj.thread_fbids.length?ba.obj.thread_fbids[0]:null,da=ba.obj.other_user_fbids.length?ba.obj.other_user_fbids[0]:null,ea={action_type:i.DELETE_MESSAGES,action_id:null,thread_fbid:ca,other_user_fbid:da,message_ids:ba.obj.mids};this.$MercuryChannelHandler1.handleUpdate({actions:[ea],threads:[ba.obj.updated_thread],payload_source:l.CLIENT_CHANNEL_MESSAGE});};z.prototype.$MercuryChannelHandlera=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||!ba.obj||!ba.obj.folder)return;var ca={action_type:j.MARK_ALL_READ,action_id:ba.obj.action_id,folder:ba.obj.folder};this.$MercuryChannelHandler1.handleUpdate({global_actions:[ca]});};z.prototype.$MercuryChannelHandlerb=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||(!ba.obj.thread_fbids&&!ba.obj.other_user_fbids))return;var ca=l.CLIENT_CHANNEL_MESSAGE;(ba.obj.thread_fbids||[]).forEach(function(da){var ea={action_type:i.CHANGE_ARCHIVED_STATUS,action_id:null,thread_fbid:da,other_user_fbid:null,archived:ba.obj.state};this.$MercuryChannelHandler1.handleUpdateWaitForThread({actions:[u({},ea)],payload_source:ca},da);},this);(ba.obj.other_user_fbids||[]).forEach(function(da){var ea={action_type:i.CHANGE_ARCHIVED_STATUS,action_id:null,thread_fbid:null,other_user_fbid:da,archived:ba.obj.state};this.$MercuryChannelHandler1.handleUpdateWaitForThread({actions:[u({},ea)],payload_source:ca},da);},this);};z.prototype.$MercuryChannelHandlerc=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||(!ba.obj.thread_fbids&&!ba.obj.other_user_fbids))return;var ca=l.CLIENT_CHANNEL_MESSAGE,da;(ba.obj.thread_fbids||[]).forEach(function(ea){if(ba.obj.event==q.TAG){da=ba.obj.tag;}else da=ba.obj.marked_as_spam?s.SPAM:s.INBOX;var fa={action_type:i.CHANGE_FOLDER,action_id:null,thread_fbid:ea,other_user_fbid:null,new_folder:da};this.$MercuryChannelHandler1.handleUpdateWaitForThread({actions:[u({},fa)],payload_source:ca},ea);},this);(ba.obj.other_user_fbids||[]).forEach(function(ea){if(ba.obj.event==q.TAG){da=ba.obj.tag;}else da=ba.obj.marked_as_spam?s.SPAM:s.INBOX;var fa={action_type:i.CHANGE_FOLDER,action_id:null,other_user_fbid:ea,thread_fbid:null,new_folder:da};this.$MercuryChannelHandler1.handleUpdateWaitForThread({actions:[u({},fa)],payload_source:ca},ea);},this);};z.prototype.$MercuryChannelHandlerd=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||!ba.obj.tag)return;switch(ba.obj.tag){case s.ACTION_ARCHIVED:this.$MercuryChannelHandlerb(aa,ba);break;case s.INBOX:case s.OTHER:this.$MercuryChannelHandlerc(aa,ba);break;}};z.prototype.__markAsSeen=function(aa,ba){"use strict";if(!this.$MercuryChannelHandlere(aa)||!ba.obj||!ba.obj.seen_timestamp)return;this.$MercuryChannelHandler1.handleUpdate({message_counts:[{seen_timestamp:ba.obj.seen_timestamp,folder:s.INBOX}],unseen_thread_fbids:[{thread_fbids:[],other_user_fbids:[],folder:s.INBOX}],payload_source:l.CLIENT_CHANNEL_MESSAGE});};z.prototype.__updateModelsFromMercuryPayload=function(aa,ba){"use strict";if(!this.$MercuryChannelHandlerf(aa)||!ba.obj)return;this.$MercuryChannelHandler2.synchronizeInforms(function(){var ca=ba.obj,da=[];(ca.actions||[]).forEach(function(ea){var fa=i.USER_GENERATED_MESSAGE;if(ea.action_type==i.LOG_MESSAGE){var ga=l.CLIENT_CHANNEL_MESSAGE,ha;ha=ea.other_user_fbid||ea.thread_fbid;this.$MercuryChannelHandler1.handleUpdateWaitForThread({actions:[u({},ea)],payload_source:ga},ha);}else if(ea.action_type!=fa)da.push(ea);},this);ca.actions=da;ca.payload_source=l.CLIENT_CHANNEL_MESSAGE;this.$MercuryChannelHandler1.handleUpdate(ca);}.bind(this));};z.prototype.$MercuryChannelHandlerg=function(aa,ba){"use strict";this.$MercuryChannelHandler1.handleRoger(ba.obj);};z.prototype.$MercuryChannelHandlerh=function(aa,ba){"use strict";if(!this.$MercuryChannelHandler6(aa)||!ba.obj||ba.obj.mute_settings===(void 0)||(!ba.obj.thread_fbid&&!ba.obj.other_user_fbid))return;var ca=i.CHANGE_MUTE_SETTINGS,da=[{action_type:ca,action_id:null,thread_fbid:ba.obj.thread_fbid,other_user_fbid:ba.obj.other_user_fbid,mute_settings:ba.obj.mute_settings}];this.$MercuryChannelHandler1.handleUpdate({actions:da,payload_source:l.CLIENT_CHANNEL_MESSAGE});};z.prototype.__handleMessagingPayload=function(aa,ba){"use strict";switch(ba.obj.event){case q.DELIVER:this.$MercuryChannelHandler5(aa,ba);break;case q.READ:case q.UNREAD:this.$MercuryChannelHandler7(aa,ba);break;case q.READ_ALL:this.$MercuryChannelHandlera(aa,ba);break;case q.DELETE:this.$MercuryChannelHandler8(aa,ba);break;case q.DELETE_MESSAGES:this.$MercuryChannelHandler9(aa,ba);break;case q.TAG:this.$MercuryChannelHandlerd(aa,ba);break;case q.REPORT_SPAM:this.$MercuryChannelHandlerc(aa,ba);break;case q.READ_RECEIPT:this.$MercuryChannelHandlerg(aa,ba);break;case q.CHANGE_MUTE_SETTINGS:this.$MercuryChannelHandlerh(aa,ba);break;}};z.prototype.getRouting=function(){"use strict";return {mercury:this.__updateModelsFromMercuryPayload,messaging:this.__handleMessagingPayload,inbox:this.__markAsSeen};};z.prototype.__getMessagingPayloadType=function(){"use strict";return h.getArbiterType('messaging');};z.prototype.__getMercuryPayloadType=function(){"use strict";return h.getArbiterType('mercury');};z.prototype.__getInboxPayloadType=function(){"use strict";return h.getArbiterType('inbox');};z.prototype.$MercuryChannelHandler6=function(aa){"use strict";return (aa==this.__getMessagingPayloadType());};z.prototype.$MercuryChannelHandlerf=function(aa){"use strict";return (aa==this.__getMercuryPayloadType());};z.prototype.$MercuryChannelHandlere=function(aa){"use strict";return (aa==this.__getInboxPayloadType());};z.prototype.turnOn=function(){"use strict";if(!this.$MercuryChannelHandler4.length){var aa=this.getRouting();for(var ba in aa)this.$MercuryChannelHandler4.push(g.subscribe(h.getArbiterType(ba),aa[ba].bind(this)));}return this;};z.prototype.turnOff=function(){"use strict";if(this.$MercuryChannelHandler4.length){this.$MercuryChannelHandler4.forEach(g.unsubscribe);this.$MercuryChannelHandler4=[];}return this;};u(z,n);e.exports=z;},null);
__d("MercuryRoger",["Arbiter","ArbiterMixin","immutable","JSLogger","MercuryActionStatus","mapObject","MercuryServerRequests","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=b('MercuryServerRequests').get(),n=b('MercuryThreads').get(),o={},p=[],q=k.SUCCESS,r={getSeenBy:function(u,v){if(!u)return [];var w=[],x=o[u.thread_id];if(!x)return w;x.forEach(function(y,z){if(s(u,y,z,v))w.push(z);});return w;},wasSeenByAll:function(u){if(!u)return false;var v=o[u.thread_id];if(!v)return false;return v.every(function(w,x){return s(u,w,x);});},getSeenTimestamps:function(u){var v=o[u];if(!v){v=i.OrderedMap();o[u]=v;}return v;},getSeenTimestamp:function(u,v){var w=o[u];return w?w.get(v):null;}};Object.assign(r,h);function s(u,v,w,x){return !!(v>u.timestamp&&(u.status===(void 0)||u.status===q)&&(!x||w!=u.author));}m.subscribe('update-roger',function(u,v){for(var w in v){var x=o[w]||i.OrderedMap();x=x.withMutations(function(y){for(var z in v[w]){var aa=n.getThreadMetaNow(w);if(aa&&aa.participants)if(aa.participants.indexOf(z)==-1){p.push(t(o));continue;}var ba=y.get(z),ca=v[w][z];if(!ba||ca>ba)y.set(z,ca);}});o[w]=x.sort();}v&&r.inform('change',v);});g.subscribe(j.DUMP_EVENT,function(u,v){v.bad_read_receipts={receipts:p};});function t(u){return l(u,function(v){return v.toJS();});}e.exports=r;},null);
__d("MercuryDelayedRoger",["ArbiterMixin","LiveTimer","MercuryActionStatus","MercuryConfig","MercuryRoger","setTimeoutAcrossTransitions","MercuryMessages","MercuryThreadInformer","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=b('MercuryMessages').get(),n=b('MercuryThreadInformer').get(),o=b('MercuryThreads').get(),p={},q={},r=j['roger.seen_delay'],s={getSeenBy:function(y,z){if(q[y])return [];return k.getSeenBy(t(y),z);},wasSeenByAll:function(y){if(q[y])return false;return k.wasSeenByAll(t(y));}};Object.assign(s,g);function t(y){if(!p[y]){var z=o.getThreadMetaNow(y);if(z)p[y]={thread_id:y,author:z.participants[0],timestamp:z.timestamp};}return p[y];}function u(y){var z=false;m.getThreadMessagesRange(y,0,1,function(aa){var ba=aa[0];if(!ba)return;var ca=ba.timestamp;if(ba.action_id||ba.status==i.SUCCESS)ca-=h.getServerTimeOffset();var da=s.getSeenBy(y);if(q[y]){clearTimeout(q[y]);delete q[y];}var ea=ca+r,fa=ea-Date.now();if(fa>0)q[y]=l(function(){delete q[y];v(y);},fa);p[y]=ba;var ga=s.getSeenBy(y);if(da.length||ga.length)z=true;});return z;}function v(y){var z={};z[y]=true;w(z);}function w(y){s.inform('state-changed',y);s.inform('change');}function x(event,y){var z={};for(var aa in y)if(u(aa))z[aa]=true;for(var ba in z){w(z);break;}}k.subscribe('change',function(y,z){for(var aa in z)!q[aa]&&v(aa);});n.subscribe('messages-received',x);n.subscribe('messages-reordered',x);n.subscribe('messages-updated',x);e.exports=s;},null);
__d("CanvasNavigationFullScreen",["Arbiter","CSS","cx","Event","FullScreen"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=false,m={initLink:function(n,o){if(l){return;}else l=true;h.conditionClass(n,"_4-os",k.isSupported());if(k.isSupported()&&o)setTimeout(o.show.bind(o),500);j.listen(n,'click',this.setFullScreen.bind(null,true));k.subscribe('changed',function(){if(k.isFullScreen()){g.inform('canvas.enter_fullscreen');}else g.inform('canvas.exit_fullscreen');});},isSupported:function(){var n=l&&k.isSupported();return !!n;},getFullScreen:function(){return !!k.isFullScreen();},setFullScreen:function(n){var o=true;if(n){o=k.enableFullScreen(document.documentElement);}else o=k.disableFullScreen();return o;}};e.exports=m;},null);
__d("XAppFriendsController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/platform\/games\/appfriends\/",{app_id:{type:"Int",required:true}});},null);
__d("CanvasPresenceController",["Arbiter","AsyncRequest","AvailableListConstants","AvailableList","PresenceStatus","XAppFriendsController"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=60*1000,n=false,o=[],p=0,q,r,s,t;function u(){var z=0;o.forEach(function(aa){if(k.hasDetailedPresenceData(aa)&&k.getDetailedActivePresence(aa)==i.ACTIVE_ON_WEB)z++;});if(s===(void 0)||s!==(z>1)){s=z>1;g.inform('canvas.friendsOnlineUpdated',s);}}function v(z){var aa=l.getURIBuilder().setInt('app_id',p).getURI();new h().setURI(aa).setHandler(function(ba){o=ba.payload.ids;if(z)z();u();}).send();}function w(){if(p===0){t=w;return;}n=true;v(function(){q=setInterval(v,m);r=j.subscribe(i.ON_AVAILABILITY_CHANGED,u);});}function x(){n=false;clearInterval(q);j.unsubscribe(r);}var y={setAppID:function(z){p=z;if(t)t();},setAppFriends:function(z){o=z;},useFriendsOnline:function(z){if(z==n)return;if(z){w();}else x();}};e.exports=y;},null);
__d("CanvasResizer",["createArrayFromMixed","CSS","DOMEventListener","Vector"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k;function l(){var n,o=document.documentElement;if(window.innerHeight){n=window.innerHeight;}else if(o&&o.clientHeight){n=o.clientHeight;}else n=document.body.clientHeight;for(var p=0;p<k.length;p++){var q=k[p];if(!h.hasClass(q,'noresize')){var r=j.getElementPosition(q,'document').y,s=n-r;q.style.height=s/(k.length-p)+'px';}}}i.add(window,'resize',l);var m={smartSizingFrameAdded:function(){k=[];var n=g(document.getElementsByTagName('iframe'));n.forEach(function(o){if(h.hasClass(o,'smart_sizing_iframe')&&!h.hasClass(o,'noresize')){h.removeClass(o,'canvas_iframe_util');k.push(o);}});l();}};e.exports=m;},null);
__d("XPendingSyncRequestsController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/platform\/games\/sync_requests\/pending_list\/",{app_id:{type:"Int",required:true}});},null);
__d("CanvasSyncRequestsController",["Arbiter","AsyncRequest","ChannelConstants","SyncRequestStatusEnum","XPendingSyncRequestsController"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l={},m=false,n=0,o;function p(u){if(r(u))q(u);l[u.id]=u;u.timer=setTimeout(function(){u.status=j.EXPIRED;s(u);},u.timeout*1000);}function q(u){clearTimeout(l[u.id].timer);delete l[u.id];}function r(u){return l[u.id]!==(void 0);}function s(u){if(!r(u))return;if(u.status!=j.PENDING){var v={id:u.id,status:j.namesByValue[u.status]};g.inform('canvas.syncRequestUpdated',v);q(u);}}g.subscribe(i.getArbiterType('sync_request_created'),function(u,v){return p(v.obj);});g.subscribe(i.getArbiterType('sync_request_updated'),function(u,v){return s(v.obj);});var t={setAppID:function(u){n=u;if(o)o();},initPendingSyncRequests:function(){if(m)return;if(n===0){o=t.initPendingSyncRequests;return;}m=true;var u=k.getURIBuilder().setInt('app_id',n).getURI();new h().setURI(u).setHandler(function(v){v.getPayload().forEach(p);}).send();}};e.exports=t;},null);
__d("JSONRPC",["Log"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();function h(i){"use strict";this.$JSONRPC0=0;this.$JSONRPC1={};this.remote=function(j){this.$JSONRPC2=j;return this.remote;}.bind(this);this.local={};this.$JSONRPC3=i;}h.prototype.stub=function(i){"use strict";this.remote[i]=function(){for(var j=[],k=0,l=arguments.length;k<l;k++)j.push(arguments[k]);var m={jsonrpc:'2.0',method:i};if(typeof j[j.length-1]=='function'){m.id=++this.$JSONRPC0;this.$JSONRPC1[m.id]=j.pop();}m.params=j;this.$JSONRPC3(JSON.stringify(m),this.$JSONRPC2||{method:i});}.bind(this);};h.prototype.read=function(i,j){"use strict";var k=JSON.parse(i),l=k.id;if(!k.method){if(!this.$JSONRPC1[l]){g.warn('Could not find callback %s',l);return;}var m=this.$JSONRPC1[l];delete this.$JSONRPC1[l];delete k.id;delete k.jsonrpc;m(k);return;}var n=this,o=this.local[k.method],p;if(l){p=function(s,t){var u={jsonrpc:'2.0',id:l};u[s]=t;setTimeout(function(){n.$JSONRPC3(JSON.stringify(u),j);},0);};}else p=function(){};if(!o){g.error('Method "%s" has not been defined',k.method);p('error',{code:-32601,message:'Method not found',data:k.method});return;}k.params.push(p.bind(null,'result'));k.params.push(p.bind(null,'error'));try{var r=o.apply(j||null,k.params);if(typeof r!=='undefined')p('result',r);}catch(q){g.error('Invokation of RPC method %s resulted in the error: %s',k.method,q.message);p('error',{code:-32603,message:'Internal error',data:q.message});}};e.exports=h;},null);
__d("XdArbiter",["Arbiter","Log","QueryString","Queue"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=/^apps\./.test(location.hostname)?'canvas':'tab',l={},m=[],n=new j(),o={setRpcHandler:function(q){n.start(q);},handleMessage:function(q,r,s){try{if(typeof q=='string'){if(/^FB_RPC:/.test(q)){n.enqueue([q.substring(7),{origin:r,source:s||l[k]}]);return;}q=JSON.parse(q);}if(!q.method)return;if(typeof q.params=='string')q.params=JSON.parse(q.params);g.inform('Connect.Unsafe.'+q.method,q.params,g.BEHAVIOR_PERSISTENT);}catch(t){}},register:function(q,r,s){var t=r||k;g.inform("XdArbiter/register",{origin:s});l[t]=q;l[s]=q;g.inform('XdArbiter.register',t,g.BEHAVIOR_PERSISTENT);this.scheduleDispatch();return t;},scheduleDispatch:function(){var q=this,r=42;function s(){var t=m.shift();if(t)q.send.apply(q,t);if(m.length)setTimeout(s,r);}setTimeout(s,r);},hasProxy:function(q){var r=q||k;return !!l[r];},send:function(q,r,s){var t=s in l?s:k;r=r||l[t];if(typeof q!=='string')q=i.encode(q);try{r.proxyMessage(q,s);}catch(u){h.debug('XdArbiter: Proxy for %s not available, '+'page might have been navigated: %s',t,u.message);delete l[t];}return true;}},p=a.XdArbiter;a.XdArbiter=o;if(p){if(p._p.length)while(p._p.length)o.register.apply(o,p._p.shift());if(p._m.length)while(p._m.length)o.handleMessage.apply(o,p._m.shift());}e.exports=o;},null);
__d("PlatformAppController",["Arbiter","AsyncRequest","Bootloader","CanvasNavigationFullScreen","CanvasPresenceController","CSS","CurrentUser","Dialog","JSONRPC","PlatformDialogClient","Style","URI","Vector","XdArbiter","CanvasSyncRequestsController","ge"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){b.__markCompiled&&b.__markCompiled();var w={oauth:true,test_flow:true,app_requests:true,game_group_create:true,game_group_join:true,gift:true,share:true,share_open_graph:true,sync_request:true},x,y,z=true,aa=0,ba=false,ca,da=false,ea=window._cstart,fa=0,ga,ha,ia={},ja=new o(function(va,wa){t.send('FB_RPC:'+va,wa.source||v(x).contentWindow.frames['fb_xdm_frame_'+location.protocol.replace(':','')],wa.origin||y);});g.subscribe("XdArbiter/register",function(va,wa){if(ga&&wa.origin!=y)new h().setURI('/platform/app_owned_url_check/').setData({appid:ga,url:wa.origin}).setHandler(function(xa){var ya=xa.getPayload();if(ya.allowed)y=wa.origin;}).send();});function ka(va){var wa=parseInt(va.x,10),xa=parseInt(va.y,10);if(wa>=0&&xa>=0)window.scrollTo(wa,xa);}function la(va){var wa=v(va.frame.replace(/_fb_https$/,''));if(wa){l.addClass(wa,'noresize');wa.style.height=va.height+'px';}}function ma(){var va=v(x),wa=0,xa=0;while(va){wa+=parseInt(va.offsetLeft,10);xa+=parseInt(va.offsetTop,10);va=va.offsetParent;}var ya=s.getViewportDimensions(),za=s.getScrollPosition();return {clientWidth:ya.x,clientHeight:ya.y,scrollLeft:za.x,scrollTop:za.y,offsetLeft:wa,offsetTop:xa};}function na(va,wa,xa){var ya=va.method;delete va.method;delete va.access_token;delete va.next;delete va.context;delete va.locale;va.display='async';if(!/^[\w\-_.]+$/.test(ya))throw new Error('Malformed method name');if(!va.redirect_uri||r(va.redirect_uri).getOrigin()!=r(this.origin).getOrigin())va.redirect_uri=this.origin;if(ya=='permissions.oauth'||ya=='permissions.request')ya='oauth';if(ya=='apprequests'){ya='app_requests';va.context='canvas_app_requests';}if(ya=='pay')if(va.action=='purchaseitem'){w[ya]=ha&&ha.useNewPayDialogs;}else w[ya]=false;if(w[ya]){var za=va.redirect_uri;p.async(ya,va,function(cb){if(cb.error_code==1340004){if(m.getID()&&m.getID()!="0"){wa(cb);}else r('/login.php').addQueryData('next',r.getRequestURI().toString()).go();}else if(ya=='app_requests'&&cb.error_code==1349146){oa(ya,va,wa,cb,za);}else wa(cb);});return;}var ab=r('/fbml/ajax/dialog/'+ya.replace(/\./g,'_')).setQueryData(va),bb=new h().setMethod('GET').setReadOnly(true).setURI(ab).setAbortHandler(function(){xa(p.REQUEST_ABORTED_ERROR);});new n().setAsync(bb).setModal(true).setWideDialog(true).show().setCloseHandler(wa);}function oa(va,wa,xa,ya,za){wa.redirect_uri=za;p.async('oauth',wa,function(ab){if(ab.error){xa(ya);}else{wa.redirect_uri=za;p.async(va,wa,function(bb){xa(bb);});}});}function pa(va){ba=va;}function qa(va,wa){da=va;ca=wa;}ja.stub('navigate');function ra(va){if(ba){ja.remote.navigate(va);return true;}return false;}ja.stub('enterFullScreen');g.subscribe('canvas.enter_fullscreen',ja.remote.enterFullScreen);ja.stub('exitFullScreen');g.subscribe('canvas.exit_fullscreen',ja.remote.exitFullScreen);ja.stub('fireEvent');g.subscribe('canvas.friendsOnlineUpdated',ja.remote.fireEvent.bind(ja.remote));g.subscribe('canvas.syncRequestUpdated',ja.remote.fireEvent.bind(ja.remote));function sa(va){var wa=va.time-ea+fa;switch(va.name){case 'StopIframeAppTtiTimer':fa=wa;return {time_delta_ms:wa,type:"tti"};case 'StartIframeAppTtiTimer':ea=va.time;break;case 'RecordIframeAppTti':if(da)i.loadModules(["CanvasIFrameLogger"],function(xa){xa.log(wa,va.appId,ca);});return {time_delta_ms:wa,type:"tti"};}}ja.local.setSize=la;ja.local.getPageInfo=ma;ja.local.scrollTo=ka;ja.local.showDialog=na;ja.local.setNavigationEnabled=pa;ja.local.isFullScreenSupported=j.isSupported;ja.local.getFullScreen=j.getFullScreen;ja.local.logTtiMessage=sa;ja.local.useFriendsOnline=k.useFriendsOnline.bind(k);ja.local.initPendingSyncRequests=u.initPendingSyncRequests.bind(u);t.setRpcHandler(function(va){ja.read.apply(ja,va);});ja.stub('hidePluginObjects');g.subscribe('layer_shown',function(){if(++aa===1)if(z){ja.remote.hidePluginObjects();}else q.set(v('pagelet_canvas_content'),'visibility','hidden');});ja.stub('showPluginObjects');g.subscribe('layer_hidden',function(){if(--aa===0){if(z){ja.remote.showPluginObjects();}else q.set(v('pagelet_canvas_content'),'visibility','');}else if(aa<0)aa=0;});function ta(va){ia[va.name]=va;var wa=v(va.name);if(wa)x=wa;}var ua={setActiveIframeAndAppID:function(va,wa,xa){x=va;y=wa;ga=xa;k.setAppID(ga);u.setAppID(ga);},setInformAppOnLayerChange:function(va){z=va;},setNavigationEnabled:pa,setTtiEnabled:qa,handleNavigation:ra,init:ta,getFrameParams:function(va){return ia[va];},setConfig:function(va){ha=va;}};a.PlatformAppController=ua;e.exports=ua;},null);
__d("FavIcon",["DOM"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h;function i(){var k=g.scry(document.head,"link");if(k)k.forEach(function(l){if(l.rel.indexOf('icon')!=-1||l.rel.indexOf('shortcut icon')!=-1)g.remove(l);});}var j={set:function(k){if(h)g.remove(h);i();h=g.create('link',{type:'image/x-icon',rel:'icon',href:k});g.appendContent(g.find(document,'head'),h);}};e.exports=j;},null);
__d("PlatformCanvasController",["PlatformAppController","DOMEventListener","URI","CSS","DOM","DocumentTitle","FavIcon","ge","fbt","AsyncRequest","UserActivity","UIPagelet","PageTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b.__markCompiled&&b.__markCompiled();var t='iframe_canvas',u=240000,v=5000,w=60000,x,y,z,aa,ba,ca,da;function ea(na){var oa=n('pagelet_canvas_content');j.hide(oa);k.scry(oa,'iframe').forEach(function(pa){pa.src='';});k.setContent(n('canvas_throbber_text'),o._("Loading {app-name}",[o.param("app-name",na)]));}function fa(na,oa,pa,qa,ra){var sa=n('pagelet_canvas_footer_content'),ta=n('pagelet_canvas_content'),ua=n('pagelet_canvas_ip_banner_content');k.setContent(ta,na);k.setContent(sa,oa);k.setContent(ua,ra);j.show(ta);l.set(pa);m.set(qa);}function ga(na){if(na.getSubdomain()!='apps')return false;var oa,pa=k.scry(document,'a[data-appname]');for(var qa=0;qa<pa.length;qa++)if(pa[qa].href==na){oa=pa[qa].getAttribute('data-appname');break;}if(!oa)return false;var ra=na.getPath().split('/')[1];if(ra=='l.php')return false;ea(oa);if(n('pagelet_canvas_storybox'))new p().setURI(new i('/ajax/canvas/storybox')).setData({fb_app_name:ra}).setMethod('GET').setReadOnly(true).send();var sa=na.getUnqualifiedURI();new p().setURI(new i('/ajax/canvas.php')).setData({fb_app_name:ra,uri:sa.toString()}).setMethod('GET').setReadOnly(true).setStatusElement('canvas_throbber').setHandler(function(ta){var ua=ta.getPayload();j.conditionClass(document.body,'center_fixed_width_app',!ua.is_liquid);fa(ua.main_html,ua.footer_html,ua.page_title,ua.favicon,ua.start_now_banner_markup);s.transitionComplete();}).send();return true;}function ha(na){if(!String(na.getPath()).startsWith('/'+z+'/')&&!String(na.getPath()).startsWith('/'+y+'/'))return false;na=na.getUnqualifiedURI();na.setPath('/'+na.getPath().split('/').slice(2).join('/'));return g.handleNavigation(na.toString());}function ia(na){return ha(na)||ga(na);}function ja(){var na=Date.now();if((x>0)&&(na-aa>=u)){aa=na;r.loadFromEndpoint('WebEgoPane','pagelet_ego_pane',{pid:9,data:[y,++ba]},{bundle:false});}}q.subscribe(function(){var na=Date.now();if(na-aa>=u-v)setTimeout(ja,v);});function ka(){var na=Date.now();if((x>0)&&(na-ca>=w)){ca=na;r.loadFromEndpoint('CanvasShowcaseSliderPagelet','pagelet_canvas_showcase',{pid:129,data:[y,++da]},{bundle:false});}}function la(na,oa,pa,qa,ra){x=pa;aa=Date.now();ba=0;ca=Date.now();da=0;if(y&&y!==na)ja();y=na;z=oa;var sa=n(t);g.setConfig(ra);if(sa)h.add(sa,'load',function(){g.setNavigationEnabled(false);});if(ra&&ra.displayShowcase)setInterval(ka,w);g.setInformAppOnLayerChange(!qa);g.setNavigationEnabled(false);s.registerHandler(ia);}var ma={setup:la};e.exports=ma;},null);
__d("MusicButtonStore",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={},h={addButton:function(i,j){g[i]=j;return j;},getButton:function(i){return g[i];},getButtons:function(){return g;},removeButton:function(i){g[i]&&g[i].resetLoadingTimers();delete g[i];}};e.exports=h;},null);
__d("MusicConstants",["URI"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={DEBUG:false,CONFIG:{PARTNER_TIMEOUT:8000},LIVE_LISTEN_MIN_SPOTIFY_VERSION:'spotify-0.6.6.0.g5a9eaca5',enableDebug:function(){this.DEBUG=true;},sameURLs:function(i,j){var k=/\/$/;if(i&&j){i=g(i);j=g(j);return i.getDomain()==j.getDomain()&&i.getPath()==j.getPath();}return false;},greaterOrEqualToMinimumVersion:function(i,j){var k=/(?:\d+\.)+/,l=i.match(k)[0].split('.').slice(0,-1),m=j.match(k)[0].split('.').slice(0,-1);if(l.length!==m.length)return false;for(var n=0;n<m.length;n++)if(+l[n]<+m[n]){return false;}else if(+l[n]>+m[n])return true;return true;},sanitizeForProviders:function(i){var j={};for(var k in i)if(this.ALLOWED_EXTERNAL_CONTEXT_PARAMS[k])j[k]=i[k];return j;},OP:{RESUME:'RESUME',PAUSE:'PAUSE',PLAY:'PLAY',VERSION:'VERSION'},STATUS_CHANGE_OP:{STATUS:'STATUS',LOGIN:'LOGIN',REINFORM:'REINFORM'},STATUS_CHANGE_EVENT:{playing:'PLAY_STATE_CHANGED',track:'TRACK_CHANGED'},DIAGNOSTIC_EVENT:{ALL_PAUSED:'ALL_PAUSED',ALL_OFFLINE:'ALL_OFFLINE',OFFLINE:'OFFLINE',ONLINE:'ONLINE',SEARCHING:'SEARCHING',HIT:'HIT',MISS:'MISS',RESIGN:'RESIGN',IFRAME_POLLING:'IFRAME_POLLING',RELAUNCH:'RELAUNCH',STATE_CHANGE:'STATE_CHANGE',WRONG_VERSION:'WRONG_VERSION',SERVICE_ERROR:'SERVICE_ERROR',INCORRECT_ONLINE_STATE:'INCORRECT_ONLINE_STATE',LOG_SEND_OP:'LOG_SEND_OP',REQUEUE_OP:'REQUEUE_OP'},ALLOWED_STATUS_PARAMS:{playing:'playing',track:'track',context:'context',client_version:'client_version',start_time:'start_time',expires_in:'expires_in',open_graph_state:'open_graph_state'},ALLOWED_EXTERNAL_CONTEXT_PARAMS:{uri:true,song:true,radio_station:true,album:true,playlist:true,musician:true,song_list:true,offset:true,title:true,request_id:true,listen_with_friends:true,needs_tos:true},LIVE_LISTEN_OP:{NOW_LEADING:'NOW_LEADING',NOW_LISTENING:'NOW_LISTENING',END_SESSION:'END_SESSION',SONG_PLAYING:'SONG_PLAYING',LISTENER_UPDATE:'LISTENER_UPDATE',QUEUE_SESSION:'QUEUE_SESSION',PLAY_ERROR:'PLAY_ERROR',SESSION_UPDATED:'SESSION_UPDATED',QUEUING_SESSION:'QUEUING_SESSION'},MUSIC_BUTTON:{ACTIVATE:'ACTIVATE'},ERROR:{1:'SERVICE_UNAVAILABLE_WITHOUT_PREMIUM',2:'SERVICE_UNAVAILABLE_WITHOUT_PREMIUM_OR_WAIT',3:'SERVICE_UNAVAILABLE_BILLING_ISSUE',4:'SERVICE_UNAVAILABLE_TECHNICAL_ISSUE',5:'AUDIO_AD_PLAYING',99:'SERVICE_TEMPORARILY_UNAVAILABLE',101:'SONG_UNAVAILABLE_WITHOUT_PURCHASE',102:'SONG_UNAVAILABLE_WITHOUT_PREMIUM',103:'SONG_UNAVAILABLE_INDEFINITELY'}};e.exports=a.MusicConstants||h;},null);
__d("MusicEvents",["Arbiter"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();e.exports=a.MusicEvents=new g();},null);
__d("MusicButton",["BanzaiODS","Bootloader","copyProperties","CSS","DOM","MusicButtonStore","MusicConstants","MusicEvents","Parent","BanzaiScuba","Tooltip","cx","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b.__markCompiled&&b.__markCompiled();var t=function(u,v,w,x,y,z){this.provider=u;this.buttonElem=v;this.url=w;this.context=x||{};this.mediaType=y;this.setState(this.STATES.OFFLINE);this.tooltip=z||'';n.subscribe(m.MUSIC_BUTTON.ACTIVATE,this.processClick.bind(this));};i(t,{tracksetableTypes:[]});i(t.prototype,{SHOW_LOADING_TIMEOUT:500,HIDE_LOADING_TIMEOUT:m.CONFIG.PARTNER_TIMEOUT,RECENTLY_ONLINE_TIMEOUT:6000,STATES:{PLAYING:'music_playing',PAUSED:'music_paused',LOADING:'music_loading',DISABLED:'music_disabled',OFFLINE:'music_offline'},setState:function(u){if(u!==this.STATES.LOADING){this.resetLoadingTimers();this.previousState=this.state||u;}if(u===this.STATES.PLAYING){q.set(this.buttonElem,this.tooltip);}else q.set(this.buttonElem,'');var v=this.buttonElem.parentNode;this.state&&j.removeClass(v,this.state);this.state=u;j.addClass(v,this.state);},isTracksetable:function(u){return t.tracksetableTypes.indexOf(this.mediaType)!==-1;},handleIncomingEvent:function(u,v){clearTimeout(this._showLoadingTimer);if(v&&v.provider&&v.provider!=this.provider)return;switch(u){case m.DIAGNOSTIC_EVENT.ONLINE:case m.STATUS_CHANGE_EVENT.track:case m.STATUS_CHANGE_EVENT.playing:var w=v&&v.track&&v.track.uri,x=v&&v.context&&v.context.uri;if(v&&v.playing&&(m.sameURLs(w,this.url)||m.sameURLs(x,this.url))){this.setState(this.STATES.PLAYING);}else if(this.state===this.STATES.LOADING&&(this.previousState===this.STATES.PAUSED||this.previousState===this.STATES.OFFLINE)){clearTimeout(this._attemptingPlayTimer);this._attemptingPlayTimer=s(this.setState.bind(this,this.STATES.PAUSED),this.RECENTLY_ONLINE_TIMEOUT);}else if(!this._attemptingPlayTimer)this.setState(this.STATES.PAUSED);break;case m.DIAGNOSTIC_EVENT.OFFLINE:this.setState(this.STATES.OFFLINE);break;case m.DIAGNOSTIC_EVENT.ALL_OFFLINE:this.setState(this.STATES.OFFLINE);break;}},processClick:function(u,v){if(v!=this.buttonElem){if(this.state===this.STATES.LOADING)this.previousState&&this.setState(this.previousState);return;}var w=new p('music_play_button_click',null,{addBrowserFields:true,addPredictedGeographyFields:true,addUser:true});w.addNormal('uses_bridge','1');w.addNormal('state',this.state);w.addNormal('provider',this.provider);w.addNormal('class','MusicButton');w.addNormal('insights_source',this.context.appear_source_log_str);w.addDenorm('url',this.url);w.post();if(this.state!=this.STATES.PLAYING){g.bumpEntityKey('music_play_button','music_play_button_click');g.bumpEntityKey('music_play_button','music_play_button_click.'+this.provider);var x=o.byClass(this.buttonElem,"_4--s");if(x){j.addClass(x,"_4--t");setTimeout(j.removeClass.bind(null,x,"_4--t"),3000);}}var y=this.isTracksetable()&&o.byClass(this.buttonElem,'music_trackset_container'),z=[];if(y){var aa=y.getAttribute('data-trackset-title'),ba=this.provider,ca=k.scry(y,'.music_button');for(var da=0;da<ca.length;da++){var ea=l.getButton([ca[da].id]);if(ea&&ea.provider==ba&&ea.isTracksetable())z.push(ea.url);}}if(!a.Music)this.showLoading(true);h.loadModules(["Music"],function(fa){var ga=(y&&z.length>1)?fa.playPauseSongList(this.provider,this.url,z,aa,this.context):fa.playPauseSong(this.provider,this.url,this.context);this.showLoading(!ga);}.bind(this));},showLoading:function(u){this.resetLoadingTimers();this._hideLoadingTimer=s(this._timeout.bind(this,u),this.HIDE_LOADING_TIMEOUT);this._showLoadingTimer=s(this.setState.bind(this,this.STATES.LOADING),this.SHOW_LOADING_TIMEOUT);},resetLoadingTimers:function(){clearTimeout(this._hideLoadingTimer);clearTimeout(this._showLoadingTimer);clearTimeout(this._attemptingPlayTimer);this._attemptingPlayTimer=null;},destroy:function(){this.resetLoadingTimers();this.buttonElem=null;},_timeout:function(u){a.Music&&a.Music.reInform([this.provider]);if(!u&&this.state===this.STATES.LOADING)this.setState(this.STATES.PAUSED);}});e.exports=t;},null);
__d("MusicButtonManager",["Event","DOM","KeyedCallbackManager","Layer","MusicButton","MusicButtonStore","MusicConstants","MusicEvents","Parent","$","copyProperties","ge"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();var s=new i(),t=null,u={},v=0;function w(da){var ea=da.getTarget(),fa=o.byClass(ea,'music_button');fa=fa||(!(da.getModifiers&&da.getModifiers().any)&&x(ea));if(!fa)return;return y(fa,da);}function x(da){var ea=o.byClass(da,'music_button_trigger')&&o.byClass(da,'music_button_trigger_group');if(ea){var fa=h.scry(ea,'.music_button');if(fa.length)return fa[0];}return null;}function y(da,event){event&&event.stop();n.inform(m.MUSIC_BUTTON.ACTIVATE,da);return false;}function z(da){a.Music&&a.Music.reInform(da);}function aa(da,ea){var fa=l.getButtons();for(var ga in fa)if(fa[ga].noGC||r(ga)){fa[ga].handleIncomingEvent(da,ea);}else l.removeButton(ga);}var ba={init:function(da){if(t)return;t=true;k.tracksetableTypes=da||[];g.listen(document.body,'click',w);n.subscribe([m.STATUS_CHANGE_EVENT.playing,m.STATUS_CHANGE_EVENT.track,m.DIAGNOSTIC_EVENT.OFFLINE,m.DIAGNOSTIC_EVENT.ALL_OFFLINE,m.DIAGNOSTIC_EVENT.ONLINE],aa);},add:function(da,ea,fa,ga,ha,ia){t||ba.init();var ja=ea.id,ka=l.getButton(ja);if(ka)return ka;ka=l.addButton(ja,new k(da,ea,fa,q({button_id:ja},ga),ha,ia));var la=o.byClass(ea,'uiOverlay');if(la){ka.noGC=true;var ma=j.subscribe('destroy',function(na,oa){if(h.contains(oa.getRoot(),ea)){l.removeButton(ja);j.unsubscribe(ma);}});}if(da&&!u[da])u[da]=setTimeout(function(){var na=Object.keys(u);na.length&&z(na);u={};},0);return ka;},addButton:function(da,ea,fa,ga,ha,ia){if(!r(ea))return;var ja=p(ea);return ba.add(da,ja,fa,ga,ha,ia);},asyncAddMusicButton:function(da,ea){da.setAttribute('id','music_button_'+v++);ca(da,ea);},tryAddButtonInDOM:function(da,ea){var fa=r(da);fa&&ca(fa,ea);},addMusicData:function(da,ea,fa,ga,ha,ia){s.setResource(da,{provider:ea,uri:fa,context:ga,media_type:ha,tooltip:ia});}};function ca(da,ea){var fa=h.find(da,'a.button_anchor').getAttribute('href');s.executeOrEnqueue(fa,function(ga){return ba.add(ga.provider,da,ga.uri,ga.context,ga.media_type,ea?ga.tooltip:'');});}e.exports=a.MusicButtonManager||ba;},null);
__d("P2PActionConstants",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();'use strict';var g={CREDIT_CARDS_UPDATED:'credit_cards_updated',CREDIT_CARD_ADDED:'credit_card_added',CREDIT_CARD_ADDED_ERROR:'credit_card_added_error',CREDIT_CARD_DELETED:'credit_card_deleted',CREDIT_CARD_DELETED_ERROR:'credit_card_deleted_error',CREDIT_CARD_UPDATED:'credit_card_updated',CREDIT_CARD_UPDATED_ERROR:'credit_card_updated_error',PRESET_CREDIT_CARD_UPDATED:'preset_credit_card_updated',PRESET_CREDIT_CARD_UPDATED_ERROR:'preset_credit_card_updated_error',CREDIT_CARD_VERIFIED:'credit_card_verified',CREDIT_CARD_VERIFIED_ERROR:'credit_card_verified_error',TRANSFERS_UPDATED:'transfers_updated',TRANSFERS_UPDATED_ERROR:'transfers_updated_error',TRANSFER_ADDED:'transfer_added',TRANSFER_ADDED_ERROR:'transfer_added_error',TRANSFER_UPDATED:'transfer_updated',TRANSFER_UPDATED_ERROR:'transfer_updated_error',TRANSFER_ACCEPTED:'transfer_accepted',TRANSFER_DECLINED:'transfer_declined'};e.exports=g;},null);
__d("P2PDispatcher",["Dispatcher"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';e.exports=new g();},null);
__d("P2PActions",["P2PActionConstants","P2PDispatcher"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';var i={updateCreditCards:function(j){h.dispatch({type:g.CREDIT_CARDS_UPDATED,data:j});},addCreditCard:function(j){h.dispatch({type:g.CREDIT_CARD_ADDED,data:j});},addCreditCardError:function(j){h.dispatch({type:g.CREDIT_CARD_ADDED_ERROR,data:j});},updatePresetCreditCard:function(j){h.dispatch({type:g.PRESET_CREDIT_CARD_UPDATED,data:j});},updatePresetCreditCardError:function(j){h.dispatch({type:g.PRESET_CREDIT_CARD_UPDATED_ERROR,data:j});},updateCreditCard:function(j){h.dispatch({type:g.CREDIT_CARD_UPDATED,data:j});},updateCreditCardError:function(j){h.dispatch({type:g.CREDIT_CARD_UPDATED_ERROR,data:j});},deleteCreditCard:function(j){h.dispatch({type:g.CREDIT_CARD_DELETED,data:j});},deleteCreditCardError:function(j){h.dispatch({type:g.CREDIT_CARD_DELETED_ERROR,data:j});},verifyCreditCard:function(j){h.dispatch({type:g.CREDIT_CARD_VERIFIED,data:j});},verifyCreditCardError:function(j){h.dispatch({type:g.CREDIT_CARD_VERIFIED_ERROR,data:j});},updateTransfers:function(j){h.dispatch({type:g.TRANSFERS_UPDATED,data:j});},updateTransfersError:function(j){h.dispatch({type:g.TRANSFERS_UPDATED_ERROR,data:j});},transferAdded:function(j){h.dispatch({type:g.TRANSFER_ADDED,data:j});},transferAddedError:function(j){h.dispatch({type:g.TRANSFER_ADDED_ERROR,data:j});},transferUpdated:function(j){h.dispatch({type:g.TRANSFER_UPDATED,data:j});},transferUpdatedError:function(j){h.dispatch({type:g.TRANSFER_UPDATED_ERROR,data:j});},transferAccepted:function(){h.dispatch({type:g.TRANSFER_ACCEPTED});},transferDeclined:function(j){h.dispatch({type:g.TRANSFER_DECLINED,data:j});}};e.exports=i;},null);
__d("P2PAPIUtils",["CreditCardFormParam","fbt","guid","merge"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k={genRequestID:function(){return 'id:'+i()+':'+Date.now();},getUncaughtErrorMessage:function(){return (h._("Sorry, something went wrong. Please try again later."));},prepareCardMutationData:function(l){var m={},n=l[g.CARD_NUMBER].replace(/ /g,''),o=l[g.CARD_EXPIRATION].split('/');m[g.CARD_NUMBER]=n;m[g.MONTH]=o[0];m[g.YEAR]=o[1];m[g.CARD_EXPIRATION]={};m[g.CARD_EXPIRATION][g.MONTH]=m[g.MONTH];m[g.CARD_EXPIRATION][g.YEAR]=m[g.YEAR];return j(l,m);}};e.exports=k;},null);
__d("XP2PCreditCardDeleteController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/credit_cards\/_delete\/",{});},null);
__d("XP2PCreditCardUpdateController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/credit_cards\/_update\/",{});},null);
__d("XP2PCreditCardCreateController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/credit_cards\/_create\/",{});},null);
__d("XP2PCreditCardsController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/credit_cards\/",{type:{type:"Int",defaultValue:1}});},null);
__d("XP2PPasswordProtectionStatusController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/password_protection_status\/",{});},null);
__d("XP2PPasswordProtectionStatusUpdateController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/password_protection_status\/_update\/",{});},null);
__d("XP2PPresetCreditCardSetController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/preset_credit_card\/_set\/",{});},null);
__d("XP2PTransactionsCreateController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/transactions\/_create\/",{});},null);
__d("XP2PTransactionsController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/transactions\/",{since:{type:"Int"}});},null);
__d("XP2PTransactionsDeclineController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/transactions\/_decline\/",{});},null);
__d("XP2PTransactionsCancelController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/transactions\/_cancel\/",{});},null);
__d("XP2PCreditCardVerifyController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/p2p\/credit_cards\/_verify\/",{});},null);
__d("P2PAPI",["AsyncRequest","CreditCardFormParam","P2PActions","P2PAPIUtils","P2PPasswordProtectionParam","P2PPaymentCreditCardsTypes","P2PTransferParam","ImmutableObject","URI","XP2PCreditCardDeleteController","XP2PCreditCardUpdateController","XP2PCreditCardCreateController","XP2PCreditCardsController","XP2PPasswordProtectionStatusController","XP2PPasswordProtectionStatusUpdateController","XP2PPresetCreditCardSetController","XP2PTransactionsCreateController","XP2PTransactionsController","XP2PTransactionsDeclineController","XP2PTransactionsCancelController","XP2PCreditCardVerifyController","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba){b.__markCompiled&&b.__markCompiled();'use strict';var ca={getAllCreditCards:function(){var da=(s.getURIBuilder()).getURI();new g().setData({type:l.SENDING}).setURI(da).setMethod('GET').setReadOnly(true).setHandler(function(ea){var fa=ea.getPayload();if(!fa.error)i.updateCreditCards(fa);}.bind(this)).send();},createTransaction:function(da){var ea=(w.getURIBuilder()).getURI(),fa={},ga=da.formData,ha=da.success||ba,ia=da.error||ba;fa[h.CREDENTIAL_ID]=ga[h.CREDENTIAL_ID];fa.amount=ga.amount;fa.receiver_id=ga.receiverId;fa.offline_threading_id=j.genRequestID();new g().setData(fa).setMethod('POST').setURI(ea).setHandler(function(ja){var ka=ja?ja.getPayload():{};if(ka.error){ia(ka.error);}else{ha(ka);this.getAllCreditCards();}}.bind(this)).setErrorHandler(function(){ia({message:j.getUncaughtErrorMessage()});}.bind(this)).send();},addCreditCard:function(da){var ea=(r.getURIBuilder()).getURI().getPath(),fa=o('/ajax/payment/token_proxy.php').addQueryData('tpe',ea);da=j.prepareCardMutationData(da);var ga=new n(da);new g().setData(da).setMethod('POST').setURI(fa).setHandler(function(ha){var ia=ha.getPayload(),ja={};if(!ia.errors){ja[h.CREDENTIAL_ID]=ia[h.CARD_FBID];ja.isPreset=ia.isPreset;ja.isVerified=ia.isVerified;ja.passwordProtection=ia.passwordProtection;ga=n.set(ga,ja);i.addCreditCard(ga);}else i.addCreditCardError(Object.assign({requestID:ga.requestID},ia));}.bind(this)).setErrorHandler(function(){i.addCreditCardError({requestID:ga.requestID,errors:{general:{message:j.getUncaughtErrorMessage()}}});}.bind(this)).send();},getTransactions:function(da){da=da||{};var ea={},fa=da,ga=(x.getURIBuilder()).getURI(),ha=new n(fa);if(fa.since)ea.since=fa.since;return new g().setData(ea).setURI(ga).setMethod('GET').setReadOnly(true).setHandler(function(ia){var ja=ia.getPayload();if(!ja.error){i.updateTransfers(ja);}else i.updateTransfersError(Object.assign({requestID:ha.requestID},ja));}.bind(this)).setErrorHandler(function(){i.updateTransfersError({error:{message:j.getUncaughtErrorMessage()},requestID:ha.requestID});}.bind(this)).send();},updatePresetCreditCard:function(da){var ea=(v.getURIBuilder()).getURI();new g().setData(da).setURI(ea).setMethod('POST').setHandler(function(fa){var ga=fa.getPayload();if(!ga.error){i.updatePresetCreditCard(Object.assign({},ga,{requestID:da.requestID}));i.transferAccepted();}else i.updatePresetCreditCardError(Object.assign({},ga,{requestID:da.requestID}));}.bind(this)).setErrorHandler(function(){i.updatePresetCreditCardError({error:{message:j.getUncaughtErrorMessage()},requestID:da.requestID});}.bind(this)).send();},updateCreditCard:function(da){var ea=(q.getURIBuilder()).getURI().getPath(),fa=o('/ajax/payment/token_proxy.php').addQueryData('tpe',ea);da=j.prepareCardMutationData(da);var ga=new n(da);new g().setData(da).setMethod('POST').setURI(fa).setHandler(function(ha){var ia=ha.getPayload();if(!ia.errors){i.updateCreditCard(ga);}else i.updateCreditCardError(Object.assign({},ia,{requestID:ga.requestID}));}.bind(this)).setErrorHandler(function(){i.updateCreditCardError({errors:{general:{message:j.getUncaughtErrorMessage()}},requestID:ga.requestID});}.bind(this)).send();},deleteCreditCard:function(da){var ea=(p.getURIBuilder()).getURI();new g().setData(da).setMethod('POST').setURI(ea).setHandler(function(fa){var ga=fa.getPayload();if(!ga.error){i.deleteCreditCard(Object.assign({},ga,{requestID:da.requestID}));}else i.deleteCreditCardError(Object.assign({},ga,{requestID:da.requestID}));}.bind(this)).setErrorHandler(function(){i.deleteCreditCardError({error:{message:j.getUncaughtErrorMessage()},requestID:da.requestID});}.bind(this)).send();},getPasswordProtectionSetting:function(da){var ea=(t.getURIBuilder()).getURI(),fa=da.success||ba,ga=da.error||ba;new g().setURI(ea).setMethod('GET').setReadOnly(true).setHandler(function(ha){var ia=ha?ha.getPayload():[];if(ia.error){ga();}else fa(ia);}.bind(this)).setErrorHandler(function(){ga();}.bind(this)).send();},setPasswordProtectionSetting:function(da){var ea=(u.getURIBuilder()).getURI(),fa=da.formData,ga=da.success||ba,ha=da.error||ba,ia={};ia[k.STATUS]=fa[k.STATUS];new g().setData(ia).setURI(ea).setMethod('POST').setHandler(function(ja){var ka=ja?ja.getPayload():{};if(ka.error){ha(ka.error);}else ga();}.bind(this)).setErrorHandler(function(){ha();}.bind(this)).send();},declineTransaction:function(da){var ea=(y.getURIBuilder()).getURI(),fa=da.formData,ga=da.success||ba,ha=da.error||ba,ia={};ia[m.TRANSFER_ID]=fa[m.TRANSFER_ID];new g().setData(ia).setURI(ea).setMethod('POST').setHandler(function(ja){var ka=ja?ja.getPayload():{},la={};if(ka.error){ha(ka.error);}else{ga();la[m.TRANSFER_ID]=ia[m.TRANSFER_ID];i.transferDeclined(la);}}.bind(this)).setErrorHandler(function(){ha();}.bind(this)).send();},cancelTransaction:function(da){var ea=(z.getURIBuilder()).getURI(),fa=da.formData,ga=da.success||ba,ha=da.error||ba,ia={};ia[m.TRANSFER_ID]=fa[m.TRANSFER_ID];new g().setData(ia).setURI(ea).setMethod('POST').setHandler(function(ja){var ka=ja?ja.getPayload():{};if(ka.error){ha(ka.error);}else ga();}.bind(this)).setErrorHandler(function(){ha();}.bind(this)).send();},verifyCreditCard:function(da){var ea=(aa.getURIBuilder()).getURI().getPath(),fa=o('/ajax/payment/token_proxy.php').addQueryData('tpe',ea);new g().setData(da).setMethod('POST').setURI(fa).setHandler(function(ga){var ha=ga.getPayload();if(!ha.error){i.verifyCreditCard(Object.assign({},ha,{requestID:da.requestID}));}else i.verifyCreditCardError(Object.assign({},ha,{requestID:da.requestID}));}.bind(this)).setErrorHandler(function(){i.verifyCreditCardError({error:{message:j.getUncaughtErrorMessage()},requestID:da.requestID});}.bind(this)).send();}};e.exports=ca;},null);
__d("P2PCreditCardFormFieldMixin.react",["React","ReactInputSelection","XUITextInput.react","cx","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=49,m=g,n=m.PropTypes,o={propTypes:{onChange:n.func,reference:n.string,saveError:n.string,focused:n.bool,value:n.string,isMasked:n.bool,showFocusOutline:n.bool,showIcon:n.bool,showPlaceholder:n.bool},getDefaultProps:function(){return {onChange:k,saveError:'',focused:false,value:'',isMasked:false,showFocusOutline:true,showIcon:true,showPlaceholder:true};},getInitialState:function(){return {isValid:null,value:'',oldValue:'',focused:false,lastKeyCode:l,modified:false,cursorPosition:0,errorMessage:null};},getInputElement:function(){return this.refs.ccFormFieldInput.refs.textInput.getTextFieldDOM();},restoreCursorPosition:function(){if(!this.getUpdatedCursorPosition)return;if(this.state.oldValue===this.state.value)return;var p=this.getUpdatedCursorPosition(this.state.value,this.state.oldValue,this.state.cursorPosition);h.setSelection(this.getInputElement(),{start:p});},setAndValidate:function(p,q){var r,s=this.state.value,t=h.getSelection(this.getInputElement()),u=this.formatValue?this.formatValue(p,s,q):p;r=this.validate(u);this.setState({modified:true,value:u,oldValue:p,isValid:r,cursorPosition:t.start},this.restoreCursorPosition);this.triggerChange(u,r);},triggerChange:function(p,q){this.props.onChange(this.props.reference,p,q);},componentDidMount:function(){if(this.props.focused)setTimeout(function(){if(this.isMounted())this.focus();}.bind(this),100);this.initializeFormValue();},initializeFormValue:function(){var p;if(this.props.value){p=this.props.isMasked?true:this.validate(this.props.value);this.setState({isValid:p,modified:true,value:this.props.value});this.triggerChange(this.props.value,p);}},handleBlur:function(p){var q=this.getInputElement().value;if(q&&q!==this.state.value)this.setAndValidate(q,l);this.setState({focused:false});},handlePaste:function(p){this.setState({lastKeyCode:l});},handleChange:function(p){this.setAndValidate(p.target.value,this.state.lastKeyCode);},handleOnKeyDown:function(p){var q=p.keyCode;if(q>=96&&q<=105)q=q-48;this.setState({lastKeyCode:q});},handleFocus:function(p){this.setState({focused:true});},focus:function(){g.findDOMNode(this.refs.ccFormFieldInput).focus();},shouldShowIsValidError:function(){if(!this.state.isValid&&this.state.modified)return !this.state.focused||this.isValAtLimit();return false;},isDisabled:function(){return this.props.isMasked;},render:function(){var p=this.shouldShowIsValidError()||this.props.saveError||this.state.errorMessage;return (g.createElement("div",{className:(("_2wac")+(p?' '+"_5bqn":'')+(this.props.showFocusOutline&&!p&&this.state.focused?' '+"_5bqo":'')),onClick:this.focus},this.props.showIcon?this.getIcon():null,g.createElement(i,{autoComplete:this.getAutocompleteName(),ref:"ccFormFieldInput",defaultValue:this.props.defaultValue,value:this.state.value,onChange:this.handleChange,onPaste:this.handlePaste,onKeyDown:this.handleOnKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,placeholder:this.props.showPlaceholder?this.getPlaceholder():'',disabled:this.isDisabled(),className:(("_5bqq")+(!this.props.showIcon?' '+"_46tf":'')),xuiError:this.state.errorMessage}),g.createElement("div",{className:"_5br4"})));}};e.exports=o;},null);
__d("P2PCreditCardNumberFormFieldHelper",["Keys"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';var h={formatCardNumber:function(i,j,k,l,m){if(k===g.BACKSPACE||k===g.DELETE){var n=(j.split(m).length-1),o=(i.split(m).length-1);if(o!==n)return i;}i=i.replace(/\D/g,'');i=i.substr(0,l[l.length-1]);var p='';for(var q=1;q<l.length;q++){if(l[q]>i.length||(q===l.length-1)){p+=i.slice(l[q-1]);break;}p+=i.slice(l[q-1],l[q])+m;}return p;},getUpdatedCursorPosition:function(i,j,k,l){var m=0,n=0;while(m<k&&m<j.length&&n<i.length)if(j[m]===i[n]){m++;n++;}else if(!/^\d+$/.test(j[m])){m++;}else n++;if(i.substr(n,1)===l)n++;return n;}};e.exports=h;},null);
__d("P2PCreditCardNumberFormField.react",["React","PaymentMethodUtils","P2PCreditCardFormFieldMixin.react","P2PCreditCardNumberFormFieldHelper","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=g.createClass({displayName:"P2PCreditCardFormField",mixins:[i],getIcon:function(){return (g.createElement("div",{className:"_31_w _3_2h"}));},getAutocompleteName:function(){return 'cc-number';},isAmex:function(n){var o=h.getCardType(n||this.state.value);return (o.name==='amex');},getLimit:function(){return this.isAmex()?15:16;},isValAtLimit:function(){var n=this.getLimit(),o=this.state.value.replace(/ /g,'');return o.length===n;},formatValue:function(n,o,p){var q=this.isAmex(n)?[0,4,10,15]:[0,4,8,12,16];return j.formatCardNumber(n,o,p,q,' ');},getUpdatedCursorPosition:function(n,o,p){return j.getUpdatedCursorPosition(n,o,p,' ');},getPlaceholder:function(){return l._("Card Number");},validate:function(n){var o=this.isValidCardType(n);this.setState({errorMessage:!o?l._("Please enter a Visa or MasterCard debit card to send or receive money"):null});return !!(h.isValidCCNumber(n)&&o);},isValidCardType:function(n){var o=['mc','visa','unknown'],p=h.getCardType(n),q=p?p.name:'',r=o.indexOf(q)>=0;return r;}});e.exports=m;},null);
__d("P2PCreditCardExpDateFormField.react",["React","P2PCreditCardFormFieldMixin.react","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();'use strict';var k=g.createClass({displayName:"P2PCreditCardExpDateFormField",mixins:[h],getIcon:function(){return (g.createElement("div",{className:"_31_w _31_x"}));},getAutocompleteName:function(){return 'cc-exp';},isValAtLimit:function(){var l=this.state.value;return l.length===this.getLimit();},getLimit:function(){return 5;},getPlaceholder:function(){return (j._("MM\/YY"));},formatValue:function(l,m,n){var o=this.getLimit(),p=String.fromCharCode(n);l=l.replace(/[^0-9\/]+/g,'');var q=l.split('/'),r=q[0],s=q[1];if(s&&s.length===4){l=r+'/'+s.substr(-2);}else l=l.slice(0,o);if(!/^\d+$/.test(p)&&n!==191&&n!==111)return l;l=l.replace(/\D/g,'');if(/^\d$/.test(l)&&(l!=='0'&&l!=='1')){l='0'+l+'/';}else if(l.length>=2&&l.indexOf('/')===-1)l=l.substr(0,2)+'/'+l.substr(2,4);return l;},validate:function(l){var m=l.split('/'),n=(new Date()),o=parseInt(n.getFullYear().toString().substring(2),10),p=parseInt(n.getMonth()+1,10),q=parseInt(m[0],10),r=parseInt(m[1],10);if(l.length!==5||!q||!r||isNaN(q)||isNaN(r)||q<1||q>12)return false;if((r<o)||(r===o&&q<p)||q>12||q<1)return false;return true;}});e.exports=k;},null);
__d("P2PCreditCardCVCFormField.react",["CreditCardFormParam","React","P2PCreditCardFormFieldMixin.react","PaymentMethodUtils","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=h.createClass({displayName:"P2PCreditCardCVCFormField",mixins:[i],getIcon:function(){return (h.createElement("div",{className:"_31_w _5wcr"}));},getAutocompleteName:function(){return 'cc-csc';},isValAtLimit:function(){var n=this.state.value;return n.length===this.getLimit();},getLimit:function(){var n,o=this.props.cscMaxLength;if(!o){n=j.getCardType(this.props[g.CARD_NUMBER]);o=n.name==='amex'?4:3;}return o;},formatValue:function(n,o,p){var q=this.getLimit();n=n.replace(/\D/g,'');n=n.slice(0,q);return n;},getPlaceholder:function(){return l._("CSC");},validate:function(n){return n.length===this.getLimit();}});e.exports=m;},null);
__d("P2PCreditCardZipCodeFormField.react",["React","P2PCreditCardFormFieldMixin.react","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();'use strict';var k=g.createClass({displayName:"P2PCreditCardZipCodeFormField",mixins:[h],getIcon:function(){return (g.createElement("div",{className:"_31_w _3oce"}));},getAutocompleteName:function(){return 'postal-code';},isValAtLimit:function(){var l=this.state.value;return l.length===this.getLimit();},getLimit:function(){return 5;},getPlaceholder:function(){return j._("Billing Postcode");},formatValue:function(l,m,n){var o=this.getLimit();l=l.replace(/\D/g,'');l=l.slice(0,o);return l;},validate:function(l){return l.length===this.getLimit();}});e.exports=k;},null);
__d("P2PErrorDialog.react",["React","XUIButton.react","XUIDialog.react","XUIDialogBody.react","XUIDialogFooter.react","XUIDialogOkayButton.react","XUIDialogTitle.react","emptyFunction","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=g,q=p.PropTypes,r=g.createClass({displayName:"P2PErrorDialog",propTypes:{allowBack:q.bool,onBackClick:q.func,onOKClick:q.func,error:q.object,title:q.string},getDefaultProps:function(){return {allowBack:false,onBackClick:n,onOKClick:n,error:null,title:o._("Problem")};},handleBackButtonClick:function(){this.props.onBackClick();},handleOKButtonClick:function(){this.props.onOKClick();},renderBackButton:function(){var s=null;if(this.props.allowBack)s=g.createElement(h,{label:o._("Back"),onClick:this.handleBackButtonClick,use:"default"});return s;},renderErrorContent:function(){var s=this.props.error;if(s.message.__html){return g.createElement("span",{dangerouslySetInnerHTML:s.message});}else return g.createElement("span",null,s.message);},render:function(){return (g.createElement(i,{layerHideOnBlur:false,shown:true,width:300},g.createElement(m,{showCloseButton:false},this.props.title),g.createElement(j,null,this.renderErrorContent()),g.createElement(k,null,this.renderBackButton(),g.createElement(l,{action:"cancel",onClick:this.handleOKButtonClick,use:"default"}))));}});e.exports=r;},null);
__d("P2PErrorNotice.react",["React","XUINotice.react","cx"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j=g,k=j.PropTypes,l=g.createClass({displayName:"P2PErrorNotice",propTypes:{error:k.object},getDefaultProps:function(){return {error:null};},renderErrorContent:function(){var m=this.props.error;if(m.message.__html){return g.createElement("span",{dangerouslySetInnerHTML:m.message});}else return g.createElement("span",null,m.message);},render:function(){return (g.createElement(h,{className:"_3-8n",use:"warn"},this.renderErrorContent()));}});e.exports=l;},null);
__d("P2PCreditCardForm.react",["CreditCardFormParam","KappaWrapper","React","P2PCreditCardNumberFormField.react","P2PCreditCardExpDateFormField.react","P2PCreditCardCVCFormField.react","P2PCreditCardZipCodeFormField.react","P2PErrorDialog.react","P2PErrorNotice.react","ReactLayeredComponentMixin","cx","emptyFunction","fbt","getObjectValues"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){b.__markCompiled&&b.__markCompiled();'use strict';var u=i,v=u.PropTypes,w=i.createClass({displayName:"P2PCreditCardForm",mixins:[p],propTypes:{cscMaxLength:v.number,editMode:v.bool,onErrorDialogOKClick:v.func,onValidation:v.func,prefilledFormData:v.object,rendersErrorDialog:v.bool,saveErrors:v.object},getDefaultProps:function(){return {cscMaxLength:null,editMode:false,onErrorDialogOKClick:r,onValidation:r,prefilledFormData:{},rendersErrorDialog:false,saveErrors:null};},getInitialState:function(){var x={};x[g.CARD_NUMBER]={};x[g.CARD_NUMBER].valid=false;x[g.CARD_NUMBER].value=this.props.prefilledFormData[g.CARD_NUMBER]||'';x[g.CARD_EXPIRATION]={};x[g.CARD_EXPIRATION].valid=false;x[g.CARD_EXPIRATION].value=this.props.prefilledFormData[g.CARD_EXPIRATION]||'';x[g.CSC]={};x[g.CSC].valid=false;x[g.CSC].value=this.props.prefilledFormData[g.CSC]||'';x[g.ZIP]={};x[g.ZIP].valid=false;x[g.ZIP].value=this.props.prefilledFormData[g.ZIP]||'';return {isValid:false,fields:x};},componentWillMount:function(){h.start(6,3,0);},handleFormValueChange:function(x,y,z){var aa=this.state.fields;aa[x]={valid:z,value:y};this.validateForm();},validateForm:function(){var x=true,y=this.state.fields;x=!t(y).some(function(z){return !z.valid;});this.setState({isValid:x});this.props.onValidation(x,this.serializeFormFields());},serializeFormFields:function(){var x=this.state.fields,y={};for(var z in x)if(x.hasOwnProperty(z))y[z]=x[z].value;return y;},getSaveError:function(x){var y='',z=this.props.saveErrors;if(z&&z.fields&&z.fields[x])y=z.fields[x].message;return y;},isCreditCardNumberMasked:function(){return this.props.editMode;},isCreditCardNumberFocused:function(){return !this.props.editMode;},isExpFocused:function(){return this.props.editMode;},renderGeneralError:function(){var x=this.getGeneralError();if(!x)return;return (i.createElement(o,{error:x}));},getGeneralError:function(){if(this.props.saveErrors&&this.props.saveErrors.general)return this.props.saveErrors.general;return null;},handleErrorOKClick:function(){this.props.onErrorDialogOKClick();},renderLayers:function(){var x=this.getGeneralError();if(!this.props.rendersErrorDialog||!x)return {};return {errorMessageDialog:i.createElement(n,{error:x,onOKClick:this.handleErrorOKClick,title:s._("Problem with Saving Card")})};},render:function(){return (i.createElement("form",{className:"_3bez"},!this.props.rendersErrorDialog?this.renderGeneralError():null,i.createElement("div",{className:"_2xxs _2xxt"},i.createElement(j,{reference:g.CARD_NUMBER,onChange:this.handleFormValueChange,saveError:this.getSaveError(g.CARD_NUMBER),value:this.state.fields[g.CARD_NUMBER].value,isMasked:this.isCreditCardNumberMasked(),focused:this.isCreditCardNumberFocused()})),i.createElement("div",{className:"_2xxs _2xxu"},i.createElement(k,{reference:g.CARD_EXPIRATION,focused:this.isExpFocused(),onChange:this.handleFormValueChange,saveError:this.getSaveError(g.CARD_EXPIRATION),value:this.state.fields[g.CARD_EXPIRATION].value}),i.createElement(l,{reference:g.CSC,onChange:this.handleFormValueChange,saveError:this.getSaveError(g.CSC),cscMaxLength:this.props.cscMaxLength,creditCardNumber:this.state.fields[g.CARD_NUMBER].value,value:this.state.fields[g.CSC].value})),i.createElement("div",{className:"_2xxs _2xxv"},i.createElement(m,{reference:g.ZIP,onChange:this.handleFormValueChange,saveError:this.getSaveError(g.ZIP),value:this.state.fields[g.ZIP].value}))));}});e.exports=w;},null);
__d("P2PCreditCard",["CreditCardFormParam","CreditCardTypeEnum","PaymentMethodUtils","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l={visa:{image:k('/images/payments/icons/visa.png'),imageLarge:k('/images/payments/icons/visa-lg.png'),name:'Visa'},mc:{image:k('/images/payments/icons/mc.png'),imageLarge:k('/images/payments/icons/mc-lg.png'),name:'MasterCard'},disc:{image:k('/images/payments/icons/disc.png'),imageLarge:k('/images/payments/icons/disc-lg.png'),name:'Discover'},jcb:{image:k('/images/payments/icons/jcb.png'),imageLarge:k('/images/payments/icons/jcb-lg.png'),name:'JCB'},amex:{image:k('/images/payments/icons/amex.png'),imageLarge:k('/images/payments/icons/amex-lg.png'),name:'American Express'},unknown:{image:k('/images/brands/credit_card/credit_32.png'),imageLarge:k('/images/brands/credit_card/credit_32.png'),name:j._("Unknown Card Type")}};function m(n){this.setCredentialId(n[g.CREDENTIAL_ID]);this.setCardType(n[g.CARD_TYPE]);this.setCreditCardNumber(n[g.CARD_NUMBER]);this.setSelected(n.selected);this.setZipCode(n[g.ZIP]);this.setCSC(n[g.CSC]);this.setExp(n[g.CARD_EXPIRATION]);this.setIsPreset(n.isPreset);this.setIsVerified(n.isVerified);this.setIsMobileVerified(n.isMobileVerified);}m.prototype.getCreditCardNumber=function(){return this[g.CARD_NUMBER];};m.prototype.setCreditCardNumber=function(n){n=n.replace(/ /g,'');this.setCardProviderProps(this[g.CARD_TYPE],n);n=n.substr(n.length-4);this[g.CARD_NUMBER]=n;};m.prototype.setCardProviderProps=function(n,o){var p=this.$P2PCreditCard0(n,o);if(l[p]){this.setImage(l[p].image);this.setImageLarge(l[p].imageLarge);this.setName(l[p].name);}};m.prototype.getExp=function(){return this[g.CARD_EXPIRATION];};m.prototype.getExpFormatted=function(){var n=this[g.CARD_EXPIRATION];return n?n[g.MONTH]+'/'+n[g.YEAR]:'';};m.prototype.getExpFormattedShort=function(){var n=this[g.CARD_EXPIRATION],o='';if(n&&n[g.MONTH]&&n[g.YEAR]){o=n[g.MONTH]+'/';if(n[g.YEAR].length===4){o+=n[g.YEAR].substr(2);}else o+=n[g.YEAR];}return o;};m.prototype.setExp=function(n){if(n&&n[g.MONTH].length===1)n[g.MONTH]='0'+n[g.MONTH];this[g.CARD_EXPIRATION]=n;};m.prototype.getCSC=function(){return this[g.CSC];};m.prototype.setCSC=function(n){this[g.CSC]=n;};m.prototype.getZipCode=function(){return this[g.ZIP];};m.prototype.setZipCode=function(n){this[g.ZIP]=n;};m.prototype.getSelected=function(){return this.$P2PCreditCard1;};m.prototype.setSelected=function(n){this.$P2PCreditCard1=n;};m.prototype.getCardType=function(){return this[g.CARD_TYPE];};m.prototype.setCardType=function(n){this[g.CARD_TYPE]=n;this.setCardProviderProps(n,this[g.CARD_NUMBER]);};m.prototype.getCredentialId=function(){return this[g.CREDENTIAL_ID];};m.prototype.setCredentialId=function(n){this[g.CREDENTIAL_ID]=n;};m.prototype.$P2PCreditCard0=function(n,o){var p='default',q,r;if(n){q=Object.keys(h).filter(function(s){return h[s]===n;})[0];p=this.$P2PCreditCard2(q);}else if(o){r=i.getCardType(o);if(r)p=r.name;}return p;};m.prototype.getImage=function(){return this.$P2PCreditCard3||l.unknown.image;};m.prototype.setImage=function(n){this.$P2PCreditCard3=n;};m.prototype.getImageLarge=function(){return this.$P2PCreditCard4||l.unknown.imageLarge;};m.prototype.setImageLarge=function(n){this.$P2PCreditCard4=n;};m.prototype.getName=function(){return this.$P2PCreditCard5||l.unknown.name;};m.prototype.setName=function(n){this.$P2PCreditCard5=n;};m.prototype.getIsPreset=function(){return this.$P2PCreditCard6;};m.prototype.setIsPreset=function(n){this.$P2PCreditCard6=n||false;};m.prototype.$P2PCreditCard2=function(n){switch(n){case 'VISA':n='visa';break;case 'AMERICANEXPRESS':n='amex';break;case 'MASTERCARD':n='mc';break;case 'DISCOVER':n='disc';break;case 'JCB':n='jcb';break;default:n='unknown';break;}return n;};m.prototype.getCreditCardNumberFormatted=function(){return '*'+this[g.CARD_NUMBER];};m.prototype.getCreditCardNumberMask=function(){return '**** **** **** '+this[g.CARD_NUMBER];};m.prototype.getMaxCSCLength=function(){var n=this.$P2PCreditCard0(this[g.CARD_TYPE],this[g.CARD_NUMBER]);return n==='amex'?4:3;};m.prototype.getIsVerified=function(){return this.$P2PCreditCard7||false;};m.prototype.setIsVerified=function(n){this.$P2PCreditCard7=n;};m.prototype.getIsMobileVerified=function(){return this.$P2PCreditCard8||false;};m.prototype.setIsMobileVerified=function(n){this.$P2PCreditCard8=n;};e.exports=m;},null);
__d("P2PChooseCreditCardForm.react",["Image.react","P2PCreditCard","React","XUIRadioList.react","XUIGrayText.react","cx","emptyFunction","fbt","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();'use strict';var p=j.Item,q=i,r=q.PropTypes,s='add_debit_card',t=i.createClass({displayName:"P2PChooseCreditCardForm",propTypes:{creditCards:r.arrayOf(r.instanceOf(h)),selectedCard:r.instanceOf(h).isRequired},getDefaultProps:function(){return {creditCards:[],selectedCard:null,onChange:m,onAddDebitCardOptionSelected:m,showAddDebitCardOption:false};},getInitialState:function(){return {selectedCard:this.props.selectedCard};},getSelectedCard:function(){return this.state.selectedCard;},onChange:function(u){var v;if(u===s){this.props.onAddDebitCardOptionSelected();}else{v=this.props.creditCards.filter(function(w){return w.getCredentialId()===u;})[0];this.setState({selectedCard:v});this.props.onChange(v);}},renderCardItem:function(u,v){return (i.createElement(p,{className:"_2x6n",key:'item-'+v,value:u.getCredentialId()},i.createElement(k,{className:"_3-8r",shade:"dark",weight:"bold"},u.getName()),i.createElement(k,{shade:"dark",weight:"normal"},u.getCreditCardNumberFormatted()),i.createElement(g,{className:"_2x6p",height:24,src:u.getImage(),width:36})));},renderAddDebitCardRadioItem:function(){return (i.createElement(p,{className:"_2x6n _1gri",key:'item-'+this.props.creditCards.length,value:s},i.createElement(k,{className:"_3-8r",shade:"dark",weight:"bold"},n._("Add a Debit Card"))));},getRadioListItems:function(){var u=this.props.creditCards,v=u.map(this.renderCardItem);if(this.props.showAddDebitCardOption)v.push(this.renderAddDebitCardRadioItem());return v;},render:function(){return (i.createElement(j,{selectedValue:this.state.selectedCard.getCredentialId(),className:o(this.props.className,"_2x6r"),onValueChange:this.onChange},this.getRadioListItems()));}});e.exports=t;},null);
__d("P2PLoadingMask.react",["React","XUISpinner.react","cx"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=g,k=j.PropTypes,l=g.createClass({displayName:"P2PLoadingMask",propTypes:{visible:k.bool},getDefaultProps:function(){return {visible:false};},render:function(){if(!this.props.visible)return null;return (g.createElement("div",{className:"_3de"},g.createElement(h,{background:"dark",size:"large",className:"_3df"}),g.createElement("div",{className:"_3dg"})));}});e.exports=l;},null);
__d("P2PLogger",["BanzaiLogger"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';var h='P2PPaymentLoggerConfig',i={log:function(j,k){k=Object.assign({event:j},k);g.log(h,k);}};e.exports=i;},null);
__d("P2PPasswordProtectionNUXDialog.react",["Link.react","P2PAPI","P2PErrorDialog.react","P2PLinkConstants","P2PLoadingMask.react","P2PLogger","P2PPaymentLoggerEvent","P2PPaymentLoggerEventFlow","P2PPasswordProtectionParam","P2PPasswordProtectionStatusTypes","React","XUIButton.react","XUIDialog.react","XUIDialogTitle.react","XUIDialogBody.react","XUIDialogFooter.react","cx","emptyFunction","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){b.__markCompiled&&b.__markCompiled();'use strict';var z=q,aa=z.PropTypes,ba=q.createClass({displayName:"P2PPasswordProtectionNUXDialog",propTypes:{onComplete:aa.func},getDefaultProps:function(){return {onComplete:x};},getInitialState:function(){return {saveErrorObject:null,loading:false};},componentWillMount:function(){this.log(m.UI_ACTN_INITIATE_PASSWORD_PROTECTION_NUX);},log:function(ca,da){l.log(ca,Object.assign({www_event_flow:n.UI_FLOW_P2P_SETTINGS},da));},onSaveClick:function(){this.setState({loading:true,saveErrorObject:null});this.setPasswordProtection(p.ENABLED);this.log(m.UI_ACTN_OPT_IN_PASSWORD_PROTECTION_NUX);},setPasswordProtection:function(ca){var da={};da[o.STATUS]=ca;h.setPasswordProtectionSetting({formData:da,success:this.handleOnSaveSuccess,error:this.handleOnSaveError});},handleOnSaveSuccess:function(){this.setState({loading:false});this.props.onComplete();},handleOnSaveError:function(ca){this.setState({loading:false,saveErrorObject:ca});},isSaveButtonDisabled:function(){return this.state.loading;},isCancelButtonDisabled:function(){return this.state.loading;},onCancelClick:function(){this.setState({loading:true,saveErrorObject:null});this.setPasswordProtection(p.DISABLED);this.log(m.UI_ACTN_OPT_OUT_PASSWORD_PROTECTION_NUX);},handleErrorBackClick:function(){this.setState({saveErrorObject:null});},handleErrorOKClick:function(){this.setState({saveErrorObject:null});this.props.onComplete();},render:function(){if(this.state.saveErrorObject)return (q.createElement(i,{allowBack:true,title:y._("Problem Saving"),onBackClick:this.handleErrorBackClick,onOKClick:this.handleErrorOKClick,error:this.state.saveErrorObject}));return (q.createElement(s,{behaviors:{LayerFadeOnShow:false},layerHideOnBlur:false,shown:true,width:288},q.createElement(t,{showCloseButton:false},y._("Use password?")),q.createElement(u,null,q.createElement("div",{className:"_5sor"},y._("For additional security, enter your Facebook password to send money. You can always update this in {link}.",[y.param("link",q.createElement(g,{href:j.settingsWWWURI,target:"_blank"},y._("Settings")))]))),q.createElement(v,null,q.createElement(r,{className:"_5sov",disabled:this.isCancelButtonDisabled(),label:y._("Not Now"),onClick:this.onCancelClick,size:"medium",use:"default"}),q.createElement(r,{className:"_5sox",disabled:this.isSaveButtonDisabled(),label:y._("Use Password"),onClick:this.onSaveClick,size:"medium",use:"confirm"})),q.createElement(k,{visible:this.state.loading})));}});e.exports=ba;},null);
__d("P2PVerifyCreditCardDialog.react",["CreditCardFormParam","P2PAPI","P2PAPIUtils","P2PCreditCard","P2PErrorNotice.react","P2PLoadingMask.react","React","XUIButton.react","XUIDialog.react","XUIDialogBody.react","XUIDialogFooter.react","P2PCreditCardCVCFormField.react","P2PCreditCardZipCodeFormField.react","XUICloseButton.react","XUIDialogTitle.react","cx","emptyFunction","fbt","getObjectValues"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){b.__markCompiled&&b.__markCompiled();var z=m,aa=z.PropTypes,ba=m.createClass({displayName:"P2PVerifyCreditCardDialog",propTypes:{asyncRequestState:aa.object,creditCard:aa.instanceOf(j),onCancel:aa.func,onConfirm:aa.func,isSending:aa.bool},getDefaultProps:function(){return {asyncRequestState:{},creditCard:null,isSending:true,onCancel:w,onError:w,onSuccess:w};},getInitialState:function(){var ca={};ca[g.CSC]={};ca[g.CSC].valid=false;if(this.shouldShowZIPInput()){ca[g.ZIP]={};ca[g.ZIP].valid=false;}return {isValid:false,loading:false,requestID:'',saveError:null,fields:ca};},componentWillReceiveProps:function(ca){var da=ca.asyncRequestState?ca.asyncRequestState[this.state.requestID]:null;if(da){this.setState({requestID:''});if(da.error){this.handleOnSaveError(da.error);}else this.handleOnSaveSuccess(da);}},handleOnSaveSuccess:function(ca){this.props.onSuccess(ca);},handleOnSaveError:function(ca){this.setState({loading:false,saveError:ca});},clearSaveError:function(){this.setState({saveError:null});},handleCancelClick:function(){this.props.onCancel();},handleConfirmClick:function(){var ca={},da=i.genRequestID();ca[g.CREDENTIAL_ID]=this.props.creditCard.getCredentialId();ca[g.CSC]=this.state.fields[g.CSC].value;if(this.state.fields[g.ZIP])ca[g.ZIP]=this.state.fields[g.ZIP].value;this.clearSaveError();this.setState({loading:true,requestID:da});h.verifyCreditCard(Object.assign({requestID:da},ca));},handleFormValueChange:function(ca,da,ea){var fa=this.state.fields;fa[ca].value=da;fa[ca].valid=ea;this.setState({fields:fa});this.validateForm();},validateForm:function(){var ca=true,da=this.state.fields;ca=!y(da).some(function(ea){return !ea.valid;});this.setState({isValid:ca});},handleCloseButtonClick:function(){this.props.onCancel();},shouldShowZIPInput:function(){var ca=!!(this.props.creditCard.getZipCode());return !ca;},renderError:function(){var ca;if(this.state.saveError)ca=m.createElement(k,{error:this.state.saveError});return ca;},componentDidUpdate:function(){setTimeout(function(){try{if(this.isMounted())this.refs.dialog&&this.refs.dialog.layer.updatePosition();}catch(ca){}}.bind(this));},renderCVCFormField:function(){return (m.createElement(r,{cscMaxLength:this.props.creditCard.getMaxCSCLength(),focused:true,onChange:this.handleFormValueChange,reference:'csc',showIcon:false,showPlaceholder:false,showFocusOutline:false}));},renderZIPFormField:function(){return (m.createElement(s,{onChange:this.handleFormValueChange,reference:'zip',showIcon:false,showPlaceholder:false,showFocusOutline:false}));},getMessage:function(){var ca=this.props.creditCard.getName(),da=this.props.creditCard.getCreditCardNumber();if(this.props.isSending){if(this.shouldShowZIPInput()){return (x._("Enter the security code on the back of your {credit card issuer} ending in {credit card number last 4 digits} and Billing Postcode to send this payment.",[x.param("credit card issuer",ca),x.param("credit card number last 4 digits",da)]));}else return (x._("Enter the security code on the back of your {credit card issuer} ending in {credit card number last 4 digits} to send this payment.",[x.param("credit card issuer",ca),x.param("credit card number last 4 digits",da)]));}else if(this.shouldShowZIPInput()){return (x._("Enter the security code on the back of your {credit card issuer} ending in {credit card number last 4 digits} and Billing Postcode to accept this payment.",[x.param("credit card issuer",ca),x.param("credit card number last 4 digits",da)]));}else return (x._("Enter the security code on the back of your {credit card issuer} ending in {credit card number last 4 digits} to accept this payment.",[x.param("credit card issuer",ca),x.param("credit card number last 4 digits",da)]));},getInputs:function(){var ca,da=m.createElement("div",{className:"_3yfa"},m.createElement("div",{className:"_197h"},x._("Security Code")),m.createElement("div",{className:"_197i"},this.renderCVCFormField()));if(this.shouldShowZIPInput())ca=m.createElement("div",{className:"_3yfb"},m.createElement("div",{className:"_197h"},x._("Billing Postcode")),m.createElement("div",{className:"_197i"},this.renderZIPFormField()));return (m.createElement("div",null,da,ca));},render:function(){return (m.createElement(o,{layerHideOnBlur:false,ref:"dialog",shown:true,width:300},m.createElement(u,{showCloseButton:false},x._("Enter Security Code"),m.createElement(t,{onClick:this.handleCloseButtonClick})),m.createElement(p,null,m.createElement("div",{className:"_197f"},this.getMessage()),this.renderError(),m.createElement("div",{className:"_197g"},this.getInputs())),m.createElement(q,null,m.createElement(n,{label:x._("Confirm"),onClick:this.handleConfirmClick,disabled:!this.state.isValid,use:"confirm"})),m.createElement(l,{visible:this.state.loading})));}});e.exports=ba;},null);
__d("P2PAcceptMoneyDialog.react",["CreditCardFormParam","Image.react","Link.react","P2PCreditCardForm.react","P2PAPI","P2PAPIUtils","P2PChooseCreditCardForm.react","P2PCreditCard","P2PErrorDialog.react","P2PErrorNotice.react","P2PLinkConstants","P2PLoadingMask.react","P2PLogger","P2PPasswordProtectionNUXDialog.react","P2PPasswordProtectionStatusTypes","P2PPaymentLoggerEvent","P2PPaymentLoggerEventFlow","P2PTransferParam","P2PVerifyCreditCardDialog.react","React","XUIButton.react","XUIDialog.react","XUICloseButton.react","XUIDialogTitle.react","XUIDialogBody.react","XUIDialogFooter.react","XUIDialogOkayButton.react","XUIText.react","XUIGrayText.react","cx","emptyFunction","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma){b.__markCompiled&&b.__markCompiled();'use strict';var na=z,oa=na.PropTypes,pa='fbP2PAcceptMoneyDialog_learnMoreSentenceID',qa=z.createClass({displayName:"P2PAcceptMoneyDialog",propTypes:{asyncRequestState:oa.object,creditCards:oa.arrayOf(oa.instanceOf(n)).isRequired,onClose:oa.func,transfer:oa.object},getDefaultProps:function(){return {asyncRequestState:{},onClose:ka,creditCards:[]};},getInitialState:function(){return {addCreditCardRequestID:'',isValid:false,declineErrorObject:null,formData:{},loading:false,passwordNUXPending:false,passwordProtectionNUXDialogShown:false,presetRequestID:'',presetSaveErrorObject:null,saveErrors:null,selectedCard:this.props.creditCards[0],showConfirmation:false,showDeclineConfirmation:false,showChooseCreditCardForm:this.props.creditCards.length>0,verifyCreditCardDialogShown:false};},log:function(ra,sa){s.log(ra,Object.assign({www_event_flow:w.UI_FLOW_P2P_RECEIVE,object_id:this.props.transfer[x.TRANSFER_ID]},sa));},componentWillMount:function(){this.log(v.UI_ACTN_INITIATE_ADD_CARD);},componentWillReceiveProps:function(ra){var sa=ra.asyncRequestState,ta=sa?sa[this.state.addCreditCardRequestID]:null,ua=sa?sa[this.state.presetRequestID]:null;if(ta){this.setState({addCreditCardRequestID:''});if(ta.error){this.handleAcceptAddCardError(ta.error);}else this.handleAcceptAddCardSuccess(ta);}else if(ua){this.setState({presetRequestID:''});if(ua.error){this.handleUpdatePresetCreditCardError(ua.error);}else this.handleUpdatePresetCreditCardSuccess(ua);}},onBlur:function(){this.props.onClose();},handleAddCardBackButtonClick:function(){this.setState({isValid:false,formData:{},presetSaveErrorObject:null,saveErrors:null,showChooseCreditCardForm:true});},handleAcceptWithCardButtonClick:function(){this.log(v.UI_ACTN_ACCEPT_WITH_CARD);if(!this.state.selectedCard.getIsVerified()){this.setState({verifyCreditCardDialogShown:true});return;}this.acceptWithSelectedCard();},acceptWithSelectedCard:function(){this.setState({presetSaveErrorObject:null,loading:true});this.updatePresetCreditCard(this.state.selectedCard.getCredentialId());},onVerifyCreditCardSuccess:function(){this.setState({verifyCreditCardDialogShown:false},function(){this.acceptWithSelectedCard();}.bind(this));},onVerifyCreditCardCancel:function(){this.setState({verifyCreditCardDialogShown:false});},handleAddDebitCardOptionClicked:function(){this.setState({presetSaveErrorObject:null,showChooseCreditCardForm:false});},handleDeclineCardBackButtonClick:function(){this.setState({showDeclineConfirmation:false});},handleDeclineCardSubmitButtonClick:function(){var ra={};this.setState({loading:true,declineErrorObject:null});ra[x.TRANSFER_ID]=this.props.transfer[x.TRANSFER_ID];k.declineTransaction({formData:ra,success:this.handleDeclineSuccess,error:this.handleDeclineError});},handleDeclineSuccess:function(){this.props.onClose();},handleDeclineError:function(ra){this.setState({loading:false,declineErrorObject:ra});},handleNoDebitCardClick:function(){if(!this.state.loading)this.setState({showDeclineConfirmation:true});},handleAcceptAddCardClick:function(){var ra=l.genRequestID();this.setState({addCreditCardRequestID:ra,loading:true,presetSaveErrorObject:null,saveErrors:null});this.log(v.UI_ACTN_CONFIRM_CARD_DETAILS);k.addCreditCard(Object.assign({requestID:ra},this.state.formData));},handleAcceptAddCardSuccess:function(ra){this.updatePresetCreditCard(ra[g.CREDENTIAL_ID]);this.log(v.UI_ACTN_ADD_CARD_SUCCESS);},handleAcceptAddCardError:function(ra){this.setState({loading:false,saveErrors:ra});this.log(v.UI_ACTN_ADD_CARD_FAIL,{message:ra&&ra.general?ra.general.message:''});},updatePresetCreditCard:function(ra){var sa={},ta=l.genRequestID();sa[g.CREDENTIAL_ID]=ra;this.setState({presetRequestID:ta});k.updatePresetCreditCard(Object.assign({},sa,{requestID:ta}));},handleUpdatePresetCreditCardSuccess:function(ra){this.setState({loading:false,showConfirmation:true,passwordNUXPending:ra.passwordProtection===u.NOT_SET});},handleUpdatePresetCreditCardError:function(ra){this.setState({loading:false,presetSaveErrorObject:ra});},handleValidation:function(ra,sa){this.setState({isValid:ra,formData:sa});},handleConfirmationOKClick:function(){if(this.state.passwordNUXPending){this.setState({passwordNUXPending:false,passwordProtectionNUXDialogShown:true});}else this.props.onClose();},handleCloseButtonClick:function(){this.props.onClose();this.log(v.UI_ACTN_CANCEL_ADD_CARD);},handleErrorBackClick:function(){this.setState({declineErrorObject:null});},handleErrorOKClick:function(){this.setState({declineErrorObject:null});this.props.onClose();},handlePasswordProtectionNUXComplete:function(){this.setState({passwordProtectionNUXDialogShown:false});this.props.onClose();},handleCreditCardSelected:function(ra){this.setState({selectedCard:ra});},renderChooseCreditCardForm:function(){return (z.createElement("div",{className:"_2_t"},z.createElement(da,{showCloseButton:false},la._("Add a Debit Card"),z.createElement(ca,{onClick:this.handleCloseButtonClick})),z.createElement(ea,{className:"_2_u"},z.createElement(ha,{display:"block",size:"small",className:"_2_w"},la._("Link a debit card to send and receive money.")),this.renderPresetError(),z.createElement(m,{className:"_2pij",creditCards:this.props.creditCards,onAddDebitCardOptionSelected:this.handleAddDebitCardOptionClicked,onChange:this.handleCreditCardSelected,ref:"choose_credit_card_form",selectedCard:this.state.selectedCard,showAddDebitCardOption:true})),z.createElement(fa,null,z.createElement(aa,{disabled:this.state.loading,label:la._("Accept"),onClick:this.handleAcceptWithCardButtonClick,size:"medium",use:"confirm"}))));},renderPresetError:function(){var ra;if(this.state.presetSaveErrorObject)ra=z.createElement(p,{error:this.state.presetSaveErrorObject});return ra;},renderAcceptMoney:function(){var ra=this.props.transfer,sa,ta=z.createElement(aa,{disabled:this.state.loading||!this.state.isValid,label:la._("Accept"),onClick:this.handleAcceptAddCardClick,size:"medium",use:"confirm"});if(this.props.creditCards.length===0){sa=z.createElement(fa,{leftContent:z.createElement(i,{className:"_2__",href:"#",onClick:this.handleNoDebitCardClick},la._("Decline Payment"))},ta);}else sa=z.createElement(fa,null,z.createElement(aa,{disabled:this.state.loading,label:la._("Back"),onClick:this.handleAddCardBackButtonClick,size:"medium",use:"default"}),ta);return (z.createElement("div",{className:"_1p_r"},z.createElement(da,{showCloseButton:false},la._("Add a Debit Card"),z.createElement(ca,{onClick:this.handleCloseButtonClick})),z.createElement(ea,null,z.createElement("div",{className:"_1p_v _3-97"},z.createElement(ha,{display:"block",size:"small",className:"_3-94"},la._("{sender_name} sent you {currency}{amount}. Add a debit card to accept it.",[la.param("sender_name",ra.sender.name),la.param("currency",ra.currency),la.param("amount",ra.amount)]))),z.createElement("div",{className:"_1p_w"},this.renderPresetError(),z.createElement(j,{onValidation:this.handleValidation,saveErrors:this.state.saveErrors})),z.createElement(ia,{display:"block",id:pa,shade:"medium",size:"small"},la._("Your payment info has been stored securely. {Link to P2P learn more page.}",[la.param("Link to P2P learn more page.",z.createElement(i,{"aria-describedby":pa,href:q.addDebitCardHelpURI,target:"_blank"},la._("Learn more.")))]))),sa));},renderDeclineConfirmation:function(){var ra=this.props.transfer;return (z.createElement("div",{className:"_301"},z.createElement(da,{showCloseButton:false},la._("Decline payment?"),z.createElement(ca,{onClick:this.handleCloseButtonClick})),z.createElement(ea,null,z.createElement(ia,{display:"block",shade:"medium",size:"small"},la._("Declining this payment will send the money back to {friendName}.",[la.param("friendName",ra.sender.name)]))),z.createElement(fa,null,z.createElement(aa,{disabled:this.state.loading,label:la._("Back"),onClick:this.handleDeclineCardBackButtonClick,size:"medium",use:"default"}),z.createElement(aa,{disabled:this.state.loading,label:la._("Decline"),onClick:this.handleDeclineCardSubmitButtonClick,size:"medium",use:"default"}))));},renderConfirmation:function(){return (z.createElement("div",{className:"_1p_-"},z.createElement(da,{showCloseButton:false},la._("Payment Received")),z.createElement(ea,null,z.createElement("div",{className:"_1q00"},z.createElement(h,{height:50,width:50,src:ma("/images/p2p/check_mark-sm.png")})),z.createElement(ia,{display:"block",size:"small",shade:"dark"},la._("Money you receive from now on will automatically go on this card. You can update your card in {Link with text that goes to settings page}.",[la.param("Link with text that goes to settings page",z.createElement(i,{target:"_blank",href:q.settingsWWWURI},la._("Payments Settings")))]))),z.createElement(fa,null,z.createElement(ga,{action:"cancel",use:"default",onClick:this.handleConfirmationOKClick}))));},componentDidUpdate:function(){setTimeout(function(){try{if(this.isMounted())this.refs.dialog&&this.refs.dialog.layer.updatePosition();}catch(ra){}}.bind(this));},render:function(){var ra;if(this.state.verifyCreditCardDialogShown){return (z.createElement(y,{creditCard:this.state.selectedCard,asyncRequestState:this.props.asyncRequestState,isSending:false,onCancel:this.onVerifyCreditCardCancel,onSuccess:this.onVerifyCreditCardSuccess}));}else if(this.state.declineErrorObject){return (z.createElement(o,{ref:"decline_error",allowBack:true,onBackClick:this.handleErrorBackClick,onOKClick:this.handleErrorOKClick,error:this.state.declineErrorObject,title:la._("Problem with Declining")}));}else if(this.state.passwordProtectionNUXDialogShown)return (z.createElement(t,{onComplete:this.handlePasswordProtectionNUXComplete}));if(this.state.showConfirmation){ra=this.renderConfirmation();}else if(this.state.showDeclineConfirmation){ra=this.renderDeclineConfirmation();}else if(this.state.showChooseCreditCardForm){ra=this.renderChooseCreditCardForm();}else ra=this.renderAcceptMoney();return (z.createElement(ba,{className:"_309",layerHideOnBlur:false,ref:"dialog",shown:true,width:300},ra,z.createElement(r,{ref:"send_money_dialog_loader",visible:this.state.loading})));}});e.exports=qa;},null);
__d("P2PCreditCardStore",["P2PActionConstants","CreditCardFormParam","EventEmitter","ImmutableObject","P2PAPI","P2PCreditCard","P2PDispatcher"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();'use strict';var n,o,p,q,r;function s(x,y){if(x)r[x]=new j(y);}function t(x,y){if(x)r[x]={error:y};}for(var u in i)if(i.hasOwnProperty(u))w[u]=i[u];var v=i===null?null:i.prototype;w.prototype=Object.create(v);w.prototype.constructor=w;w.__superConstructor__=i;function w(){i.call(this);p=false;q=false;n=[];r={};o=m.register(this.onEventDispatched.bind(this));}w.prototype.onEventDispatched=function(x){var y=x.data,z=x.type;switch(z){case g.CREDIT_CARDS_UPDATED:this.handleCreditCardsUpdated(y);this.emit('change');break;case g.CREDIT_CARD_ADDED:this.handleCreditCardAdded(y);this.emit('change');break;case g.CREDIT_CARD_ADDED_ERROR:this.handleCreditCardAddedError(y);this.emit('change');break;case g.CREDIT_CARD_DELETED:this.handleCreditCardDeleted(y);this.emit('change');break;case g.CREDIT_CARD_DELETED_ERROR:this.handleCreditCardDeletedError(y);this.emit('change');break;case g.CREDIT_CARD_UPDATED:this.handleCreditCardUpdated(y);this.emit('change');break;case g.CREDIT_CARD_UPDATED_ERROR:this.handleCreditCardUpdatedError(y);this.emit('change');break;case g.PRESET_CREDIT_CARD_UPDATED:this.handlePresetCreditCardUpdated(y);this.emit('change');break;case g.PRESET_CREDIT_CARD_UPDATED_ERROR:this.handlePresetCreditCardUpdatedError(y);this.emit('change');break;case g.CREDIT_CARD_VERIFIED:this.handleCreditCardVerified(y);this.emit('change');break;case g.CREDIT_CARD_VERIFIED_ERROR:this.handleCreditCardVerifiedError(y);this.emit('change');break;}};w.prototype.getAsyncRequestState=function(){return r;};w.prototype.isCreditCardsFetchComplete=function(){return p;};w.prototype.handleCreditCardsUpdated=function(x){p=true;n=x.map(function(y){return new l(y);});};w.prototype.handleCreditCardAdded=function(x){var y=false;s(x.requestID,x);n.forEach(function(z){if(z.getCredentialId()===x[h.CREDENTIAL_ID])y=true;});if(y)return;n.push(new l(x));};w.prototype.handleCreditCardAddedError=function(x){t(x.requestID,x.errors);};w.prototype.handleCreditCardDeleted=function(x){var y=x[h.CARD_FBID];s(x.requestID,x);n=n.filter(function(z){return z.getCredentialId()!==y;});};w.prototype.handleCreditCardDeletedError=function(x){t(x.requestID,x.error);};w.prototype.handleCreditCardUpdated=function(x){s(x.requestID,x);n.forEach(function(y,z){if(y.getCredentialId()===x[h.CREDENTIAL_ID]){y.setExp(x[h.CARD_EXPIRATION]);y.setZipCode(x[h.ZIP]);}});};w.prototype.handleCreditCardUpdatedError=function(x){t(x.requestID,x.errors);};w.prototype.handlePresetCreditCardUpdated=function(x){var y=x[h.CARD_FBID];s(x.requestID,x);var z=n.filter(function(ba){return ba.getIsPreset();})[0];if(z)z.setIsPreset(false);var aa=n.filter(function(ba){return ba.getCredentialId()===y;})[0];if(aa)aa.setIsPreset(true);};w.prototype.handlePresetCreditCardUpdatedError=function(x){t(x.requestID,x.error);};w.prototype.handleCreditCardVerified=function(x){s(x.requestID,x);n.forEach(function(y,z){if(y.getCredentialId()===x[h.CREDENTIAL_ID])y.setIsVerified(true);});};w.prototype.handleCreditCardVerifiedError=function(x){t(x.requestID,x.error);};w.prototype.getAll=function(){if(!q){q=true;k.getAllCreditCards();}return n;};w.prototype.getAllSettingsEligible=function(){var x=this.getAll();return x.filter(function(y){return y.getIsVerified()||y.getIsMobileVerified();});};w.prototype.getPresetCard=function(){var x=this.getAll();return x.filter(function(y){return y.getIsPreset();})[0];};e.exports=new w();},null);
__d("P2PNUXRendererUtils",["MercuryConstants","CurrentUser","ImmutableObject","MercuryAttachmentType","P2PTransferParam","P2PTransferStatus","StoryAttachmentStyle"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();'use strict';var n=g.MercurySupportedShareType,o={getTransferFromMessage:function(p){var q,r;if(!p||!p.attachments||!p.attachments.length)return;r=p.attachments[0];if(this.isShareAttachment(r)){q=r.share.target;}else if(r.share_data_type===n.FB_ORION)q=r.metadata;if(q)q=new i(q);return q;},isShareAttachment:function(p){return !!(typeof p!=='string'&&p.attach_type==j.SHARE&&p.share&&p.share.style_list&&p.share.style_list.indexOf(m.ORION)>=0);},isValidNUXMessage:function(p){var q=this.getTransferFromMessage(p);return !!(q&&q&&q.receiver&&q.receiver.id===h.getID()&&(q[k.STATUS]===l.PENDING_RECIPIENT_NUX||q[k.STATUS]===l.PENDING_RECIPIENT_VERIFICATION||q[k.STATUS]===l.PENDING_PUSH_FAIL));}};e.exports=o;},null);
__d("P2PTransferStore",["Arbiter","P2PActionConstants","ChannelConstants","CreditCardFormParam","CurrentUser","EventEmitter","ImmutableObject","P2PActions","P2PAPI","P2PChannelType","P2PCreditCard","P2PDispatcher","P2PNUXRendererUtils","P2PTransferParam","P2PTransferStatus","MercuryThreadInformer"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){b.__markCompiled&&b.__markCompiled();'use strict';var v=b('MercuryThreadInformer').get(),w,x,y,z,aa,ba,ca,da,ea,fa=null;function ga(la,ma){if(la)ea[la]=new m(ma);}function ha(la,ma){if(la)ea[la]={error:ma};}for(var ia in l)if(l.hasOwnProperty(ia))ka[ia]=l[ia];var ja=l===null?null:l.prototype;ka.prototype=Object.create(ja);ka.prototype.constructor=ka;ka.__superConstructor__=l;function ka(){l.call(this);w=false;y=[];ea={};aa=g.subscribe(i.getArbiterType(p.TRANSFER_STATUS_CHANGED),this.handleChannelTransferStatusChanged.bind(this));ba=v.subscribe('messages-received',this.handleMessageReceived.bind(this));ca=v.subscribe('messages-updated',this.handleMessageUpdated.bind(this));z=r.register(this.onEventDispatched.bind(this));}ka.prototype.onEventDispatched=function(la){var ma=la.data,na=la.type;switch(na){case h.TRANSFERS_UPDATED:this.handleTransfersUpdated(ma);this.emit('change');break;case h.TRANSFERS_UPDATED_ERROR:this.handleTransfersUpdatedError(ma);this.emit('change');break;case h.TRANSFER_ADDED:this.handleTransferAdded(ma);this.emit('change');break;case h.TRANSFER_UPDATED:this.handleTransferUpdated(ma);this.emit('change');break;case h.TRANSFER_ACCEPTED:this.handleTransferAccepted();this.emit('change');break;case h.TRANSFER_DECLINED:this.handleTransferDeclined(ma);this.emit('change');break;}};ka.prototype.getAsyncRequestState=function(){return ea;};ka.prototype.handleTransfersUpdated=function(la){da=null;y=la.map(function(ma){var na={};if(ma.creditCard){na[j.CREDENTIAL_ID]=ma.creditCard[j.CREDENTIAL_ID];na[j.CARD_NUMBER]=ma.creditCard[j.CARD_NUMBER];na[j.CARD_TYPE]=ma.creditCard[j.CARD_TYPE];ma.creditCard=new q(na);}return new m(ma);});};ka.prototype.handleTransfersUpdatedError=function(la){da=la.error;ha(la.requestID,la.error);};ka.prototype.handleTransferAdded=function(la){var ma=null;ga(la.requestID,la);ma=y.filter(function(na){return (na[t.TRANSFER_ID]===la[t.TRANSFER_ID]);})[0];if(ma)return;y.push(new m(la));y=y.sort(function(na,oa){return oa.creationTime-na.creationTime;});};ka.prototype.handleTransferAddedError=function(la){ha(la.requestID,la.errors);};ka.prototype.handleChannelTransferStatusChanged=function(la,ma){ma=ma.obj;n.transferUpdated(ma);};ka.prototype.getPendingMessageAttachment=function(){return fa;};ka.prototype.handleMessageReceived=function(la,ma){for(var na in ma)if(ma.hasOwnProperty(na)){var oa=ma[na];for(var pa=0;pa<oa.length;pa++)if(oa[pa].attachments&&oa[pa].attachments.length){fa=oa[pa];return;}}};ka.prototype.handleMessageUpdated=function(la,ma){if(!fa)return;for(var na in ma)if(ma.hasOwnProperty(na)){var oa=ma[na];for(var pa in oa)if(oa.hasOwnProperty(pa)&&fa.message_id===pa){var qa=s.getTransferFromMessage(fa);if(qa){n.transferAdded(qa);fa=null;return;}}}};ka.prototype.handleTransferUpdated=function(la){for(var ma=0,na=y.length;ma<na;ma++)if(y[ma][t.TRANSFER_ID]===la[t.TRANSFER_ID])y[ma]=m.set(y[ma],la);};ka.prototype.handleTransferAccepted=function(){var la;for(var ma=0,na=y.length;ma<na;ma++)if(y[ma][t.STATUS]===u.PENDING_RECIPIENT_NUX){la={};la[t.STATUS]=u.COMPLETED;y[ma]=m.set(y[ma],la);}};ka.prototype.handleTransferDeclined=function(la){var ma;for(var na=0,oa=y.length;na<oa;na++)if(y[na][t.TRANSFER_ID]===la[t.TRANSFER_ID]&&y[na][t.STATUS]===u.PENDING_RECIPIENT_NUX){ma={};ma[t.STATUS]=u.CANCELED_DECLINED;y[na]=m.set(y[na],ma);break;}};ka.prototype.handleTransferUpdatedError=function(la){ha(la.requestID,la.errors);};ka.prototype.getTransferByID=function(la){return y.filter(function(ma){return la===ma[t.TRANSFER_ID];})[0];};ka.prototype.getAll=function(la){if(!w){w=true;o.getTransactions(la);}return y;};ka.prototype.getNUXTransfer=function(){var la=y.filter(function(na){var oa=na[t.STATUS];return ((oa===u.PENDING_RECIPIENT_NUX||oa===u.PENDING_RECIPIENT_VERIFICATION||oa===u.PENDING_PUSH_FAIL)&&na.sender.id!==k.getID());})[0];if(!la&&!x&&!w){x=true;var ma=(new Date());o.getTransactions({since:Math.round((ma.setDate(ma.getDate()-15))/1000)});}return la;};ka.prototype.hasTransfers=function(){return y.length>0;};ka.prototype.hasReceivedFromSender=function(la){for(var ma=0,na=y.length;ma<na;ma++)if(y[ma].sender.id===la)return true;return false;};ka.prototype.getTransferFetchError=function(){return da;};e.exports=new ka();},null);
__d("P2PVerificationFlowHelper",["AsyncDialog","AsyncRequest","P2PAPI","P2PTransferParam","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=null,m=null,n=null,o={startVerificationFlow:function(p,q,r){l=p;m=q;n=r||k;g.send(new h('/p2p/verify/dialog/?id='+p));},setupFlowExitHandler:function(p,q,r,s){var t=function(w){n(w);l=null;m=null;n=null;p.destroy();q.destroy();};if(r){p.subscribe('hide',function(){t(s);});}else{var u=false,v=false;p.subscribe('confirm',function(){u=true;});p.subscribe('hide',function(){if(u){p.destroy();q.destroy();}else if(m){q.show();}else t(false);});q.subscribe('confirm',function(){v=true;var w={};w[j.TRANSFER_ID]=l;i.cancelTransaction({formData:w});t(false);});q.subscribe('hide',function(){if(!v)p.show();});}}};e.exports=o;},null);
__d("P2PNUXRenderer.react",["Image.react","Layout.react","Link.react","P2PAcceptMoneyDialog.react","P2PActions","P2PCreditCardStore","P2PLinkConstants","P2PQEValues","P2PNUXRendererUtils","P2PTransferStatus","P2PTransferParam","P2PTransferStore","P2PVerificationFlowHelper","React","ReactLayeredComponentMixin","XUIButton.react","XUIGrayText.react","XUINotice.react","cx","emptyFunction","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba){b.__markCompiled&&b.__markCompiled();'use strict';var ca=h.FillColumn,da=h.Column,ea=t,fa=ea.PropTypes,ga=t.createClass({displayName:"P2PNUXRenderer",mixins:[u],propTypes:{message:fa.object,emptyFunction:fa.func,onImageLoad:fa.func,type:fa.oneOf(['chat','jewel','messages','settingsNUX','settingsReceiverRisk','settingsPushFail']).isRequired},getDefaultProps:function(){return {message:null,onImageLoad:z,type:''};},getInitialState:function(){var ha={creditCardAsyncRequestState:{},creditCards:[],acceptMoneyDialogShown:false,enabled:false};if(this.props.message){var ia=o.getTransferFromMessage(this.props.message),ja=r.getTransferByID(ia[q.TRANSFER_ID]);if(!ja){k.transferAdded(ia);ha.transfer=ia;}else ha.transfer=ja;}else ha.transfer=r.getNUXTransfer();if(ha.transfer)ha.creditCardAsyncRequestState=l.getAsyncRequestState(),ha.creditCards=l.getAll();return ha;},onCreditCardStoreChange:function(){this.setState({creditCardAsyncRequestState:l.getAsyncRequestState(),creditCards:l.getAll()});},onTransferStoreChange:function(){var ha=this.state.transfer?r.getTransferByID(this.state.transfer[q.TRANSFER_ID]):null,ia={};ia.transfer=this.props.message&&ha?ha:r.getNUXTransfer();if(ia.transfer)ia.creditCardAsyncRequestState=l.getAsyncRequestState(),ia.creditCards=l.getAll();this.setState(ia,function(){this.props.onImageLoad(t.findDOMNode(this));}.bind(this));},componentDidMount:function(){this.creditCardStoreSub=l.addListener('change',this.onCreditCardStoreChange);this.transferStoreSub=r.addListener('change',this.onTransferStoreChange);},componentWillUnmount:function(){this.unsubscribeAll();},statics:{isValidNUXMessage:function(ha){return o.isValidNUXMessage(ha);}},unsubscribeAll:function(){this.unsubscribeCreditCardStoreEvent();this.unsubscribeTransferStoreEvent();},unsubscribeCreditCardStoreEvent:function(){if(this.creditCardStoreSub){this.creditCardStoreSub.remove();this.creditCardStoreSub=null;}},unsubscribeTransferStoreEvent:function(){if(this.transferStoreSub){this.transferStoreSub.remove();this.transferStoreSub=null;}},handleAcceptMoneyDialogClose:function(){this.setState({acceptMoneyDialogShown:false});},handleGetStartedClick:function(){this.setState({acceptMoneyDialogShown:true});},handleGoToConfirmClicked:function(){s.startVerificationFlow(this.state.transfer[q.TRANSFER_ID],false);},render:function(){var ha=!!(this.state.transfer&&l.isCreditCardsFetchComplete()),ia;if(this.state.transfer)ia=this.state.transfer[q.STATUS];if(this.props.type==='chat'||this.props.type==='messages'){return (t.createElement("div",{className:"_3kw-"},ha?this.renderMessage():null));}else if(this.props.type==='jewel'){return (t.createElement("div",{className:"_3kw_"},ha?this.renderJewel():null));}else if(this.props.type==='settingsReceiverRisk'){return (t.createElement("div",{className:"_cu5"},ha&&ia===p.PENDING_RECIPIENT_VERIFICATION?this.renderSettingsReceiverRisk():null));}else if(this.props.type==='settingsNUX'){return (t.createElement("div",{className:"_4z2f"},ha&&ia===p.PENDING_RECIPIENT_NUX?this.renderSettingsNUX():null));}else if(this.props.type==='settingsPushFail')return (t.createElement("div",{className:"_4b82"},ha&&ia===p.PENDING_PUSH_FAIL?this.renderSettingsPushFail():null));},renderMessage:function(){var ha;ha=this.state.transfer[q.STATUS];if(ha===p.PENDING_RECIPIENT_VERIFICATION){return this.renderMessageRisk();}else if(ha===p.PENDING_RECIPIENT_NUX){return this.renderMessageNUX();}else if(ha===p.PENDING_PUSH_FAIL)return this.renderMessagePushFail();},renderJewel:function(){var ha;ha=this.state.transfer[q.STATUS];if(ha===p.PENDING_RECIPIENT_VERIFICATION){return this.renderJewelRisk();}else if(ha===p.PENDING_RECIPIENT_NUX){return this.renderJewelNUX();}else if(ha===p.PENDING_PUSH_FAIL)return this.renderJewelPushFail();},renderMessageRisk:function(){return (t.createElement("div",{className:(("_3kx0")+(this.props.type==='chat'?' '+"_3-8r":''))},t.createElement(h,{className:"_3kxb"},t.createElement(da,{className:"_3kxc"},t.createElement(g,{height:32,src:ba('/images/p2p/receiver-risk-inthread.png'),width:32})),t.createElement(ca,{className:"_3kxd"},t.createElement("div",{className:"_3kxe"},aa._("Please Confirm your Info")),t.createElement("div",{className:"_3kxf"},aa._("To accept the money {sender_name} sent you, please confirm your information.",[aa.param("sender_name",this.state.transfer.sender.name)])),t.createElement("div",null,t.createElement(v,{use:"default",size:"medium",label:aa._("Confirm Info"),onClick:this.handleGoToConfirmClicked}))))));},renderMessagePushFail:function(){return (t.createElement("div",{className:(("_3kx0")+(this.props.type==='chat'?' '+"_3-8r":''))},t.createElement(h,{className:"_3kxb"},t.createElement(da,{className:"_3kxc"},t.createElement(g,{height:32,src:ba('/images/p2p/receiver-risk-inthread.png'),width:32})),t.createElement(ca,{className:"_3kxd"},t.createElement("div",{className:"_3kxe"},aa._("Update Your Card")),t.createElement("div",{className:"_3kxf"},aa._("It looks like your card has expired or is invalid. Please update it to get {currency}{amount} from {sender_name}.",[aa.param("currency",this.state.transfer.currency),aa.param("amount",this.state.transfer.amount),aa.param("sender_name",this.state.transfer.sender.name)])),t.createElement("div",null,t.createElement(v,{use:"default",size:"medium",label:aa._("Update Card"),href:m.settingsWWWURI,target:"_blank"}))))));},renderMessageNUX:function(){var ha=n.ReceiverInThreadNUXBodyText||aa._("Just add a debit card to accept it.");return (t.createElement("div",{className:(("_3kx0")+(this.props.type==='chat'?' '+"_3-8r":''))},t.createElement(h,{className:"_3kxb"},t.createElement(da,{className:"_3kxc"},t.createElement(g,{height:32,src:ba('/images/p2p/receiver-nux-inthread.png'),width:32})),t.createElement(ca,{className:"_3kxd"},t.createElement("div",{className:"_3kxe"},aa._("{sender_name} sent you money!",[aa.param("sender_name",this.state.transfer.sender.name)])),t.createElement("div",{className:"_3kxf"},ha),t.createElement("div",null,t.createElement(v,{use:"default",size:"medium",label:aa._("Add Card"),onClick:this.handleGetStartedClick}))))));},renderJewelRisk:function(){return (t.createElement("div",{className:"_3kxg",onClick:this.handleGoToConfirmClicked},t.createElement(h,null,t.createElement(da,{className:"_3kxh"},t.createElement(g,{className:"_547r",height:28,src:ba("/images/p2p/receiver-risk-notification.png"),width:28})),t.createElement(ca,{className:"_2pic"},t.createElement(w,{display:"block",shade:"medium",weight:"bold"},aa._("Please Confirm Your Info")),t.createElement(w,{display:"block",shade:"medium"},aa._("To accept the money {sender_name} sent you, please confirm your information.",[aa.param("sender_name",this.state.transfer.sender.name)])),t.createElement(w,{className:"_3kxj",display:"block"},aa._("Confirm Info"))))));},renderJewelPushFail:function(){return (t.createElement("div",{className:"_3kxg"},t.createElement(h,null,t.createElement(da,{className:"_3kxh"},t.createElement(g,{className:"_547r",height:28,src:ba("/images/p2p/receiver-risk-notification.png"),width:28})),t.createElement(ca,{className:"_2pic"},t.createElement(w,{display:"block",shade:"medium",weight:"bold"},aa._("Update Your Card")),t.createElement(w,{display:"block",shade:"medium"},aa._("It looks like your card has expired or is invalid. Please update it to get {currency}{amount} from {sender_name}.",[aa.param("currency",this.state.transfer.currency),aa.param("amount",this.state.transfer.amount),aa.param("sender_name",this.state.transfer.sender.name)])),t.createElement(i,{href:m.settingsWWWURI,target:"_blank"},t.createElement(w,{className:"_3kxj",display:"block"},aa._("Update Card")))))));},renderJewelNUX:function(){return (t.createElement("div",{className:"_3kxg",onClick:this.handleGetStartedClick},t.createElement(h,null,t.createElement(da,{className:"_3kxh"},t.createElement(g,{className:"_547r",height:28,src:ba("/images/p2p/receiver-nux-notification.png"),width:28})),t.createElement(ca,{className:"_2pic"},t.createElement(w,{display:"block",shade:"medium",weight:"bold"},aa._("Accept {currency}{amount} from {sender_name}",[aa.param("currency",this.state.transfer.currency),aa.param("amount",this.state.transfer.amount),aa.param("sender_name",this.state.transfer.sender.name)])),t.createElement(w,{display:"block",shade:"medium"},this.getTimeBasedNUXMessageBody()),t.createElement(w,{className:"_3kxj",display:"block"},aa._("Add Card"))))));},renderSettingsReceiverRisk:function(){return (t.createElement("div",{className:"_cu8"},t.createElement(x,{use:"warn"},t.createElement(w,{className:"_3-95",display:"block",shade:"medium"},aa._("To accept the money {sender_name} sent you, please confirm your information.",[aa.param("sender_name",this.state.transfer.sender.name)])),t.createElement(v,{label:aa._("Confirm Info"),onClick:this.handleGoToConfirmClicked}))));},renderSettingsPushFail:function(){return (t.createElement("div",{className:"_cu8"},t.createElement(x,{use:"warn"},t.createElement(w,{className:"_3-95",display:"block",shade:"medium"},aa._("It looks like your card has expired or is invalid. Please update it to get {currency}{amount} from {sender_name}.",[aa.param("currency",this.state.transfer.currency),aa.param("amount",this.state.transfer.amount),aa.param("sender_name",this.state.transfer.sender.name)])))));},renderSettingsNUX:function(){return (t.createElement("div",{className:"_4z2g"},t.createElement("div",{className:"_4z2h"},t.createElement(w,{className:"_3-95 _2pi7",display:"block",shade:"light"},t.createElement("div",{className:"_3-94"},aa._("{sender_name} sent you {currency}{amount}",[aa.param("sender_name",this.state.transfer.sender.name),aa.param("currency",this.state.transfer.currency),aa.param("amount",this.state.transfer.amount)])),t.createElement("div",{className:"_3-95"},this.getTimeBasedNUXMessageBody())),t.createElement(v,{label:aa._("Add Card"),onClick:this.handleGetStartedClick,use:"confirm"}))));},getTimeBasedNUXMessageBody:function(){var ha=this.state.transfer.creationTime*1000,ia=(1000*60*60*24),ja=Date.now(),ka=(ja-ha)/ia,la=Math.max(14-Math.floor(ka),1);if(ka<=5){if(this.props.type==='settingsNUX'){return (aa._("Add a debit card to accept it."));}else return (aa._("Add a debit card and it'll go straight to your bank."));}else if(ka<=11){return (aa._("This money will be sent back in {days left} days. Add a debit card to accept it.",[aa.param("days left",la)]));}else return (aa._({"day":"You have {days left} day to add a debit card before the money is sent back to {sender_name}.","days":"You have {days left} days to add a debit card before the money is sent back to {sender_name}."},[aa.param("days left",la),aa['enum'](la===1?'day':'days',{day:"day",days:"days"}),aa.param("sender_name",this.state.transfer.sender.name)]));},renderLayers:function(){var ha={};if(this.state.acceptMoneyDialogShown)ha.acceptDialog=t.createElement(j,{asyncRequestState:this.state.creditCardAsyncRequestState,creditCards:this.state.creditCards,onClose:this.handleAcceptMoneyDialogClose,transfer:this.state.transfer});return ha;}});e.exports=ga;},null);
__d("PluginLoginButton",["Arbiter","DOMEvent","DOMEventListener","DOMQuery","PlatformDialogClient","Plugin","PluginReturn","PluginResize","CSS","PlatformWidgetEndpoint"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q={redirect:function(r){window.parent.location.replace(r);},submit:function(r){r.submit();},registration:function(r,s){i.add(r,'click',q.redirect.bind(null,s));},connect:function(r){i.add(r,'click',q.submit.bind(null,j.find(r,'^form')));},logout:function(r){i.add(r,'click',q.submit.bind(null,j.find(r,'^form')));},oauth:function(r,s,t,u,v,w,x,y){g.subscribe(l.RELOAD,function(event,z){var aa=p.plugins('login_button');m.reload(aa+(z.crossFrame?'':'?ret=perms'));});this.action(r,function(event){new h(event).kill();var z={scope:t,response_type:'none',redirect_uri:u,seen_revocable_perms_nux:v,ref:w,auth_type:x,default_audience:y};k.popup('oauth',s,z);});},nux:function(r,s,t,u){t.style.width=Math.max(r.offsetWidth,200)+'px';function v(){return Math.max(u?u:r.offsetWidth,o.shown(t)?t.offsetWidth:0);}function w(){return Math.max(r.offsetHeight+(o.shown(t)?t.offsetHeight:0),s.offsetHeight);}(new n(v,w,'resize.iframe',true)).resize().auto();},registerNuxClose:function(r,s){i.add(r,'click',o.hide.bind(null,s));},action:function(r,s){i.add(r,'click',s);i.add(r,'keydown',function(t){t=new h(t);var u=t.event.which||t.event.keyCode;if(u===32||u===13)s(t);});}};e.exports=q;},null);
__d("StickyArea",["CSS","DOM","DOMQuery","Event","Run","Style","ViewportBounds","cx","getNormalizedClientRect","getOverlayZIndex","removeFromArray","throttle"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();var s=[],t=null,u=null,v=null,w=r.acrossTransitions(x,1000);function x(){s.sort(function(da,ea){var fa=da.getNode(),ga=ea.getNode();if(fa.compareDocumentPosition){return 3-(fa.compareDocumentPosition(ga)&6);}else return fa.sourceIndex-ga.sourceIndex;});}function y(da,ea,fa){var ga=da.getPlaceholder(),ha=da.getNode(),ia=l.get(ha,'float'),ja=da.getData();if(ja.placeholderWidth!==ea||ja.placeholderHeight!==fa||ja.placeholderFloat!==ia){l.apply(ga,{'float':ia,height:fa+'px',width:ea+'px'});ja.placeholderHeight=fa;ja.placeholderWidth=ea;}if(ha.nextSibling!==ga)h.insertAfter(ha,ga);}function z(da,ea){var fa=da.getData();if(fa.fixed!==ea){l.apply(da.getNode(),fa.styles);g.conditionShow(da.getPlaceholder(),ea);fa.fixed=ea;}}function aa(da,ea){if(!da){return 0;}else if(ea.right<=da.rect.left||ea.left>=da.rect.right){return aa(da.prev,ea);}else return da.bottom;}function ba(){var da=0,ea=s.length,fa=100;function ga(ha,ia){var ja=fa;while(da<ea){var ka=s[da],la=ka.getNode();if(ia&&!i.contains(ia,la))break;fa=Math.max(ja,ka.getZIndex());var ma=ka.getData(),na=la.parentNode,oa=ma.styles;for(var pa in oa)oa[pa]='';z(ka,false);var qa=la.offsetHeight,ra=la.offsetWidth,sa=o(la),ta=aa(ha,sa)+ka.getOffset();if(sa.top<=ta){oa.width=ra+'px';var ua=parseInt(l.get(na,'padding-bottom'),10),va=o(na);if(va.bottom-ua>ta+qa){var wa=parseInt(l.get(la,'margin-left'),10);oa.position='fixed';oa.bottom='auto';oa.top=ta+'px';oa.left=sa.left-wa+'px';}else{if(!ma.parent||na!==ma.parent){if(l.get(na,'position')==='static')l.set(na,'position','relative');ma.parent=na;}oa.position='absolute';oa.top='auto';oa.bottom=ua+'px';var xa=parseInt(l.get(na,'border-left-width'),10);oa.left=(sa.left-va.left-xa)+'px';}y(ka,ra,qa);z(ka,true);}da++;ga({bottom:ta+qa,prev:ha,rect:sa},na);l.set(la,'z-index',fa++);}}ga(null,null);}function ca(da,ea,fa){"use strict";this._node=da;this._data={fixed:false,placeholderFloat:null,placeholderHeight:null,placeholderWidth:null,styles:{}};this._offset=fa;g.addClass(da,"_k");if(!ea)k.onLeave(this.destroy.bind(this));if(!s.length){t=j.listen(window,'scroll',function(){w();ba();});u=j.listen(window,'resize',function(){w();ba();});v=m.subscribe('change',function(){w();ba();});}s.push(this);ca.reflow();}ca.prototype.destroy=function(){"use strict";q(s,this);if(!s.length){t.remove();t=null;u.remove();u=null;}if(this._placeholder)h.remove(this._placeholder);var da=0;for(var ea in this._data.styles){this._data.styles[ea]='';da++;}if(da)l.apply(this._node,this._data.styles);};ca.prototype.getData=function(){"use strict";return this._data;};ca.prototype.getNode=function(){"use strict";return this._node;};ca.prototype.getOffset=function(){"use strict";return this._offset||0;};ca.prototype.getPlaceholder=function(){"use strict";if(!this._placeholder)this._placeholder=h.create('div');return this._placeholder;};ca.prototype.getZIndex=function(){"use strict";if(!this._zIndex)this._zIndex=p(this._node);return this._zIndex;};ca.prototype.setOffset=function(da){"use strict";this._offset=da;};ca.reflow=r.acrossTransitions(function(){x();ba();},100);e.exports=ca;},null);
__d("SearchTypeaheadRenderer",["BadgeHelper","DOM","fbt","MusicButtonManager","TokenizeUtil","TypeaheadFacepile","URI","WWWBase"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o=' \u00B7 ';function p(q,r){var s=[],t=q.photos||q.photo;if(t){if(t instanceof Array){t=l.render(t);}else t=h.create('img',{alt:'',src:t});s.push(t);if(q.song){s.push(h.create('span',{className:'playButton'}));s.push(h.create('span',{className:'playLoader'}));}}var u;if(q.text){var v=q.alias,w=this.value,x=q.text;u=[x];if(v&&k.isQueryMatch(w,v)&&!k.isQueryMatch(w,x))u.push(h.create('span',{className:'alias'},[' \xB7 '+v]));if(q.is_verified){u.push(g.renderBadge('xsmall','verified'));}else if(q.is_work_user)u.push(g.renderBadge('xsmall','work'));s.push(h.create('span',{className:'text'},u));}if(q.category){var y=[q.category];if(q.is_external)y.push(h.create('span',{className:'arrow'}));var z=q.message?'preCategory':'category';s.push(h.create('span',{className:z},y));}if(q.message)s.push(h.create('span',{className:'category'},[q.message]));var aa=q.subtextOverride||q.subtext;if(aa){var ba=[aa];if(q.saved_context){var ca=h.create('span',{className:'saved'},[q.saved_context]);ba.unshift(ca,o);}s.push(h.create('span',{className:'subtext'},ba));}var da=q.classNames||q.type||'',ea=q.is_external?'_blank':'',fa=!q.song&&q.path||'';if(fa){if(!(/^https?\:\/\//).test(fa))fa=n.uri+fa.substr(1);fa+=(fa.indexOf('?')>0?'&':'?')+'ref=ts&fref=ts';}var ga=h.create('a',{href:fa,rel:'ignore',target:ea},s);if(q.song){ga.id='mb_'+(Math.random()*1e+06|0);setTimeout(j.addButton.bind(null,q.song.provider,ga.id,q.song.url,q.song.context,q.song.media_type),0);ga.onclick=this.ignoreClick;}var ha=null;if(q.uid==='recent'&&q.type==='header'){var ia=new m('/profile.php');ia.setQueryData({sk:'allactivity',log_filter:'search'});ha=h.create('a',{href:ia,className:'recentSearchEditLink'},i._("EDIT"));ga.setAttribute('class','recentSearchHeaderLink');da=da+' recentHeader';}var ja=h.create('li',{className:da},[ga,ha]);if(q.text){ja.setAttribute('title',q.text);ja.setAttribute('aria-label',q.text);}return ja;}p.className='search';e.exports=p;},null);
__d("LayerSlowlyFadeOnShow",["LayerFadeOnShow"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h=500,i=g.forDuration(h);e.exports=i;},null);