/*!CK:3029465673!*//*1459381524,*/

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

__d("MessagingSourceEnum",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.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_FORWARD_DIALOG:"source:chat:forward",CHAT:"source:chat",EMAIL:"source:email",EVENT_MESSAGE_BLAST:"source:event_message_blast",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",MESSENGER_BOT:"source:bot",PAGES_PRIVATE_REPLY:"source:pages:private_reply",MESSENGER_FORWARD_DIALOG:"source:messenger:forward",MESSENGER_AD:"source:messenger:ad",MARKETPLACE:"source:marketplace",MESSENGER_LEAD_GEN:"source:messenger:lead_gen",PAGES_MESSAGE_SHORTLINK:"source:pages:message_shortlink",STICKER_SUBSCRIBE:"source:messenger:sticker_subscribe",PHOTO_TAG:"source:messenger:photo_tag"};},null);
__d("MNAdsLoggerEventEnum",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={LINK_CLICK:"messenger_ads_link_click",LINK_CLICK_CTA:"messenger_ads_link_click_cta",MESSAGE_SEEN_THREAD:"messenger_ads_message_seen_thread",MESSAGE_SEEN_INBOX:"messenger_ads_message_seen_inbox",MESSAGE_SEEN_REQUEST:"messenger_ads_message_seen_request"};},null);
__d("MNCommerceBlockTypeJSInstance",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={ALL:"all",PROMOTION:"promotion",NONE:"none"};},null);
__d("StickerAssetType",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={IMAGE:"BestEffortImage",SPRITE:"SpriteImage",PADDED_SPRITE:"PaddedSpriteImage"};},null);
__d('GroupChatMessageBlockAlert',['fbt','DialogX','GenderConst','MercuryParticipants','React','XUIDialogBody.react','XUIDialogButton.react','XUIDialogFooter.react','XUIDialogTitle.react'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={show:function(j,k,l){var m=new (c('DialogX'))({width:445},c('React').createElement('div',null,c('React').createElement(c('XUIDialogTitle.react'),null,h._("See Conversations?")),c('React').createElement(c('XUIDialogBody.react'),null,this.dialogBodyText(j)),c('React').createElement(c('XUIDialogFooter.react'),null,c('React').createElement(c('XUIDialogButton.react'),{action:'cancel',label:this.leaveGroupButton(),onClick:function(){return l();}}),c('React').createElement(c('XUIDialogButton.react'),{use:'confirm',action:'cancel',label:this.openChatButton(),onClick:function(){return k();}}))));m.show();},openChatButton:function(){return h._("See Conversation");},leaveGroupButton:function(){return h._("Leave Group");},dialogBodyText:function(j){if(j.length!==1){return h._("People you've blocked are in this conversation. If you see this conversation, you'll get each other's messages to the group.");}else{var k='';c('MercuryParticipants').get(j.pop(),function(l){switch(l.gender){case c('GenderConst').FEMALE_SINGULAR:k=h._("{name} is in this group conversation but you've blocked her. If you see this conversation, you'll see her messages to the group and she'll see yours.",[h.param('name',l.short_name)]);break;case c('GenderConst').MALE_SINGULAR:k=h._("{name} is in this group conversation but you've blocked him. If you see this conversation, you'll see his messages to the group and he'll see yours.",[h.param('name',l.short_name)]);break;default:k=h._("{name} is in this group conversation but you've blocked them. If you see this conversation, you'll see their messages to the group and they'll see yours.",[h.param('name',l.short_name)]);}});return k;}}};f.exports=i;},null);
__d('MercuryAudioPlayer',['Arbiter','DOM','Event','Flash'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=200;function i(){var r=c('DOM').create('audio'),s=false;try{if(!!r.canPlayType)if(r.canPlayType('video/mp4;').replace(/^no$/,''))s=true;}finally{return s;}}function j(){return c('Flash').isAvailable();}var k=function(){this.interval=null;this.arbiterInstance=null;this.audio=c('DOM').create('audio');c('Event').listen(this.audio,'playing',function(){this.informAttachment('playing',this.audio.currentTime);this.interval=setInterval(function(){this.informAttachment('playing',this.audio.currentTime);}.bind(this),h);}.bind(this));c('Event').listen(this.audio,'ended',function(){clearInterval(this.interval);this.informAttachment('finished');}.bind(this));};Object.assign(k.prototype,{setAudio:function(r,s){this.audio.setAttribute('src',r);this.arbiterInstance=s;},informAttachment:function(r,s){if(this.arbiterInstance)this.arbiterInstance.inform(r,s);},play:function(){this.audio.play();this.informAttachment('played');},resume:function(){this.audio.play();this.informAttachment('played');},pause:function(){this.audio.pause();clearInterval(this.interval);this.informAttachment('paused');},getType:function(){return 'html5';}});var l=function(){this.src=null;this.arbiterInstance=null;var r=c('DOM').create('div');document.body.appendChild(r);this.swf=c('Flash').embed('/swf/cigars/SoundStreamPlayer.swf',r,null,{});this.interval=null;c('Arbiter').subscribe('soundstream/finished',function(){clearInterval(this.interval);this.informAttachment('finished');}.bind(this));};Object.assign(l.prototype,{setAudio:function(r,s){this.src=r;this.arbiterInstance=s;},informAttachment:function(r,s){if(this.arbiterInstance)this.arbiterInstance.inform(r,s);},play:function(){this.swf.playSound(this.src);this.interval=setInterval(function(){var r=this.swf.getCurrentTime();this.informAttachment('playing',r);}.bind(this),h);this.informAttachment('played');},resume:function(){this.swf.resume();this.informAttachment('played');},pause:function(){clearInterval(this.interval);this.swf.pause();this.informAttachment('paused');},getType:function(){return 'flash';}});function m(){if(i()){return new k();}else if(j())return new l();return false;}var n=null,o=null,p=0;function q(r,s){this.src=r;this.arbiterInstance=s;this.audio_id=++p;n!==null||(n=m());if(!n)return false;}Object.assign(q.prototype,{getType:function(){if(!n){return false;}else return n.getType();},play:function(r){if(r&&o==this.audio_id){n.resume();}else{this.pause();o=this.audio_id;n.setAudio(this.src,this.arbiterInstance);n.play();}},pause:function(){n.pause();}});f.exports=q;},null);
__d('MercuryAttachmentAudioClip.react',['cx','fbt','Arbiter','ArbiterMixin','MercuryAudioPlayer','CurrentUser','JSLogger','LeftRight.react','MercuryShareAttachmentRenderLocations','React','SubscriptionsHandler','joinClasses','shield'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k='MercuryAttachmentAudioClip/play',l=c('JSLogger').create('mercury_audio_clip'),m=c('React').createClass({displayName:'AudioClip',mixins:[c('ArbiterMixin')],propTypes:{duration:j.number,location:j.oneOf(c('MercuryShareAttachmentRenderLocations').getValues()),rootClassName:j.string,showHelp:j.bool,src:j.string.isRequired,width:j.number},getInitialState:function(){this.logged=false;return {time:0,playing:false,started:false,duration:this.props.duration,audioPlayer:new (c('MercuryAudioPlayer'))(this.props.src,this)};},componentDidMount:function(){this._subscriptionsHandler=new (c('SubscriptionsHandler'))();this._subscriptionsHandler.addSubscriptions(this.subscribe('playing',this.updateTime),this.subscribe('played',c('shield')(this.setState,this,{playing:true,started:true})),this.subscribe('paused',c('shield')(this.setState,this,{playing:false})),this.subscribe('finished',c('shield')(this.setState,this,{playing:false,started:false,time:this.props.duration})),c('Arbiter').subscribe(k,function(n,o){if(this.props.src!=o)this.setState({time:0});}.bind(this)));},componentWillUnmount:function(){this._subscriptionsHandler&&this._subscriptionsHandler.release();},updateTime:function(n,o){this.setState({time:o});},play:function(){if(this.state.playing){this.state.audioPlayer.pause();}else{this.state.audioPlayer.play(this.state.started);c('Arbiter').inform(k,this.props.src);if(!this.logged){this.logged=true;l.log('play',{uid:c('CurrentUser').getID(),duration:this.props.duration});}}},_formatSeconds:function(n){if(n){n=Math.round(n);var o=n%60;if(o<10)o='0'+o;var p=Math.floor(n/60);return p+':'+o;}else return null;},_renderPlayer:function(n,o){return (c('React').createElement('a',{className:"_1miz _2e-1 _3_om",href:'#',style:{width:n},onClick:this.play},c('React').createElement('span',{className:"_1mi- _2e-2"},c('React').createElement('i',{className:"_1mi_ _2e-3"})),c('React').createElement('span',{className:"_1mj0 _2e-4 _3oh-"},o),c('React').createElement('div',{className:"_1mj1 _2e-5"})));},render:function(){var n=this.state.time,o=this.state.playing,p=this._formatSeconds(this.state.duration),q=this.props.location===c('MercuryShareAttachmentRenderLocations').MESSENGER,r=this.props.width||170;if(q){var s=this.props.duration;if(s>10){r=240;}else if(s>5){r=200;}else if(s>2){r=160;}else r=120;}var t=null,u=Math.ceil(n*(r+2)/this.state.duration);if(q)u=Math.ceil(n*(r+24)/this.state.duration);if(this.state.audioPlayer&&this.state.audioPlayer.getType()){var v=this._renderPlayer(r,p),w=this._renderPlayer(r,p),x="_1mj2"+(' '+"_2e-6")+(o&&n!==0?' '+"_1mj3":'')+(o&&n===0?' '+"_4g4x":'');t=c('React').createElement('div',{className:x},v,c('React').createElement('div',{className:"_1mj4 _2e-7",style:{width:u}},w));}else t=c('React').createElement('div',{className:"_1mj2"},c('React').createElement('div',{className:"_1miz"},c('React').createElement(c('LeftRight.react'),null,c('React').createElement('a',{className:"_1mj5",href:this.props.src},c('React').createElement('span',{className:"_3qi6"},c('React').createElement('i',{className:"_1mj6"})),c('React').createElement('span',{className:"_1mj7"},i._("Voice Message")),c('React').createElement('span',{className:"_1mj8"},p)),c('React').createElement('a',{href:this.props.src,className:"_1mj9"},c('React').createElement('i',{className:"_1mja"})))));return (c('React').createElement('div',{className:c('joinClasses')("_1mjb"+(q?' '+"_454y":''),this.props.rootClassName)},t));}});f.exports=m;},null);
__d("MercuryAttachmentConstants",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={SIDE_LENGTH:9};f.exports=h;},null);
__d('MercuryAttachmentError.react',['fbt','XUINotice.react','XUIText.react','React'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').createClass({displayName:'MercuryAttachmentError',render:function(){return (c('React').createElement(c('XUINotice.react'),{use:'warn'},c('React').createElement(c('XUIText.react'),{size:'small'},h._("This attachment could not be loaded."))));}});f.exports=i;},null);
__d('MercuryAttachmentFile.react',['ix','cx','fbt','Image.react','LeftRight.react','Link.react','MercuryAttachment','ReactComponentWithPureRenderMixin','React','joinClasses'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryAttachmentFile',propTypes:{name:k.string.isRequired,open_url:k.string,rel:k.string,type:k.string.isRequired,url:k.string},mixins:[c('ReactComponentWithPureRenderMixin')],_renderFileLinks:function(){if(this.props.open_url)return (c('React').createElement('div',{className:"_59gs"},c('React').createElement(c('Link.react'),{target:'_blank',href:this.props.open_url},j._("open")),' ','·',' ',c('React').createElement(c('Link.react'),{href:this.props.url},j._("download"))));return c('React').createElement('div',null);},render:function(){var m=c('joinClasses')(c('MercuryAttachment').getAttachIconClass(this.props.type),"_59go _59gq");if(this.props.url)return (c('React').createElement(c('LeftRight.react'),{className:m},c('React').createElement(c('Link.react'),{href:this.props.url},c('React').createElement(c('LeftRight.react'),null,c('React').createElement(c('Image.react'),{src:h('/images/messaging/docs/generic.png')}),c('React').createElement('span',{className:"_59gp"},this.props.name))),this._renderFileLinks()));return (c('React').createElement(c('LeftRight.react'),{className:m},c('React').createElement(c('Image.react'),{src:h('/images/messaging/docs/generic.png')}),c('React').createElement('span',{className:"_59gp"},this.props.name)));}});f.exports=l;},null);
__d('MercuryAttachmentMalicious.react',['fbt','XUINotice.react','XUIText.react','React'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').createClass({displayName:'MercuryAttachmentMalicious',render:function(){return (c('React').createElement(c('XUINotice.react'),{use:'warn'},c('React').createElement(c('XUIText.react'),{size:'small'},h._("This attachment has been marked as malicious."))));}});f.exports=i;},null);
__d('ChatImageWithArrow.react',['cx','BackgroundImage.react','ChatImageArrowDirection','Link.react','MercuryAttachmentConstants','React','XUISpinner.react','getVendorPrefixedName','joinClasses'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=30,k=15,l=c('React').createClass({displayName:'ChatImageWithArrow',propTypes:{arrowDirection:i.oneOf(Object.keys(c('ChatImageArrowDirection'))),onClick:i.func,height:i.number.isRequired,isLoading:i.bool,round:i.bool,rootClassName:i.string,sideLength:i.number,source:i.string,width:i.number.isRequired},getDefaultProps:function(){return {sideLength:c('MercuryAttachmentConstants').SIDE_LENGTH,isLoading:false,round:false};},render:function(){this._arrowWidth=Math.floor(this.props.sideLength/Math.sqrt(2));this._extendedPhotoWidth=Math.ceil(this._getWidth()+this._arrowWidth);if(this.props.isLoading)return this._renderUploadingBubble();var m=c('joinClasses')("_4yp6"+(this.props.round?' '+"_3lk2":''),this.props.rootClassName);return this._renderLink(c('React').createElement('div',{className:m},c('React').createElement('div',{className:"_52kr"+(this.props.round?' '+"_3_om":''),style:{width:this._getWidth(),height:this._getHeight()}},c('React').createElement('div',{className:"_4yp9",style:{backgroundImage:'url('+this.props.source+')',width:this._getWidth(),height:this._getHeight()}}))));},_getWidth:function(){return Math.max(this.props.width,k);},_getHeight:function(){return Math.max(this.props.height,j);},_renderLink:function(m){if(this.props.onClick)return (c('React').createElement(c('Link.react'),{onClick:this.props.onClick},m));return m;},_calculateArrowTransform:function(m,n,o,p){if(n===c('ChatImageArrowDirection').LEFT){return 'translate('+o+'px, '+p+'px)'+'rotate(45deg)';}else return 'translate('+(m-o)+'px, '+p+'px)'+'rotate(45deg)';},_calculateArrowImageTransform:function(m,n,o,p){if(n===c('ChatImageArrowDirection').LEFT){return 'rotate(-45deg)'+'translate(-'+(this._arrowWidth+o)+'px,'+'-'+p+'px)';}else return 'rotate(-45deg)'+'translate(-'+(m-o)+'px, -'+p+'px)';},_renderUploadingBubble:function(){var m={width:this.props.sideLength,height:this.props.sideLength};if(this.props.source)m.backgroundImage='url('+this.props.source+')';var n={width:this.props.sideLength,height:this.props.sideLength};if(this.props.source)n.opacity=0;var o={width:this._getWidth(),height:this._getHeight()};if(this.props.source){o.backgroundImage='url('+this.props.source+')';o.backgroundSize='cover';}return (c('React').createElement('div',{className:"_4yp6"},c('React').createElement('div',{className:"_4ypb _3_om",style:o},c('React').createElement(c('XUISpinner.react'),{size:'small'}))));}});f.exports=l;},null);
__d('MercuryAttachmentPhoto.react',['ChatImageArrowDirection','ChatImageWithArrow.react','MercuryMessageInfo','MessagesViewer','React'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'MercuryAttachmentPhoto',propTypes:{height:h.number,image:h.object.isRequired,message:h.object.isRequired,onAttachmentLoad:h.func,round:h.bool,width:h.number},componentDidMount:function(){c('MessagesViewer').preload();this.props.onAttachmentLoad&&this.props.onAttachmentLoad(this.props.height);},_handleClickPicture:function(j){var k=this.props.image;c('MessagesViewer').bootstrapWithConfig({src:k.preview_url,endpoint:k.url,fbid:k.metadata.fbid,dimensions:k.metadata.dimensions,disablePaging:true},null);},render:function(){var j=c('MercuryMessageInfo').isInbound(this.props.message);return (c('React').createElement(c('ChatImageWithArrow.react'),{arrowDirection:j?c('ChatImageArrowDirection').LEFT:c('ChatImageArrowDirection').RIGHT,source:this.props.image.preview_url,height:this.props.height,width:this.props.width,onClick:this._handleClickPicture,round:!!this.props.round,isLoading:!!this.props.image.preview_uploading}));}});f.exports=i;},null);
__d('ChatGridImage.react',['cx','Link.react','React'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'ChatGridImage',propTypes:{isLoading:i.bool,onClick:i.func,size:i.number.isRequired,source:i.string},render:function(){if(this.props.isLoading)return (c('React').createElement('div',{className:"_4ypb",style:{width:this.props.size,height:this.props.size}}));return (c('React').createElement(c('Link.react'),{onClick:this.props.onClick},c('React').createElement('div',{className:"_332l",style:{backgroundImage:'url('+this.props.source+')',width:this.props.size,height:this.props.size}})));}});f.exports=j;},null);
__d('MercuryAttachmentPhotoGrid.react',['cx','ChatGridImage.react','Grid.react','MercuryAttachmentType','MercuryMessageInfo','MessagesViewer','React'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('Grid.react').GridItem,j=c('React').PropTypes,k=c('React').createClass({displayName:'MercuryAttachmentPhotoGrid',propTypes:{images:j.arrayOf(j.object).isRequired,size:j.number.isRequired,message:j.object.isRequired},componentDidMount:function(){c('MessagesViewer').preload();},_generateClickHandler:function(l){var m=this.props.images.some(function(n){return n.attach_type===c('MercuryAttachmentType').ANIMATED_IMAGE;});return (function(n){c('MessagesViewer').bootstrapWithConfig({src:l.preview_url,endpoint:l.url,fbid:l.metadata.fbid,dimensions:l.metadata.dimensions,disablePaging:m},null);});},render:function(){var l=this.props.images,m=l.length,n=m==2||m==4?2:3,o=Math.floor(this.props.size/n),p=[];for(var q=0;q<l.length;q++)p.push(c('React').createElement(i,{key:q},c('React').createElement(c('ChatGridImage.react'),{isLoading:!!l[q].preview_uploading,onClick:this._generateClickHandler(l[q]),size:o,source:l[q].preview_url})));return (c('React').createElement(c('Grid.react'),{cols:n,className:"_5b2w",spacing:"_5b2x",alignh:'right'},p));}});f.exports=k;},null);
__d('MercuryAttachmentAttribution.react',['cx','Image.react','ImmutableObject','ReactComponentWithPureRenderMixin','React','joinClasses'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'MercuryAttachmentAttribution',mixins:[c('ReactComponentWithPureRenderMixin')],propTypes:{attachment:i.instanceOf(c('ImmutableObject'))},render:function(){var k=this._getAttribution();if(!k)return null;return (c('React').createElement('div',{className:c('joinClasses')(this.props.className,"_29ew")},c('React').createElement(c('Image.react'),{src:k.icon_url,className:"_29ex"}),c('React').createElement('span',{className:"_29ey"},k.name)));},_getAttribution:function(){return this.props.attachment&&this.props.attachment.app_attribution;}});f.exports=j;},null);
__d('ChatAttachmentAttribution.react',['cx','ImmutableObject','MercuryAttachmentAttribution.react','React'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'ChatAttachmentAttribution',propTypes:{attachment:i.instanceOf(c('ImmutableObject'))},render:function(){return (c('React').createElement(c('MercuryAttachmentAttribution.react'),{attachment:this.props.attachment,className:"_1ekr _4i_6"}));}});f.exports=j;},null);
__d('ChatSpeakingSticker.react',['React','ReactDOM','ReactComponentWithPureRenderMixin'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'ChatSpeakingSticker',mixins:[c('ReactComponentWithPureRenderMixin')],propTypes:{videoURI:h.string.isRequired,videoSize:h.shape({height:h.number,width:h.number}).isRequired},_handleStickerClick:function(){var j=c('ReactDOM').findDOMNode(this.refs.stickerVideo);j.play();},render:function(){return (c('React').createElement('div',{onClick:this._handleStickerClick},c('React').createElement('video',{height:this.props.videoSize.height,ref:"stickerVideo",width:this.props.videoSize.width},c('React').createElement('source',{src:this.props.videoURI}))));}});f.exports=i;},null);
__d('MercuryAttachmentVideo.react',['cx','ix','ChatAttachmentAttribution.react','ChatImageArrowDirection','ChatImageWithArrow.react','ChatSpeakingSticker.react','CenteredContainer.react','FBOverlayBase.react','FBOverlayContainer.react','FBOverlayElement.react','Image.react','ImmutableObject','MercuryAttachment','MessagesViewer','React','Vector'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k=c('React').createClass({displayName:'MercuryAttachmentVideo',propTypes:{attachment:j.instanceOf(c('ImmutableObject')),duration:j.number.isRequired,isChat:j.bool,isInbound:j.bool,name:j.string.isRequired,onAttachmentLoad:j.func,pageID:j.number,thumbSize:j.shape({height:j.number,width:j.number}).isRequired,thumbnail:j.string.isRequired,videoSize:j.shape({height:j.number,width:j.number}).isRequired,videoID:j.string.isRequired,videoURI:j.string.isRequired},componentDidMount:function(){this.props.onAttachmentLoad&&this.props.onAttachmentLoad(this.props.thumbSize.height);c('MessagesViewer').preload();},_formatDuration:function(){var l=this.props.duration,m=Math.floor(l/60),n=l%60;if(n<10)return m+':0'+n;return m+':'+n;},openViewer:function(){var l=this.props,m=l.pageID,n=l.videoID,o=l.videoSize,p=l.videoURI;o=new (c('Vector'))(o.width,o.height);c('MessagesViewer').renderVideo({pageID:m,videoID:n,videoSize:o,videoURI:p});},_renderImage:function(){if(this.props.isChat){return (c('React').createElement('div',null,c('React').createElement(c('ChatImageWithArrow.react'),{height:this.props.thumbSize.height,key:'previewImage',round:true,source:this.props.thumbnail,width:this.props.thumbSize.width}),c('React').createElement(c('ChatAttachmentAttribution.react'),{attachment:this.props.attachment,key:'chatAttribution'})));}else return (c('React').createElement(c('Image.react'),{height:this.props.thumbSize.height,width:this.props.thumbSize.width,src:this.props.thumbnail}));},_getStyle:function(){if(this.props.isChat)return {};return this.props.thumbSize;},render:function(){if(this.props.attachment.metadata&&this.props.attachment.metadata.render_as_sticker&&this.props.isChat)return (c('React').createElement(c('ChatSpeakingSticker.react'),{videoURI:this.props.videoURI,videoSize:this.props.videoSize}));var l=c('MercuryAttachment').hasAttribution(this.props.attachment),m="clearfix"+(' '+"_zow")+(' '+"_59go")+(l?' '+"_4yjw":'')+(this.props.isChat?' '+"_3ds5":''),n=c('React').createElement(c('FBOverlayContainer.react'),{className:m,key:'overlayContainer',onClick:this.openViewer,style:this._getStyle()},c('React').createElement(c('FBOverlayBase.react'),null,this._renderImage()),c('React').createElement(c('FBOverlayElement.react'),null,c('React').createElement('div',{className:(!this.props.isChat?"_zox":'')+(l?' '+"_jt3":'')},c('React').createElement('span',{className:"_zoz"},this._formatDuration()))),c('React').createElement(c('FBOverlayElement.react'),null,c('React').createElement(c('CenteredContainer.react'),{className:l?"_jt3":'',vertical:true},c('React').createElement(c('Image.react'),{src:i('/images/chat/chat_play_icon.png')}))));if(this.props.isChat)return n;return (c('React').createElement('div',null,n,c('React').createElement(c('ChatAttachmentAttribution.react'),{attachment:this.props.attachment,key:'inboxAttribution'})));}});f.exports=k;},null);
__d('updatePhotoProgressBar',[],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();function h(i,event){if(event.loaded!=event.total){i.setPosition(50*event.loaded/event.total);}else{i.setPosition(50);i.setTarget(100,2000);}}f.exports=h;},null);
__d('PhotosMultiUploadInput',['csx','cx','fbt','Animation','Arbiter','AsyncUploadRequest','ComposerWaterfallEvent','ComposerXController','ComposerXDragDropUtils','ComposerXMarauderLogger','ComposerXMediaUploadHandler','CSS','Dialog','DOM','DragDropTarget','Event','JpegResizer','Parent','PhotosMimeType','PhotosUploadID','PhotosUploadWaterfallXMixin','ProgressBar','PUWApplications','PUWMethods','PUWSteps','Tooltip','WaterfallIDGenerator','XComposerPhotoUploader','$','mixin','performanceNow','updatePhotoProgressBar','Fbtrace'],function a(b,c,d,e,f,g,h,i,j){var k,l;if(c.__markCompiled)c.__markCompiled();var m=1366052;c("Fbtrace");function n(t,u,v,w){'use strict';this._grid=q.getInstance(w.gridID);this._grid.setProgressBarMarkup(t).setVideoIconMarkup(u).setConfig(w);v.getInput().multiple=w.maxselect!=1&&c('AsyncUploadRequest').isSupported();v.subscribe('change',function(x,event){if(event.getTarget().value)this._grid.doFileUpload(v);}.bind(this));if(!this._grid.sessionStarted){this._grid.sessionStarted=true;this._grid.logStep(c('PUWSteps').CLIENT_FLOW_BEGIN,{custom_tags:{high_quality:w.initWithHighQuality}});}this._grid.logStep(c('PUWSteps').CLIENT_SELECT_BEGIN);c('Arbiter').inform('PhotosMultiUploadInput/loaded/'+w.gridID,null,c('Arbiter').BEHAVIOR_PERSISTENT);}n.prototype.getGrid=function(){'use strict';return this._grid;};n.prototype.onQualitySettingChanged=function(t){'use strict';this._grid.setQuality(t);};Object.assign(n,{imageUploadDone:function(t,u,v,w,x){o[t].imageUploadDone(u,v,w,x);},addCameraImage:function(t,u,v){o[t].addCameraImage(u,v);},initDragDrop:function(t,u){c('Arbiter').inform('PhotosMultiUploadInput/initDragDrop/'+t,{dragDropArea:u},c('Arbiter').BEHAVIOR_PERSISTENT);},imageUploadFail:function(t,u){o[t].removeLoadingIndicator(u.getFile().uploadID);},doFileUpload:function(t,u){o[t].doFileUpload(u);},onFilesDrop:function(t,u){o[t].onFilesDrop(u);},onVaultImagesAdded:function(t,u){o[t].onVaultImagesAdded(u);},getWaterfallID:function(t){return q.getInstance(t).getWaterfallID();},clearSession:function(t){o[t].clearSession();},getConfig:function(t){return o[t].getConfig();}});var o={},p=0;k=babelHelpers.inherits(q,c('mixin')(c('PhotosUploadWaterfallXMixin')));l=k&&k.prototype;function q(t){'use strict';l.constructor.call(this);this._loadingIndicators={};this._numRemainingFiles=0;this._progressBarMarkup=null;this._videoIconMarkup=null;this._gridID=t;this._dragDropTarget=null;this._submitListener=null;this._fileInputInstances=[];this._uploadTimers={};this._sessionsStarted=false;this._waterfallID=null;this._resizer=null;this._numUploadsSucceeded=0;this._numUploadsFailed=0;this._uploadIDToFileUpload={};this._failedUploadIDs={};c('Arbiter').subscribe('multi-upload/video-removed/'+this._gridID,function(){c('DOM').remove(this._videoIconMarkup);this._submitListener&&this._submitListener.remove();this._submitListener=null;this._fileInputInstances.forEach(function(u){u.clear();});}.bind(this));c('Arbiter').subscribe('multi-upload/image-removed/'+this._gridID,function(){this._logComposerWaterfallEvent(c('ComposerWaterfallEvent').PHOTO_REMOVE);}.bind(this));c('Arbiter').subscribe('PhotosMultiUploadInput/initDragDrop/'+this._gridID,function(u,v){this.initDragDrop(v.dragDropArea);}.bind(this));c('Arbiter').subscribe('AttachmentsPhotoEditor/logPhotoEditorLaunched'+this._gridID,function(u,v){this.logStep(c('PUWSteps').CLIENT_PHOTO_EDIT_BEGIN);}.bind(this));c('Arbiter').subscribe('AttachmentsPhotoEditor/newImage'+this._gridID,this._onEditedImage.bind(this));}q.prototype.getWaterfallID=function(){'use strict';if(!this._waterfallID)this._waterfallID=c('WaterfallIDGenerator').generate();return this._waterfallID;};q.prototype.getWaterfallAppName=function(){'use strict';return c('PUWApplications').WEB_COMPOSER;};q.prototype.getWaterfallSource=function(){'use strict';return this._config.ref;};q.prototype.getLoadingIndicator=function(t){'use strict';var u=this._loadingIndicators[t];return u;};q.prototype.initDragDrop=function(t){'use strict';this._dragDropTarget&&this._dragDropTarget.disable();this._dragDropTarget=new (c('DragDropTarget'))(t).setOnFilesDropCallback(function(u){this.onFilesDrop(u,c('PUWMethods').DRAGDROP);}.bind(this)).setFileFilter(c('ComposerXDragDropUtils').filterImages).enable();};q.prototype.setConfig=function(t){'use strict';this._config=t;this._isHighQuality=t.hasOwnProperty('initWithHighQuality')?t.initWithHighQuality:true;if(!c('JpegResizer').isSupported()){this.logStep(c('PUWSteps').CLIENT_PROCESS_UNAVAILABLE);}else if(this._config.useResizer){this._resizer=new (c('JpegResizer'))(this._config.maxselect===1?1:c('JpegResizer').DEFAULT_POOL_SIZE);this._resizer.setHighQuality(this._isHighQuality);}if(!this._waterfallID)this._waterfallID=t.waterfallID;this._concurrentLimit=t.concurrentLimit;return this;};q.prototype.setProgressBarMarkup=function(t){'use strict';this._progressBarMarkup=t;return this;};q.prototype.setVideoIconMarkup=function(t){'use strict';this._videoIconMarkup=t;var u=c('DOM').find(t,"._3ev");c('Event').listen(u,'click',this._onVideoRemoved.bind(this));return this;};q.prototype.setQuality=function(t){'use strict';this._isHighQuality=t;this._resizer&&this._resizer.setHighQuality(t);this.logStep(c('PUWSteps').CLIENT_QUALITY_SWITCH,{custom_tags:{high_quality:this._isHighQuality}});};q.prototype.imageUploadDone=function(t,u,v,w){'use strict';this._numUploadsSucceeded++;var x=this.getLoadingIndicator(u);if(!x)return;if(c('DOM').contains(document.body,x.getRoot()))c('DOM').replace(x.getRoot(),t);var y={};y[u]=v;this._informImagesAdded(y,w);this._markUploadAsFinished();this._loadingIndicators[u]=null;};q.prototype.addCameraImage=function(t,u){'use strict';this.insertIntoGrid(t);this._informImagesAdded({'0':u},{});this.logStep(c('PUWSteps').CLIENT_ATTACH_PHOTO,{method:c('PUWMethods').CAMERA,fbid:u});};q.prototype._informImagesAdded=function(t,u){'use strict';c('Arbiter').inform(['multi-upload/images-added/'+this._gridID,'multi-upload/images-added'],{fbids:t,tagInfo:{exifLocation:u}});c('Arbiter').inform('composer/updateViewerLocationEstimate',u);};q.prototype._generateLoadingIndicatorForPhoto=function(t){'use strict';this._generateLoadingIndicator(t.uploadID);};q.prototype._generateLoadingIndicator=function(t){'use strict';this._numRemainingFiles++;var u=this._progressBarMarkup.cloneNode(true);c('Event').listen(u,'click',this._clickHandler.bind(this,t));this.insertIntoGrid(u);this._loadingIndicators[t]=new (c('ProgressBar'))(u);};q.prototype._generateUploadIDsAndLoadingIndicators=function(t){'use strict';for(var u=0;u<t.length;u++){if(!t[u].uploadID)t[u].uploadID=c('PhotosUploadID').getNewID();this._generateLoadingIndicator(t[u].uploadID);}};q.prototype._clickHandler=function(t,u){'use strict';var v=u.target,w="_639";if(c('Parent').byClass(v,w))if(this._failedUploadIDs[t]){this.removeLoadingIndicator(t);}else this.fileUploadCanceled(t,this._uploadIDToFileUpload[t]);var x="_2zo7";if(c('Parent').byClass(v,x)){c('CSS').hide(c('DOM').find(this.getLoadingIndicator(t).getRoot(),"._2zo5"));this._retryFileUpload(this._uploadIDToFileUpload[t].getFile());this._failedUploadIDs[t]=false;}var y="_2zo8";if(c('Parent').byClass(v,y))this.removeLoadingIndicator(t);};q.prototype.fileUploadFailure=function(t,u,v){'use strict';this._numUploadsFailed++;this._failedUploadIDs[t]=true;var w=Date.now()-this._uploadTimers[t],x=0;if(u.upload)x=u.upload.getRetryCount?u.upload.getRetryCount():0;var y=u.response.getErrorDescription(),z=u.response.getError();if(z===m)y=JSON.stringify(v);this.logStep(c('PUWSteps').CLIENT_TRANSFER_FAIL,{dt:w,error_code:z,error_info:y,bytes:u.upload.getFile().size,auto_retry_count:x,custom_tags:{high_quality:this._isHighQuality,manual_retry:!!u.upload.getFile().manuallyRetried}});if(this._config.useNewErrorUI){var aa=u.response.isTransient()||u.response.getError()==1004||u.response.getError()==1006,ba=aa&&this._uploadIDToFileUpload[t];this._showNewUploadFailedMessage(t,u.upload.getFile().name||u.upload.getFile().filename||'',u.response.getErrorSummary(),u.response.getErrorDescription(),ba,u.upload.getFile());this._markUploadAsFinished();}else{this._showUploadFailedMessage(t);this._fadeOutFileUpload(t);}};q.prototype._fadeOutFileUpload=function(t){'use strict';new (c('Animation'))(this.getLoadingIndicator(t).getRoot()).duration(2000).checkpoint().from('opacity',1).to('opacity',0).duration(1000).ondone(this.removeFileUpload.bind(this,t)).go();};q.prototype._showUploadFailedMessage=function(t){'use strict';c('CSS').hide(c('DOM').find(this.getLoadingIndicator(t).getRoot(),"._5l83"));c('CSS').show(c('DOM').find(this.getLoadingIndicator(t).getRoot(),"._5l82"));};q.prototype._showNewUploadFailedMessage=function(t,u,v,w,x,y){'use strict';var z=this.getLoadingIndicator(t).getRoot();c('CSS').hide(c('DOM').find(z,"._5l83"));c('CSS').show(c('DOM').find(z,"._2zo5"));var aa=c('DOM').find(z,"._2zo6");c('DOM').setContent(aa,u);var ba=c('DOM').find(z,"._2zo5");c('Tooltip').set(ba,v+': '+w);if(x){var ca=c('DOM').find(z,"._2zo7");c('CSS').show(ca);}else{var da=c('DOM').find(z,"._2zo8");c('CSS').show(da);}};q.prototype._finishUploadBatch=function(){'use strict';c('Arbiter').inform('multi-upload/images-upload-completed/'+this._gridID);if(this._numUploadsFailed>0){this.logStep(c('PUWSteps').CLIENT_TRANSFER_BATCH_FAIL,{volume:this._numUploadsFailed,batch_size:this._numUploadsSucceeded+this._numUploadsFailed});}else this.logStep(c('PUWSteps').CLIENT_TRANSFER_BATCH_SUCCESS,{volume:this._numUploadsSucceeded});this._numUploadsSucceeded=0;this._numUploadsFailed=0;};q.prototype.fileUploadCanceled=function(t,u){'use strict';u&&u.abort();var v={latency:Date.now()-this._uploadTimers[t]};if(u&&u.getFile())v.bytes=u.getFile().size;this.logStep(c('PUWSteps').CLIENT_TRANSFER_CANCEL,v);this.removeFileUpload(t);};q.prototype.removeFileUpload=function(t){'use strict';this.removeLoadingIndicator(t);this._markUploadAsFinished();};q.prototype._markUploadAsFinished=function(){'use strict';this._numRemainingFiles=Math.max(0,this._numRemainingFiles-1);if(this._numRemainingFiles===0)this._finishUploadBatch();};q.prototype.getVideoOrPhotoUploadCallback=function(t,u){'use strict';var v=this;return function(w){if(w){var x=c('Parent').byTag(c('$')(v._gridID),'form'),y=c('ComposerXController').getComposerID(x),z=new (c('ComposerXMediaUploadHandler'))(y);z.handleVideoSelected(t);}else if(u){v._photosSelected(t);}else new (c('Dialog'))().setBody(j._("Sorry, you can only select video files.")).setTitle(j._("Unsupported File")).setModal(true).setButtons(c('Dialog').OK).show();};};q.prototype.doFileUpload=function(t){'use strict';var u=false,v=false;switch(this._config.supportedFileTypes){case 'photos':v=true;break;case 'videos':u=true;break;case 'both':u=v=true;break;}this._submitListener&&this._submitListener.remove();var w=this.getVideoOrPhotoUploadCallback(t,v);if(u){c('ComposerXMediaUploadHandler').isVideoOrAnimatedGifAsync(t,w);}else w(false);};q.prototype.getConfig=function(){'use strict';return this._config;};q.prototype._resizeUpload=function(t,u){'use strict';var v=t.getFile();if(!v||!c('PhotosMimeType').isJpeg(v.type))return u(t);var w=c('performanceNow')();this.logStep(c('PUWSteps').CLIENT_PROCESS_BEGIN,{bytes:v.size,custom_tags:{high_quality:this._isHighQuality}});this._resizer.resizeBlob(v,function(x,y,z){y=y||v;if(x){this.logStep(c('PUWSteps').CLIENT_PROCESS_FAIL,{dt:c('performanceNow')()-w,bytes:y.size,error_code:x.code,error_info:x.message,custom_tags:{high_quality:this._isHighQuality}});return u(t);}y.uploadID=v.uploadID;y.filename=v.name;t.setFile(y);this.logStep(c('PUWSteps').CLIENT_PROCESS_SUCCESS,{dt:c('performanceNow')()-w,media_data_size:v.size,bytes:y.size,custom_tags:{high_quality:this._isHighQuality,skipped_resizing:z}});u(t);}.bind(this),this._onResizeProgress.bind(this,v.uploadID));};q.prototype._onResizeStart=function(t){'use strict';this.logStep(c('PUWSteps').CLIENT_PROCESS_BEGIN,{bytes:t.size,custom_tags:{high_quality:this._isHighQuality}});};q.prototype._onResizeFail=function(t,u,v,w){'use strict';this.logStep(c('PUWSteps').CLIENT_PROCESS_FAIL,{dt:w,bytes:u.size,error_code:v.code,error_info:v.message,custom_tags:{high_quality:this._isHighQuality}});};q.prototype._onResizeSuccess=function(t,u,v,w){'use strict';this.logStep(c('PUWSteps').CLIENT_PROCESS_SUCCESS,{dt:w,media_data_size:t.size,bytes:u.size,custom_tags:{high_quality:this._isHighQuality,skipped_resizing:v}});};q.prototype._isExceedMaxSelect=function(t){'use strict';return this._config.maxselect>1&&t>this._config.maxselect;};q.prototype._showTooManyPhotosDialog=function(t){'use strict';var u=t-this._config.maxselect;new (c('Dialog'))().setTitle(j._("Too Many Photos")).setBody(u>1?j._({"*":{"*":{"*":"You can only add up to {maxselect} photos to a post, but you've selected {photosattached} photos. Please unselect at least {unselect} photos."}}},[j.param('maxselect',this._config.maxselect,[0]),j.param('photosattached',t,[0]),j.param('unselect',u,[0])]):j._({"*":{"*":"You can only add up to {maxselect} photos to a post, but you've selected {photosattached} photos. Please unselect at least 1 photo."}},[j.param('maxselect',this._config.maxselect,[0]),j.param('photosattached',t,[0])])).setButtons(c('Dialog').OK).setModal(true).show();};q.prototype._photosSelected=function(t){'use strict';var u=t.getInput(),v=r(u);if(this._isExceedMaxSelect(v)){this._showTooManyPhotosDialog(v);return;}this._onBeforeAddUploadedImages();this._upload(t,v);};q.prototype._upload=function(t,u){'use strict';var v=t.getInput(),w=this._config.uploadData;if(this._config.waterfallID)w.qn=this._config.waterfallID;var x=function(){c('Arbiter').inform('multi-upload/images-upload-start/'+this._gridID,{imageCount:u});}.bind(this),y=new (c('XComposerPhotoUploader'))({uploadEndpoint:this._config.photoEndpoint,uploadData:w,retryLimit:this._config.retryLimit,concurrentLimit:this._config.concurrentLimit,resizer:this._resizer,onUploadEnqueued:this._generateLoadingIndicatorForPhoto.bind(this),onUploadsEnqueued:x,onUploadSent:function(){return t.clear();},onResizeStart:this._onResizeStart.bind(this),onResizeProgress:this._onResizeProgress.bind(this),onResizeSuccess:this._onResizeSuccess.bind(this),onResizeFailure:this._onResizeFail.bind(this),onUploadStart:this._onFileUploadStart.bind(this),onUploadProgress:this._onUploadProgress.bind(this),onUploadSuccess:this._onFileUploadSuccess.bind(this),onUploadFailure:this.fileUploadFailure.bind(this)});y.upload(v);this.logStep(c('PUWSteps').CLIENT_SELECT_SUCCESS,{times_selected:p++,volume:u,method:'file_selector'});};q.prototype._onVideoRemoved=function(){'use strict';this._dragDropTarget&&this._dragDropTarget.enable();c('Arbiter').inform('multi-upload/video-removed/'+this._gridID);};q.prototype.removeLoadingIndicator=function(t){'use strict';var u=this.getLoadingIndicator(t);u&&c('DOM').remove(u.getRoot());delete this._loadingIndicators[t];c('Arbiter').inform('multi-upload/loading-indicator-removed/'+this._gridID);};q.prototype._onFileUploadStart=function(t,u){'use strict';this._uploadIDToFileUpload[t]=u.upload;var v=c('DOM').find(this.getLoadingIndicator(t).getRoot(),"._639");c('CSS').show(v);this._uploadTimers[t]=Date.now();var w={custom_tags:{high_quality:this._isHighQuality}};if(u.upload&&u.upload.getFile())w.size=u.upload.getFile().size;this.logStep(c('PUWSteps').CLIENT_TRANSFER_BEGIN,w);this._logComposerWaterfallEvent(c('ComposerWaterfallEvent').PHOTO_ADD);};q.prototype._onUploadProgress=function(t,u){'use strict';var v=this.getLoadingIndicator(t);if(!v||this._failedUploadIDs[t])return;this._showProgressBar(v);c('CSS').removeClass(v.getRoot(),"_5v_0");c('updatePhotoProgressBar')(v,u.event);};q.prototype._onResizeProgress=function(t,event){'use strict';var u=this.getLoadingIndicator(t);if(!u)return;this._showProgressBar(u);c('CSS').addClass(u.getRoot(),"_5v_0");u.setPosition(100*event.written/event.total);};q.prototype._showProgressBar=function(t){'use strict';c('CSS').hide(c('DOM').find(t.getRoot(),"._2om"));c('CSS').show(c('DOM').find(t.getRoot(),"._5e4h"));};q.prototype._onFileUploadSuccess=function(t,u){'use strict';var v=Date.now()-this._uploadTimers[t],w={dt:v};if(u.upload){w.bytes=u.upload.getFile().size;w.auto_retry_count=u.upload.getRetryCount?u.upload.getRetryCount():0;w.custom_tags={high_quality:this._isHighQuality,manual_retry:!!u.upload.getFile().manuallyRetried};}this.logStep(c('PUWSteps').CLIENT_TRANSFER_SUCCESS,w);this._logComposerWaterfallEvent(c('ComposerWaterfallEvent').PHOTO_ADD_SUCCESS);};q.prototype._logComposerWaterfallEvent=function(event){'use strict';if(!c('Parent').bySelector(c('$')(this._gridID),"._119"))return;c('ComposerXMarauderLogger').logEvent(event,this._getComposerID());};q.prototype._getComposerID=function(){'use strict';return c('ComposerXController').getComposerID(this._gridID);};q.prototype._getAsyncUploadRequest=function(t){'use strict';var u=new (c('XComposerPhotoUploader'))({uploadEndpoint:this._config.photoEndpoint,uploadData:this._config.uploadData,concurrentLimit:this._config.concurrentLimit,onUploadStart:this._onFileUploadStart.bind(this),onUploadProgress:this._onUploadProgress.bind(this),onUploadSuccess:this._onFileUploadSuccess.bind(this),onUploadFail:this.fileUploadFailure.bind(this)});return u.getAsyncUploadRequest(t);};q.prototype._onEditedImage=function(t,u){'use strict';this._onBeforeAddUploadedImages();this.logStep(c('PUWSteps').CLIENT_SELECT_BEGIN);this._generateUploadIDsAndLoadingIndicators([u.blob]);var v=this._getGridItemElementByFBID(u.fbid);if(v){var w=this._loadingIndicators[u.blob.uploadID].getRoot();c('DOM').insertBefore(v,w);}c('Arbiter').inform('multi-upload/images-upload-start/'+this._gridID,{imageCount:1,method:c('PUWMethods').EDITOR});var x=this._getAsyncUploadRequest([u.blob]);x.setData(Object.assign({},this._config.uploadData,{original_fbid:u.fbid,xy_tags:u.xyTags,stickers:u.stickers,text_overlays:u.textOverlays,has_crop:u.hasCrop,has_filter:u.hasFilter}));x.send();this.logStep(c('PUWSteps').CLIENT_SELECT_SUCCESS,{volume:1,method:c('PUWMethods').EDITOR});this.logStep(c('PUWSteps').CLIENT_PHOTO_EDIT_SUCCESS);};q.prototype._getGridItemElementByFBID=function(t){'use strict';var u=c('DOM').scry(c('$')(this._gridID),".fbVaultGridItem");for(var v=0;v<u.length;v++)if(u[v].dataset.originalfbid==t)return u[v];return null;};q.prototype.onVaultImagesAdded=function(t){'use strict';var u=[];for(var v=0;v<t.length;v++)u.push({imageID:t[v]});this._generateUploadIDsAndLoadingIndicators(u);new (c('AsyncUploadRequest'))('/ajax/composerx/attachment/media/multi_upload_vault_images/').setData(Object.assign({},{vault_images:u,grid_id:this._gridID})).setAllowCrossOrigin(true).send();};q.prototype.onFilesDrop=function(t,u){'use strict';if(this._isExceedMaxSelect(t.length)){this._showTooManyPhotosDialog(t.length);return;}this._onBeforeAddUploadedImages();this.logStep(c('PUWSteps').CLIENT_SELECT_BEGIN);this._generateUploadIDsAndLoadingIndicators(t);c('Arbiter').inform('multi-upload/images-upload-start/'+this._gridID,{imageCount:t.length,method:u||c('PUWMethods').DRAGDROP});var v=this._getAsyncUploadRequest(t);if(this._resizer)v.setPreprocessHandler(this._resizeUpload.bind(this));v.send();this.logStep(c('PUWSteps').CLIENT_SELECT_SUCCESS,{volume:t.length,method:u||c('PUWMethods').DRAGDROP});};q.prototype._retryFileUpload=function(t){'use strict';this._numRemainingFiles++;c('Arbiter').inform('multi-upload/images-upload-start/'+this._gridID,{imageCount:1});this.logStep(c('PUWSteps').CLIENT_TRANSFER_MANUAL_RETRY);t.manuallyRetried=true;var u=this._getAsyncUploadRequest([t]);u.send();};q.prototype._onBeforeAddUploadedImages=function(){'use strict';if(!this.sessionStarted)this.logStep(c('PUWSteps').CLIENT_FLOW_BEGIN);if(this._config.maxselect==1)c('Arbiter').inform('multi-upload/composer-reset/'+this._gridID);this.sessionStarted=true;};q.prototype.clearSession=function(){'use strict';this.sessionStarted=false;};q.prototype.insertIntoGrid=function(t){'use strict';var u=c('DOM').scry(c('$')(this._gridID),"._577")[0];if(u){c('DOM').insertBefore(u,t);}else c('DOM').prependContent(c('$')(this._gridID),t);};q.prototype._getUploadID=function(t,u){'use strict';if(t.upload){return t.upload.getFile().uploadID;}else return u.uploadID;};q.getInstance=function(t){'use strict';o[t]=o[t]||new q(t);return o[t];};function r(t){if(!s(t))return 1;return t.files.length;}function s(t){return !!t.files&&c('AsyncUploadRequest').isSupported();}f.exports=n;},null);
__d('MercuryAttachmentSnippetType',['keyMirror'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('keyMirror')({PHOTO:null,GIF:null,VIDEO:null,AUDIO_CLIP:null,STICKER:null,SHARE:null,ERROR:null,MIXED:null,GIFT:null,THIRDPARTYSTICKER:null,FILE:null});f.exports=h;},null);
__d('P2PSnippetStringUtils',['fbt','P2PPaymentRequestStatus','P2PTransferStatus'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={getRequestCanceledSnippet:function(j,k,l,m,n){if(j){return h._("Your request for {payment request amount} from {receiver's name} was canceled.",[h.param('payment request amount',n),h.param('receiver\'s name',m)]);}else if(k){return h._("{requester's name}'s request for {payment request amount} was canceled.",[h.param('requester\'s name',l),h.param('payment request amount',n)]);}else return h._("{requester's name}'s request for {payment request amount} from {receiver's name} was canceled.",[h.param('requester\'s name',l),h.param('payment request amount',n),h.param('receiver\'s name',m)]);},getRequestDeclinedSnippet:function(j,k,l,m,n){if(j){return h._("{receiver's name} declined your request for {payment request amount}.",[h.param('receiver\'s name',m),h.param('payment request amount',n)]);}else if(k){return h._("You declined {requester's name}'s request for {payment request amount}.",[h.param('requester\'s name',l),h.param('payment request amount',n)]);}else return h._("{receiver's name} declined {sender's name}'s request for {payment request amount}.",[h.param('receiver\'s name',m),h.param('sender\'s name',l),h.param('payment request amount',n)]);},getRequestSentSnippet:function(j,k,l,m,n){if(j){return h._("You requested {amount} from {requestee name}.",[h.param('amount',n),h.param('requestee name',m)]);}else if(k){return h._("{requester name} requested {amount} from you.",[h.param('requester name',l),h.param('amount',n)]);}else return h._("{name} requested {amount} from {requestee name}.",[h.param('name',l),h.param('amount',n),h.param('requestee name',m)]);},getRequestSnippetByStatus:function(j,k,l,m,n,o){var p=j||c('P2PPaymentRequestStatus').INITED,q=[k,l,m,n,o];switch(p){case c('P2PPaymentRequestStatus').DECLINED:return this.getRequestDeclinedSnippet.apply(this,q);case c('P2PPaymentRequestStatus').TRANSFER_FAILED:case c('P2PPaymentRequestStatus').CANCELED:return this.getRequestCanceledSnippet.apply(this,q);}return this.getRequestSentSnippet.apply(this,q);},getTransferCanceledSnippet:function(j,k,l,m,n){if(j){return h._("Your {amount} payment to {receiver_name} was canceled.",[h.param('amount',n),h.param('receiver_name',m)]);}else if(k){return h._("{sender name}'s {amount} payment was canceled.",[h.param('sender name',l),h.param('amount',n)]);}else return h._("{sender_name}'s {amount} payment to {receiver_name} was canceled.",[h.param('sender_name',l),h.param('amount',n),h.param('receiver_name',m)]);},getTransferDeclinedSnippet:function(j,k,l,m,n){if(j){return h._("{receiver_name} didn't accept your {amount} payment.",[h.param('receiver_name',m),h.param('amount',n)]);}else if(k){return h._("You didn't accept {sender name}'s {amount} payment.",[h.param('sender name',l),h.param('amount',n)]);}else return h._("{receiver_name} didn't accept {sender_name}'s {amount} payment.",[h.param('receiver_name',m),h.param('sender_name',l),h.param('amount',n)]);},getTransferSentSnippet:function(j,k,l,m,n){if(j){return h._("You sent {receiver name} {amount}.",[h.param('receiver name',m),h.param('amount',n)]);}else if(k){return h._("{name} sent you {amount}.",[h.param('name',l),h.param('amount',n)]);}else return h._("{sender name} sent {receiver name} {amount}.",[h.param('sender name',l),h.param('receiver name',m),h.param('amount',n)]);},getTransferSnippetByStatus:function(j,k,l,m,n,o){var p=[k,l,m,n,o],q=j||c('P2PTransferStatus').PENDING_SENDER_INITED;switch(q){case c('P2PTransferStatus').CANCELED_DECLINED:return this.getTransferDeclinedSnippet.apply(this,p);case c('P2PTransferStatus').CANCELED_SENDER_RISK:case c('P2PTransferStatus').CANCELED_RECIPIENT_RISK:case c('P2PTransferStatus').CANCELED_SYSTEM_FAIL:case c('P2PTransferStatus').CANCELED_EXPIRED:case c('P2PTransferStatus').CANCELED_SAME_CARD:return this.getTransferCanceledSnippet.apply(this,p);}return this.getTransferSentSnippet.apply(this,p);}};f.exports=i;},null);
__d('MercuryAttachmentSnippetRenderer',['fbt','CurrentUser','MercuryAttachmentSnippetType','MercuryAttachmentType','MercuryAudioType','MercuryGiftSnippetRenderer','P2PSnippetStringUtils','StoryAttachmentStyle'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i={getAttachmentSnippetType:function(j){if(this._hasOnlyPhotos(j))return c('MercuryAttachmentSnippetType').PHOTO;if(this._hasOnlyAnimatedImages(j))return c('MercuryAttachmentSnippetType').GIF;if(this._hasOnlyVideo(j))return c('MercuryAttachmentSnippetType').VIDEO;if(this._hasAudioClip(j))return c('MercuryAttachmentSnippetType').AUDIO_CLIP;if(this._hasSticker(j))return c('MercuryAttachmentSnippetType').STICKER;if(this._hasThirdPartySticker(j))return c('MercuryAttachmentSnippetType').THIRDPARTYSTICKER;if(this._hasShare(j))return c('MercuryAttachmentSnippetType').SHARE;if(this._hasGift(j))return c('MercuryAttachmentSnippetType').GIFT;if(this._hasError(j))return c('MercuryAttachmentSnippetType').ERROR;if(this._hasFile(j))return c('MercuryAttachmentSnippetType').FILE;return c('MercuryAttachmentSnippetType').MIXED;},renderAttachmentSnippetText:function(j,k,l,m){switch(j){case c('MercuryAttachmentSnippetType').PHOTO:return this._renderPhotoAttachmentSnippetText(k,l,this._getPhotoAttachments(m));case c('MercuryAttachmentSnippetType').GIF:return this._renderAnimatedImagesAttachmentSnippetText(k,l,this._getAnimatedImageAttachments(m));case c('MercuryAttachmentSnippetType').VIDEO:return k?h._("You sent a video."):h._("{sender name} sent a video.",[h.param('sender name',l)]);case c('MercuryAttachmentSnippetType').AUDIO_CLIP:return k?h._("You sent a voice message."):h._("{name} sent a voice message.",[h.param('name',l)]);case c('MercuryAttachmentSnippetType').STICKER:case c('MercuryAttachmentSnippetType').THIRDPARTYSTICKER:return k?h._("You sent a sticker."):h._("{name} sent a sticker.",[h.param('name',l)]);case c('MercuryAttachmentSnippetType').SHARE:if(m&&this._hasP2PPayment(m))return this._renderP2PPaymentSnippetText(m[0]);if(m&&this._hasP2PPaymentRequest(m))return this._renderP2PPaymentRequestSnippetText(m[0]);if(m&&this._hasLocation(m))return k?h._("You sent a location."):h._("{sender name} sent a location.",[h.param('sender name',l)]);return k?h._("You shared a link."):h._("{sender name} shared a link.",[h.param('sender name',l)]);case c('MercuryAttachmentSnippetType').GIFT:return c('MercuryGiftSnippetRenderer').renderText(k,l);case c('MercuryAttachmentSnippetType').FILE:return k?h._("You sent an attachment."):h._("{sender name} sent an attachment.",[h.param('sender name',l)]);case c('MercuryAttachmentSnippetType').ERROR:return k?h._("You sent an attachment."):h._("{sender name} sent an attachment.",[h.param('sender name',l)]);default:return '';}},_hasOnlyPhotos:function(j){return this._getPhotoAttachments(j).length===j.length;},_hasThirdPartySticker:function(j){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').THIRDPARTYSTICKER);},_hasOnlyAnimatedImages:function(j){return this._getAnimatedImageAttachments(j).length===j.length;},_hasOnlyVideo:function(j){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').VIDEO);},_hasAudioClip:function(j){var k=j[0].metadata&&j[0].metadata.type;return (j.length===1&&(k===c('MercuryAudioType').AudioClip||k===c('MercuryAudioType').VoiceMessageWithTranscript));},_hasSticker:function(j){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').STICKER);},_hasLocation:function(j){return this._hasSingleShareAttachmentOfStyle(j,c('StoryAttachmentStyle').MESSAGE_LOCATION);},_hasP2PPayment:function(j){return this._hasSingleShareAttachmentOfStyle(j,c('StoryAttachmentStyle').ORION);},_hasP2PPaymentRequest:function(j){return this._hasSingleShareAttachmentOfStyle(j,c('StoryAttachmentStyle').ORION_REQUEST);},_hasSingleShareAttachmentOfStyle:function(j,k){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').SHARE&&j[0].share.style_list.indexOf(k)>=0);},_hasShare:function(j){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').SHARE);},_hasError:function(j){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').ERROR);},_hasGift:function(j){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').GIFT);},_hasFile:function(j){return (j.length===1&&j[0].attach_type===c('MercuryAttachmentType').FILE);},_getPhotoAttachments:function(j){if(!j)return [];return j.filter(function(k){return k.attach_type===c('MercuryAttachmentType').PHOTO;});},_getAnimatedImageAttachments:function(j){if(!j)return [];return j.filter(function(k){return k.attach_type===c('MercuryAttachmentType').ANIMATED_IMAGE;});},_renderPhotoAttachmentSnippetText:function(j,k,l){if(l.length===1){if(j){return h._("You sent a photo.");}else return h._("{name} sent a photo.",[h.param('name',k)]);}else if(j){return h._({"*":"You sent {num_photos} photos."},[h.param('num_photos',l.length,[0])]);}else return h._({"*":"{name} sent {num_photos} photos."},[h.param('name',k),h.param('num_photos',l.length,[0])]);},_renderAnimatedImagesAttachmentSnippetText:function(j,k,l){if(l.length===1){if(j){return h._("You sent a GIF.");}else return h._("{name} sent a GIF.",[h.param('name',k)]);}else if(j){return h._("You sent {num_animated_images} GIFs.",[h.param('num_animated_images',l.length)]);}else return h._("{name} sent {num_animated_images} GIFs.",[h.param('name',k),h.param('num_animated_images',l.length)]);},_renderP2PPaymentSnippetText:function(j){var k=j.share.target;return this.renderP2PPaymentSnippetText(c('CurrentUser').getID()===k.sender.id,k.sender.name,k.amountWithSymbol,k.status,c('CurrentUser').getID()===k.receiver.id,k.receiver.name);},_renderP2PPaymentRequestSnippetText:function(j){var k=j.share.target;return this.renderP2PPaymentRequestSnippetText(c('CurrentUser').getID()===k.requester.id,k.requester.name,k.amountWithSymbol,k.currentStatus,c('CurrentUser').getID()===k.requestee.id,k.requestee.name);},renderP2PPaymentSnippetText:function(j,k,l,m,n,o){return c('P2PSnippetStringUtils').getTransferSnippetByStatus(m,j,n||false,k||'',o||'',l);},renderP2PPaymentRequestSnippetText:function(j,k,l,m,n,o){return c('P2PSnippetStringUtils').getRequestSnippetByStatus(m,j,n||false,k||'',o||'',l);}};f.exports=i;},null);
__d('MessengerAdsWebTypedLogger',['Banzai','GeneratedLoggerUtils','nullthrows'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();function h(){this.clear();}h.prototype.log=function(){c('GeneratedLoggerUtils').log('messenger_ads_web:MessengerAdsWebLoggerConfig',this.$MessengerAdsWebTypedLogger1,c('Banzai').BASIC);};h.prototype.logVital=function(){c('GeneratedLoggerUtils').log('messenger_ads_web:MessengerAdsWebLoggerConfig',this.$MessengerAdsWebTypedLogger1,c('Banzai').VITAL);};h.prototype.clear=function(){this.$MessengerAdsWebTypedLogger1={};return this;};h.prototype.updateData=function(j){this.$MessengerAdsWebTypedLogger1=babelHelpers['extends']({},this.$MessengerAdsWebTypedLogger1,j);return this;};h.prototype.setEvent=function(j){this.$MessengerAdsWebTypedLogger1.event=j;return this;};h.prototype.setIsSponsored=function(j){this.$MessengerAdsWebTypedLogger1.is_sponsored=j;return this;};h.prototype.setItemID=function(j){this.$MessengerAdsWebTypedLogger1.item_id=j;return this;};h.prototype.setMessageID=function(j){this.$MessengerAdsWebTypedLogger1.message_id=j;return this;};h.prototype.setMessageTimestamp=function(j){this.$MessengerAdsWebTypedLogger1.message_timestamp=j;return this;};h.prototype.setPageID=function(j){this.$MessengerAdsWebTypedLogger1.page_id=j;return this;};h.prototype.setVC=function(j){this.$MessengerAdsWebTypedLogger1.vc=j;return this;};var i={event:true,is_sponsored:true,item_id:true,message_id:true,message_timestamp:true,page_id:true,vc:true};f.exports=h;},null);
__d('MercuryFileUploader',['csx','fbt','ArbiterMixin','CSS','Dialog','DOM','Event','FileForm','FileFormResetOnSubmit','FileInput','FormSubmitOnChange','MercuryAttachment','MercuryAttachmentTemplates','MercuryConstants','PhotosUploadID','SubscriptionsHandler','getObjectValues','mixin','shield'],function a(b,c,d,e,f,g,h,i){var j,k;if(c.__markCompiled)c.__markCompiled();j=babelHelpers.inherits(l,c('mixin')(c('ArbiterMixin')));k=j&&j.prototype;function l(n,o,p,q){'use strict';k.constructor.call(this);this.$MercuryFileUploader1=n;this.$MercuryFileUploader2={};this.$MercuryFileUploader3={};this.$MercuryFileUploader4={};this.$MercuryFileUploader5={};this.$MercuryFileUploader6={};this.$MercuryFileUploader7={};this.$MercuryFileUploader8={};this.$MercuryFileUploader9={};this.$MercuryFileUploader10={};this.updateElements(o,p,q);}l.prototype.updateElements=function(n,o,p){'use strict';this.$MercuryFileUploader11&&this.$MercuryFileUploader11.release();this.$MercuryFileUploader11=new (c('SubscriptionsHandler'))();this.$MercuryFileUploader12&&this.$MercuryFileUploader12.destroy();this.$MercuryFileUploader12=new (c('FileForm'))(n,[c('FormSubmitOnChange'),c('FileFormResetOnSubmit')]);this.$MercuryFileUploader12.setAllowCrossOrigin(true);this.$MercuryFileUploader12.setUploadInParallel(true);var q=c('DOM').find(n,"._4q60"),r=c('DOM').find(q,"._4q61");new (c('FileInput'))(q,r,o);this.$MercuryFileUploader11.addSubscriptions(this.$MercuryFileUploader12.subscribe('submit',function(){var s={count:0,file_sizes:[],files:[]};if(o.files){for(var t=0;t<o.files.length;t++)if(o.files[t].size>c('MercuryConstants').AttachmentMaxSize){this.showAttachmentSizeErrorDialog();return false;}var u={};for(var v=0;v<o.files.length;v++){var w=this.$MercuryFileUploader13();this.$MercuryFileUploader14(w,o.files[v].name);s.count++;s.file_sizes.push(o.files[v].size);u[w]=o.files[v];s.files.push({upload_id:w,metadata:o.files[v]});}this.$MercuryFileUploader12.setFiles(u);}else{p.value=this.$MercuryFileUploader13();this.$MercuryFileUploader14(p.value,o.value);s.count=1;}this.inform('submit',s);}.bind(this)),this.$MercuryFileUploader12.subscribe('success',this.$MercuryFileUploader15.bind(this)),this.$MercuryFileUploader12.subscribe('failure',this.$MercuryFileUploader16.bind(this)),c('Event').listen(r,'click',c('shield')(this.inform,this,'open')));};l.prototype.showAttachmentSizeErrorDialog=function(){'use strict';this.$MercuryFileUploader12.abort();this.$MercuryFileUploader12.clear();new (c('Dialog'))().setTitle(i._("The file you have selected is too large")).setBody(i._("The file you have selected is too large. The maximum size is 25MB.")).setButtons(c('Dialog').OK).setSemiModal(true).show();};l.prototype.addDroppedFiles=function(n){'use strict';if(!this.$MercuryFileUploader12||!this.$MercuryFileUploader12.canUseXHR())return;var o={},p={count:0,file_sizes:[],files:[]};for(var q=0;q<n.length;q++){var r=n[q];if(r.size>c('MercuryConstants').AttachmentMaxSize){this.showAttachmentSizeErrorDialog();return false;}var s=this.$MercuryFileUploader13();this.$MercuryFileUploader14(s,r.name);o[s]=r;p.file_sizes.push(r.size);p.count++;p.files.push({upload_id:s,metadata:r});}this.$MercuryFileUploader12.setFiles(o);this.$MercuryFileUploader12.forceSendViaXHR();this.inform('submit',p);};l.prototype.isUploading=function(){'use strict';return !!Object.keys(this.$MercuryFileUploader8).length;};l.prototype.addCachedAttachments=function(n){'use strict';n.forEach(function(o){var p=this.$MercuryFileUploader13();this.$MercuryFileUploader14(p,o.filename);this.inform('cached-file-added',{upload_id:p,metadata:o});this.$MercuryFileUploader17(p,o);}.bind(this));};l.prototype.addCachedImageFiles=function(n){'use strict';var o=i._("Photo");n.forEach(function(p){var q=this.$MercuryFileUploader13();this.$MercuryFileUploader14(q,o);this.$MercuryFileUploader17(q,{filename:p,image_id:p,filetype:'image/jpeg'});}.bind(this));};l.prototype.getAttachments=function(){'use strict';return c('getObjectValues')(this.$MercuryFileUploader2);};l.prototype.getImageFiles=function(){'use strict';var n=Object.keys(this.$MercuryFileUploader3).sort(),o=[];n.forEach(function(p){return o.push(this.$MercuryFileUploader3[p]);}.bind(this));return o;};l.prototype.getAnimatedImageFiles=function(){'use strict';return c('getObjectValues')(this.$MercuryFileUploader4);};l.prototype.getVideoFiles=function(){'use strict';return c('getObjectValues')(this.$MercuryFileUploader5);};l.prototype.getAudioFiles=function(){'use strict';return c('getObjectValues')(this.$MercuryFileUploader6);};l.prototype.getFiles=function(){'use strict';return c('getObjectValues')(this.$MercuryFileUploader7);};l.prototype.removeOneAttachment=function(n){'use strict';this.$MercuryFileUploader18(n);};l.prototype.removeAttachments=function(){'use strict';if(this.$MercuryFileUploader1)c('DOM').empty(this.$MercuryFileUploader1);this.$MercuryFileUploader2={};this.$MercuryFileUploader3={};this.$MercuryFileUploader4={};this.$MercuryFileUploader5={};this.$MercuryFileUploader6={};this.$MercuryFileUploader7={};this.$MercuryFileUploader9={};this.$MercuryFileUploader8={};this.$MercuryFileUploader10={};if(this.$MercuryFileUploader1)c('CSS').hide(this.$MercuryFileUploader1);this.inform('dom-updated');};l.prototype.destroy=function(){'use strict';this.$MercuryFileUploader11&&this.$MercuryFileUploader11.release();this.$MercuryFileUploader12&&this.$MercuryFileUploader12.destroy();this.removeAttachments();};l.prototype.$MercuryFileUploader14=function(n,o){'use strict';var p=c('MercuryAttachmentTemplates')[':fb:mercury:upload-file-row'].build(),q={};this.$MercuryFileUploader9[n]=p;this.$MercuryFileUploader8[n]=true;this.$MercuryFileUploader10[n]=Date.now();var r=m(o);c('DOM').appendContent(p.getNode('iconText'),r);q.fileName=r;c('Event').listen(p.getNode('closeFileUpload'),'click',this.$MercuryFileUploader18.bind(this,n));if(this.$MercuryFileUploader1){c('DOM').appendContent(this.$MercuryFileUploader1,p.getRoot());c('CSS').show(this.$MercuryFileUploader1);}this.inform('dom-updated',q);};l.prototype.$MercuryFileUploader18=function(n,event){'use strict';if(this.$MercuryFileUploader8[n]){this.inform('upload-canceled-during-upload');}else if(this.$MercuryFileUploader2[n]||this.$MercuryFileUploader3[n]||this.$MercuryFileUploader4[n]||this.$MercuryFileUploader5[n]||this.$MercuryFileUploader6[n]||this.$MercuryFileUploader7[n])this.inform('upload-canceled-after-uploaded');delete this.$MercuryFileUploader2[n];delete this.$MercuryFileUploader3[n];delete this.$MercuryFileUploader4[n];delete this.$MercuryFileUploader5[n];delete this.$MercuryFileUploader6[n];delete this.$MercuryFileUploader7[n];delete this.$MercuryFileUploader8[n];delete this.$MercuryFileUploader10[n];var o=this.$MercuryFileUploader9[n];delete this.$MercuryFileUploader9[n];if(o){c('DOM').remove(o.getRoot());this.inform('dom-updated');}this.inform('upload-canceled');return false;};l.prototype.$MercuryFileUploader19=function(n,o){'use strict';var p=this.$MercuryFileUploader9[n],q=c('MercuryAttachment').getAttachIconClassByMime(o);c('CSS').addClass(p.getNode('iconText'),q);c('CSS').addClass(p.getRoot(),'done');};l.prototype.$MercuryFileUploader17=function(n,o){'use strict';if(this.$MercuryFileUploader8[n]){delete this.$MercuryFileUploader8[n];if(o.image_id){this.$MercuryFileUploader3[n]=o.image_id;}else if(o.gif_id){this.$MercuryFileUploader4[n]=o.gif_id;}else if(o.video_id){this.$MercuryFileUploader5[n]=o.video_id;}else if(o.audio_id){this.$MercuryFileUploader6[n]=o.audio_id;}else if(o.file_id){this.$MercuryFileUploader7[n]=o.file_id;}else this.$MercuryFileUploader2[n]=o;this.$MercuryFileUploader19(n,o.filetype);this.inform('one-upload-completed',{upload_time_ms:Date.now()-this.$MercuryFileUploader10[n],upload_id:n,metadata:o});}if(!this.isUploading())this.inform('all-uploads-completed',{count:this.getAttachments().length});};l.prototype.$MercuryFileUploader15=function(event,n){'use strict';var o=n.response.getPayload();this.$MercuryFileUploader17(this.$MercuryFileUploader20(n),o.metadata[0]);};l.prototype.$MercuryFileUploader16=function(event,n){'use strict';this.inform('one-upload-failed');this.$MercuryFileUploader18(this.$MercuryFileUploader20(n),event);};l.prototype.$MercuryFileUploader13=function(){'use strict';return 'upload_'+c('PhotosUploadID').getNewID();};l.prototype.$MercuryFileUploader20=function(n){'use strict';var o=n.response.getPayload();if(n.upload){return n.upload.getName();}else return o.uploadID;};function m(n){if(n&&n.startsWith('C:\\fakepath\\'))return n.substring(12);return n;}f.exports=l;},null);
__d('VaultEditableGrid',['csx','Event','Arbiter','AsyncRequest','CSS','DOM','Scroll','$','ge','removeFromArray'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={};function j(k,l,m,n){i[k.id]=this;this._grid=k;this._gridID=k.id;this._dialogEndpoint=l;this._collapseWhenEmpty=m;this._attachmentCount=n;this._selectedVaultImageIDs=[];c('Arbiter').subscribe('multi-upload/image-removed/'+this._gridID,function(o,p){c('removeFromArray')(this._selectedVaultImageIDs,p);this.updateAttachmentCount(this._attachmentCount-1);}.bind(this));c('Arbiter').subscribe('multi-upload/composer-reset/'+this._gridID,function(o,p){this.removeImages();}.bind(this));c('Arbiter').subscribe(['multi-upload/images-upload-start/'+this._gridID,'multi-upload/video-added/'+this._gridID],function(){this.updateAttachmentCount(this._attachmentCount+1);}.bind(this));c('Arbiter').inform('fbVaultEditableGrid/created/'+k.id,this,c('Arbiter').BEHAVIOR_PERSISTENT);c('Arbiter').subscribe('multi-upload/images-upload-start/'+this._gridID,this._scrollToRight.bind(this));this.updateAttachmentCount(this._attachmentCount);}Object.assign(j,{VAULT_IMAGE:'vault_image',getInstance:function(k){return i[k];},registerDialogWithGrid:function(k,l,m){c('Arbiter').subscribe(['multi-upload/images-upload-start/'+k,'multi-upload/video-added/'+k],m.hide.bind(m));c('Arbiter').subscribe('fbVaultEditableGrid/created/'+k,function(n,o){o._registerDialogWithGrid(l,m);});},onImagesSelected:function(k,l,m){i[k]._onImagesSelected(l,m);}});Object.assign(j.prototype,{getRoot:function(){var k=c('ge')(this._gridID);if(k){return k;}else return this._grid;},_registerDialogWithGrid:function(k,l){this._dialog=l;var m=this.getMoreLink();m&&c('Event').listen(m,'click',function(){l.show();return false;});l.subscribe('aftershow',function(){var n=[];c('DOM').scry(c('$')(this._gridID),'input[type="hidden"]').forEach(function(p){if(p.name.match('composer_vault_images')||p.name.match('composer_unpublished_photo'))n.push(p.value);});var o=k.getGrid();o.bulkChange(function(){var p=o.getSelectionSet();p.clear();p.addAll(n);});}.bind(this));},updateAttachmentCount:function(k){this._attachmentCount=k;if(this._collapseWhenEmpty)c('CSS').conditionShow(this._grid,this._attachmentCount>0);},getID:function(){return this._gridID;},_onImagesSelected:function(k,l){var m=c('DOM').find(this.getRoot(),"._577");this.removeImages();this._selectedVaultImageIDs=l;k.forEach(function(n){c('DOM').insertBefore(m,n);});c('Arbiter').inform('multi-upload/images-added/'+this._gridID,{fbids:l});this._scrollToRight();},removeImages:function(){c('DOM').scry(this.getRoot(),'.fbVaultGridItem').forEach(function(k){if(!c('CSS').hasClass(k,'fbVaultEditableGridMoreLink'))c('DOM').remove(k);});this._selectedVaultImageIDs=[];c('Arbiter').inform('multi-upload/all-images-removed/'+this._gridID);this.updateAttachmentCount(0);},_scrollToRight:function(){var k=this.getRoot(),l=c('DOM').find(k,'.fbScrollableAreaWrap');c('Scroll').setLeft(l,Math.max(0,c('DOM').find(k,'.fbScrollableAreaBody').offsetWidth-l.offsetWidth));},showDialog:function(k,l){if(this._dialog){this._dialog.show();}else c('AsyncRequest').bootstrap(this._dialogEndpoint,k);},getMoreLink:function(){return c('DOM').scry(this.getRoot(),'.fbVaultEditableGridMoreLink')[0];}});f.exports=j;},null);
__d('BasePhotoUploader',['Arbiter','ArbiterMixin','CSS','DOM','PhotosMultiUploadInput','VaultEditableGrid','TimelineMapScrollableArea','mixin','getObjectValues'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('mixin')(c('ArbiterMixin')));i=h&&h.prototype;function j(k,l){'use strict';i.constructor.call(this);new (c('TimelineMapScrollableArea'))(k,{verticalscroll:true});this.$BasePhotoUploader1=k;this.$BasePhotoUploader2=this.$BasePhotoUploader3();this.$BasePhotoUploader4=false;this.$BasePhotoUploader5=null;l.addSubscriptions(c('Arbiter').subscribe('multi-upload/images-added/'+this.$BasePhotoUploader1.id,function(m,n){var o=Object.assign({},n.fbids);Object.assign(this.$BasePhotoUploader2,o);this.$BasePhotoUploader6();this.inform('upload-completed',{fbids:c('getObjectValues')(o)});}.bind(this)),c('Arbiter').subscribe('multi-upload/image-removed/'+this.$BasePhotoUploader1.id,function(m,n){for(var o in this.$BasePhotoUploader2)if(this.$BasePhotoUploader2[o]===n){delete this.$BasePhotoUploader2[o];break;}this.$BasePhotoUploader6();}.bind(this)),c('Arbiter').subscribe('multi-upload/images-upload-start/'+this.$BasePhotoUploader1.id,function(m,n){c('CSS').show(this.$BasePhotoUploader1);this.$BasePhotoUploader4=true;this.inform('dom-updated');this.inform('upload-started',n);}.bind(this)),c('Arbiter').subscribe('multi-upload/composer-reset/'+this.$BasePhotoUploader1.id,this.clear.bind(this)),c('Arbiter').subscribe('multi-upload/all-images-removed/'+this.$BasePhotoUploader1.id,this.$BasePhotoUploader7.bind(this)),c('Arbiter').subscribe('multi-upload/images-upload-completed/'+this.$BasePhotoUploader1.id,function(m){this.$BasePhotoUploader4=false;this.inform('all-uploads-completed');this.$BasePhotoUploader6();}.bind(this)));c('CSS').conditionShow(this.$BasePhotoUploader1,Object.keys(this.$BasePhotoUploader2).length);}j.prototype.getSelectedFBIDs=function(){'use strict';var k=Object.keys(this.$BasePhotoUploader2).sort();return k.map(function(l){return this.$BasePhotoUploader2[l];}.bind(this));};j.prototype.isUploading=function(){'use strict';return this.$BasePhotoUploader4;};j.prototype.clear=function(){'use strict';var k=c('VaultEditableGrid').getInstance(this.$BasePhotoUploader1.id);k&&k.removeImages();};j.prototype.getWaterfallID=function(){'use strict';return c('PhotosMultiUploadInput').getWaterfallID(this.$BasePhotoUploader1.id);};j.prototype.$BasePhotoUploader7=function(){'use strict';this.$BasePhotoUploader2={};this.$BasePhotoUploader4=false;c('CSS').hide(this.$BasePhotoUploader1);this.inform('all-uploads-completed');this.inform('dom-updated');};j.prototype.$BasePhotoUploader3=function(){'use strict';var k={},l=-10000;c('DOM').scry(this.$BasePhotoUploader1,'input[type="hidden"]').forEach(function(m){if(m.name.match('composer_vault_images')){k[l]=m.value;l--;}});return k;};j.prototype.$BasePhotoUploader6=function(){'use strict';c('CSS').conditionShow(this.$BasePhotoUploader1,Object.keys(this.$BasePhotoUploader2).length>0);this.inform('dom-updated');};j.prototype.setCurrentMethod=function(k){'use strict';this.$BasePhotoUploader5=k;};j.prototype.getCurrentMethod=function(){'use strict';return this.$BasePhotoUploader5;};f.exports=j;},null);
__d('MercuryPhotoUploader',['csx','cx','Arbiter','AsyncRequest','BasePhotoUploader','DOM','Event','FileInput','Focus','Parent','PhotosMultiUploadInput','PUWMethods','VaultEditableGrid'],function a(b,c,d,e,f,g,h,i){var j,k;if(c.__markCompiled)c.__markCompiled();j=babelHelpers.inherits(l,c('BasePhotoUploader'));k=j&&j.prototype;function l(m,n,o,p){'use strict';k.constructor.call(this,m,o);this.$MercuryPhotoUploader1=m.id;this.$MercuryPhotoUploader2=false;c('Arbiter').subscribe('PhotosMultiUploadInput/loaded/'+m.id,function(){this.$MercuryPhotoUploader2=true;}.bind(this));c('Arbiter').subscribe('MercuryPhotoUploader/initUploadButton/'+m.id,function(){var q=c('DOM').scry(n,'input[type="file"]')[0];if(!q)q=c('DOM').create('input',{accept:'image/*',type:'file',className:"_n",name:'composer_unpublished_photo[]',multiple:1});var r=c('Parent').bySelector(n,"._9_h"),s=new (c('FileInput'))(r,c('DOM').find(r,"._214"),q);s.subscribe('change',c('PhotosMultiUploadInput').doFileUpload.bind(null,m.id,s));});c('Arbiter').subscribe('MercuryPhotoUploader/registerPhotoMenu/'+m.id,function(q,r){var s=r.menu.getRoot();r.menu.setContext(n);var t=c('DOM').scry(s,"._d2p"),u=t&&t[0];u&&c('Event').listen(u,'click',function(){c('VaultEditableGrid').getInstance(m.id).showDialog(u,c('VaultEditableGrid').VAULT_IMAGE);this.setCurrentMethod(c('PUWMethods').VAULT);this.inform('selection-start',{method:c('PUWMethods').VAULT});}.bind(this));c('Event').listen(n,'click',function(){if(!this.$MercuryPhotoUploader2)return;if(!r.menu.isShown()){var w=c('DOM').scry(r.menu.getContentRoot(),'li');this.inform('menu-show');r.menu.show();if(w)c('Focus').setWithoutOutline(w[0]);}else{this.inform('menu-hide');r.menu.hide();}}.bind(this));c('Event').listen(document.documentElement,'click',function(event){if(!c('DOM').contains(n,event.getTarget())&&!c('DOM').contains(u,event.getTarget())){if(r.menu.isShown())this.inform('menu-hide');r.menu.hide();}}.bind(this));var v=c('DOM').find(s,"._9_h");c('Event').listen(v,'click',function(){this.setCurrentMethod(c('PUWMethods').FILE_SELECTOR);this.inform('selection-start',{method:c('PUWMethods').FILE_SELECTOR});}.bind(this));}.bind(this));p&&c('PhotosMultiUploadInput').initDragDrop(m.id,p);}l.prototype.uploadPastedFile=function(m){'use strict';c('PhotosMultiUploadInput').onFilesDrop(this.$MercuryPhotoUploader1,[m]);};l.prototype.addCachedPhotos=function(m){'use strict';c('AsyncRequest').post('/ajax/vault/selected.php',{max_select:10,grid_id:this.$MercuryPhotoUploader1,source:'messenger',image_ids:m});};Object.assign(l,{initUploadButton:function(m){c('Arbiter').inform('MercuryPhotoUploader/initUploadButton/'+m,{},c('Arbiter').BEHAVIOR_PERSISTENT);},registerPhotoMenu:function(m,n){c('Arbiter').inform('MercuryPhotoUploader/registerPhotoMenu/'+m,{menu:n},c('Arbiter').BEHAVIOR_PERSISTENT);}});f.exports=l;},null);
__d('MercuryShareLinkUploader',['ArbiterMixin','AsyncRequest','CSS','DOM','Event','Form','URLScraper','WebMessengerEvents','mixin','isEmpty'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('mixin')(c('ArbiterMixin')));i=h&&h.prototype;function j(){'use strict';i.constructor.call(this);this.__initialize.apply(this,arguments);}j.prototype.__initialize=function(k,l,m,n,o){'use strict';this.$MercuryShareLinkUploader1=k;this.$MercuryShareLinkUploader2=l;this.$MercuryShareLinkUploader3=m;this.$MercuryShareLinkUploader4=o;this.$MercuryShareLinkUploader5=false;this.$MercuryShareLinkUploader6=null;this.$MercuryShareLinkUploader7=null;c('Event').listen(n,'click',this.close.bind(this));c('Event').listen(o,'keyup',function(){!o.value.length&&this.$MercuryShareLinkUploader8.enable();}.bind(this));this.$MercuryShareLinkUploader8=new (c('URLScraper'))(o);this.$MercuryShareLinkUploader8.subscribe('match',function(p,q){this.loadShare(q&&q.url);}.bind(this));};j.prototype.getAttachData=function(){'use strict';return this.loadAttachData(this.$MercuryShareLinkUploader5,this.$MercuryShareLinkUploader1,this.$MercuryShareLinkUploader4);};j.prototype.getShareDataFromStage=function(k,l){'use strict';var m=c('Form').serialize(l),n=m.attachment&&m.attachment.params;if(!n)return null;if(n instanceof Object){var o=[];o.push(n[0]);o.push(n[1]);n=o;}return {params:n,type:m.attachment.type};};j.prototype.loadAttachData=function(k,l,m,n){'use strict';if(k){var o=c('Form').serialize(l),p=o.attachment&&o.attachment.params,q=o.link_metrics?o.link_metrics.no_image:true;if(!p||c('isEmpty')(p))return null;var r=n?n():m.value;if(r.indexOf(p.url)===-1)return o;if(!p.summary&&!p.favicon&&q&&p.title&&p.url&&p.url.substr(0,p.title.length)===p.title)return null;return o;}return null;};j.prototype.check=function(){'use strict';this.$MercuryShareLinkUploader8.check();};j.prototype.close=function(){'use strict';this.$MercuryShareLinkUploader9();this.$MercuryShareLinkUploader8.disable();this.inform('closed');};j.prototype.clear=function(){'use strict';this.$MercuryShareLinkUploader9();this.$MercuryShareLinkUploader8.enable();};j.prototype.enable=function(){'use strict';this.$MercuryShareLinkUploader8.enable();};j.prototype.disable=function(){'use strict';this.$MercuryShareLinkUploader8.disable();};j.prototype.loadShare=function(k){'use strict';this.$MercuryShareLinkUploader6=k;this.$MercuryShareLinkUploader7&&this.$MercuryShareLinkUploader7.abort();this.$MercuryShareLinkUploader7=new (c('AsyncRequest'))().setMethod('POST').setURI('/ajax/share_scrape.php').setData({u:k}).setHandler(this.$MercuryShareLinkUploader10.bind(this).bind(null,k)).setStatusElement(this.$MercuryShareLinkUploader3);this.$MercuryShareLinkUploader7.send();this.inform('link-detected');};j.prototype.$MercuryShareLinkUploader10=function(k,l){'use strict';if(this.$MercuryShareLinkUploader6!==k)return;this.$MercuryShareLinkUploader6=null;this.$MercuryShareLinkUploader7=null;c('CSS').show(this.$MercuryShareLinkUploader1);c('DOM').empty(this.$MercuryShareLinkUploader2);c('DOM').setContent(this.$MercuryShareLinkUploader2,l.payload);this.$MercuryShareLinkUploader5=true;if(!this.getAttachData()){this.close();return;}c('WebMessengerEvents').detailDOMChanged();};j.prototype.$MercuryShareLinkUploader9=function(){'use strict';c('CSS').hide(this.$MercuryShareLinkUploader1);this.$MercuryShareLinkUploader5=false;this.$MercuryShareLinkUploader6=null;this.$MercuryShareLinkUploader7&&this.$MercuryShareLinkUploader7.abort();this.$MercuryShareLinkUploader7=null;this.$MercuryShareLinkUploader8.reset();c('WebMessengerEvents').detailDOMChanged();};f.exports=j;},null);
__d('ChatEmployeeAwayWarning',['MercuryIDs','MercuryParticipants','MercuryViewer'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={updateEmployeeAwayWarning:function(i,j,k){c('MercuryParticipants').get(c('MercuryViewer').getID(),function(l){var m=l.employee;if(m)c('MercuryParticipants').getMulti(i.participants,function(n){var o=false,p=c('MercuryIDs').getUserIDFromThreadID(i.thread_id);if(!p)return;var q='fbid:'+p;for(var r in n)if(q==n[r].id&&n[r].is_employee_away)o=true;if(o){j();}else k();});});}};f.exports=h;},null);
__d('MessengerHotLikeUtils',['EmojiLikeConstants','StickerAssetType','StickerConstants','XStickerAssetController'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={SizeTimes:{small:1000,medium:2000,large:3000},getStickerIDForTime:function(i){var j=null;switch(true){case i<this.SizeTimes.small:j=c('StickerConstants').HOT_LIKE_SMALL_STICKER_ID;break;case i<this.SizeTimes.medium:j=c('StickerConstants').HOT_LIKE_MEDIUM_STICKER_ID;break;case i<this.SizeTimes.large:j=c('StickerConstants').HOT_LIKE_LARGE_STICKER_ID;break;}return j;},getEmojiSizeForTime:function(i){var j=null;if(i<this.SizeTimes.small){j=c('EmojiLikeConstants').size.SMALL;}else if(i<this.SizeTimes.medium){j=c('EmojiLikeConstants').size.MEDIUM;}else if(i<this.SizeTimes.large)j=c('EmojiLikeConstants').size.LARGE;return j;},getGrowCoefficientForSince:function(i){return Math.min(1,(Date.now()-i)/this.SizeTimes.large);},getMetadataForHotLike:function(i){var j;switch(i){case c('StickerConstants').HOT_LIKE_LARGE_STICKER_ID:j=120;break;case c('StickerConstants').HOT_LIKE_MEDIUM_STICKER_ID:j=84;break;case c('StickerConstants').HOT_LIKE_SMALL_STICKER_ID:j=35;break;case c('EmojiLikeConstants').size.LARGE:j=64;break;case c('EmojiLikeConstants').size.MEDIUM:j=64;break;case c('EmojiLikeConstants').size.SMALL:j=32;break;}return j?{height:j,width:j}:undefined;},getPreviewURI:function(){return c('XStickerAssetController').getURIBuilder().setInt('sticker_id',c('StickerConstants').HOT_LIKE_LARGE_STICKER_ID).setEnum('image_type',c('StickerAssetType').IMAGE).getURI().toString();},getURIWithID:function(i){return c('XStickerAssetController').getURIBuilder().setInt('sticker_id',i).setEnum('image_type',c('StickerAssetType').IMAGE).getURI().toString();}};f.exports=h;},null);
__d('MessengerContextualDialog.react',['cx','ContextualLayerAutoFlipHorizontal','LayerHideOnEscape','ReactAbstractContextualDialog','ReactLayer'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=12,j=c('ReactLayer').createClass(c('ReactAbstractContextualDialog').createSpec({addedBehaviors:[c('ContextualLayerAutoFlipHorizontal'),c('LayerHideOnEscape')],displayName:'MessengerContextualDialog',shouldSetARIAProperties:false,theme:{wrapperClassName:"_1r_9",arrowDimensions:{offset:i,length:16}}}));f.exports=j;},null);
__d('MessengerRadioButton.react',['cx','ReactComponentWithPureRenderMixin','React','XUIRadioInput.react'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').createClass({displayName:'MessengerRadioButton',mixins:[c('ReactComponentWithPureRenderMixin')],render:function(){return (c('React').createElement(c('XUIRadioInput.react'),babelHelpers['extends']({},this.props,{className:"__rm"})));}});f.exports=i;},null);
__d('MessengerRadioList.react',['invariant','InputLabel.react','MessengerRadioButton.react','React','ReactChildren'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'MessengerRadioList',propTypes:{name:i.string,onValueChange:i.func,selectedValue:i.any},render:function(){var k=c('ReactChildren').map(this.props.children,function(l){return c('React').cloneElement(l,{name:this.props.name,onSelect:this.props.onValueChange,selectedValue:this.props.selectedValue});},this);return c('React').createElement('ul',babelHelpers['extends']({},this.props,{name:null}),k);}});j.Item=c('React').createClass({displayName:'Item',propTypes:{disabled:i.bool,name:i.string,onSelect:i.func,selectedValue:i.any,value:i.any},render:function(){return (c('React').createElement('li',{className:this.props.className},c('React').createElement(c('InputLabel.react'),{display:'inline'},c('React').createElement(c('MessengerRadioButton.react'),{checked:this.props.selectedValue===this.props.value,disabled:!!this.props.disabled,name:this.props.name,onChange:this._handleChange,value:this.props.value}),c('React').createElement('label',null,this.props.children))));},_handleChange:function(event){!(event.target instanceof HTMLInputElement)?h(0):void 0;this.props.onSelect&&this.props.onSelect(event.target.value);}});f.exports=j;},null);
__d('MessengerHotLikeSVG.react',['cssVar','cx','fbt','React','joinClasses','uniqueID'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l='transparent',m=j._("Thumbs Up Sign"),n=c('React').createClass({displayName:'MessengerHotLikeSVG',propTypes:{color:k.string},getInitialState:function(){return {titleId:c('uniqueID')()};},render:function(){var o=this.props.color||"#0084ff";return (c('React').createElement('div',{className:c('joinClasses')(this.props.className,"_1i1j")},c('React').createElement('svg',{'aria-labelledby':this.state.titleId,height:'100%',role:'img',version:'1.1',viewBox:'0 0 381 400',width:'100%',x:'0px',y:'0px'},c('React').createElement('title',{id:this.state.titleId},m),c('React').createElement('g',null,c('React').createElement('g',null,c('React').createElement('path',{d:'M0,399.8h86.4V160.8H0V399.8z M381,220.7c0-13.6-7.4-25.5-18.5-31.8c8.8-6.6,14.5-17.4,14.5-29.3 c0-20.1-16.4-36.8-36.5-36.8H217c20.4-106.5-31.3-128.2-51.7-123c-12.3,3.1-13.6-0.3-11.4,24.2l3.4,42.7c0.3,3.5,0,7.2-0.8,10.8 c-0.8,3.6-2.7,6.9-4.6,10L106.8,160v208.7h195.3v-1.2c19.2-1.1,34.5-17.4,34.5-36.9c0-6.1-1.5-12-4.1-17 c17.3-2.8,30.4-18,30.4-36.1c0-8.2-2.7-15.9-7.4-22C370.1,250.8,381,237,381,220.7z',fill:o,stroke:l,strokeLinecap:'round',strokeWidth:'5%'}))))));}});f.exports=n;},null);
__d('MessengerHotLikePreview.react',['cx','Animation','EmojiLikeConstants','HotLikeSound','MercuryConfig','MessengerHotLikePreviewEvents','MessengerHotLikeSVG.react','MessengerHotLikeUtils','React','ReactDOM','StickerConstants','SubscriptionsHandler'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'MessengerHotLikePreview',propTypes:{customLike:i.object,since:i.number},componentDidMount:function(){this._subscriptions=new (c('SubscriptionsHandler'))();this._subscriptions.addSubscriptions(c('MessengerHotLikePreviewEvents').addListener(c('MessengerHotLikePreviewEvents').STOP,this._snapToStickerSize),c('MessengerHotLikePreviewEvents').addListener(c('MessengerHotLikePreviewEvents').POP,this._pop));c('HotLikeSound').start();this._growthAnimation=new (c('Animation'))(c('ReactDOM').findDOMNode(this)).to('width',80).to('height',80).duration(3000).go();this._setUpRotationAnimation();},componentWillUnmount:function(){this._subscriptions&&this._subscriptions.release();},render:function(){if(this.props.customLike){var k=this.props.customLike;if(c('MercuryConfig').MessengerNewEmojiGK)var l=c('MercuryConfig').MessengerNewEmojiUtils,m=l.getNewEmojiData(k.emoji,c('EmojiLikeConstants').size.LARGE);var n=m?m.url:this.props.customLike.large;return (c('React').createElement('div',{className:"_4a9g _383m",style:{backgroundImage:'url('+n+')'}}));}return (c('React').createElement('div',{className:"_4a9g _576q"},c('React').createElement(c('MessengerHotLikeSVG.react'),{color:this.props.customColor})));},_setUpRotationAnimation:function(){this._rotateAnimation=new (c('Animation'))(c('ReactDOM').findDOMNode(this));this._rotateHotLike(-2,2,150,1000);this._rotateHotLike(-4,4,100,1000);this._rotateHotLike(-10,10,75,1000);this._rotateAnimation.go();},_rotateHotLike:function(k,l,m,n){var o=Math.floor(n/m),p=null;for(var q=0;q<o;q++){p=q%2?k:l;this._rotateAnimation.to('rotateZ',p).duration(m).checkpoint();}},_snapToStickerSize:function(k){if(this._snapped)return;this._snapped=true;var l=Date.now()-this.props.since,m=null;if(this.props.customLike)m=c('MessengerHotLikeUtils').getEmojiSizeForTime(l);var n=c('MessengerHotLikeUtils').getStickerIDForTime(l);if(n){c('HotLikeSound').snap(n);var o=c('MessengerHotLikeUtils').getMetadataForHotLike(m||n);this._rotateAnimation.stop();var p=30,q=-10;if(n===c('StickerConstants').HOT_LIKE_SMALL_STICKER_ID){p=0;q=0;}this._growthAnimation.stop().to('width',o.width*1.2).to('height',o.height*1.2).to('rotateZ',p).duration(100).checkpoint().to('width',o.width*.9).to('height',o.height*.9).to('rotateZ',q).duration(100).checkpoint().to('width',o.width).to('height',o.height).to('rotateZ',0).duration(100).ondone(function(){c('MessengerHotLikePreviewEvents').emit(c('MessengerHotLikePreviewEvents').FINISH_ANIMATION,k,n,m);}).go();}},_pop:function(k){c('HotLikeSound').pop();this._growthAnimation.stop().to('width',0).to('height',0).duration(100).ondone(function(){c('MessengerHotLikePreviewEvents').emit(c('MessengerHotLikePreviewEvents').REMOVE,k);}).go();}});f.exports=j;},null);
__d('MNCommerceAttachmentConstants',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={XLARGE_IMAGE_DIMENSION:72,LARGE_IMAGE_DIMENSION:60,SMALL_IMAGE_DIMENSION:32,SINGLE_IMAGE_HEIGHT:108,BUBBLE_PADDING:6,IMAGE_HEIGHT:{CHAT:108,WEB_INBOX:130},UNLINK_ERROR_DIALOG:{WIDTH:300},DIALOG:{WIDTH:445,PADDING:12},MDOTCOMDIALOG:{WIDTH:495},ORDER_DETAIL:{SUB_TOTAL:'subTotal',SHIPPING:'shippingCost',TAX:'tax',TOTAL:'totalCost'}};f.exports=h;},null);
__d('MNCommerceDialog.react',['cx','CurrentEnvironment','LayerFadeOnHide','LayerHideOnEscape','MNCommerceAttachmentConstants','MessengerDialog.react','React','XUIDialog.react','emptyFunction','joinClasses'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'MNCommerceDialog',propTypes:{onToggle:i.func,shown:i.bool,width:i.number.isRequired},getDefaultProps:function(){return {onToggle:c('emptyFunction'),repositionOnUpdate:true,shown:true,width:c('CurrentEnvironment').messengerdotcom?c('MNCommerceAttachmentConstants').MDOTCOMDIALOG.WIDTH:c('MNCommerceAttachmentConstants').DIALOG.WIDTH};},componentDidUpdate:function(){if(this.props.repositionOnUpdate)setTimeout(function(){if(this.isMounted()&&this.refs.dialog&&this.refs.dialog.layer)this.refs.dialog.layer.updatePosition();}.bind(this),0);},render:function(){var k=c('CurrentEnvironment').messengerdotcom,l=k?c('MessengerDialog.react'):c('XUIDialog.react');return (c('React').createElement(l,babelHelpers['extends']({behaviors:{LayerFadeOnHide:c('LayerFadeOnHide'),LayerHideOnEscape:c('LayerHideOnEscape')}},this.props,{className:c('joinClasses')(this.props.className,k?"_3rx0":''),ref:'dialog'}),this.props.children));}});f.exports=j;},null);
__d('MNCommerceDialogBody.react',['CurrentEnvironment','MessengerDialogBody.react','React','XUIDialogBody.react'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'MNCommerceDialogBody',render:function(){var i=c('CurrentEnvironment').messengerdotcom,j=i?c('MessengerDialogBody.react'):c('XUIDialogBody.react');return (c('React').createElement(j,this.props,this.props.children));}});f.exports=h;},null);
__d('MNCommerceDialogTitle.react',['CurrentEnvironment','MessengerDialogHeader.react','React','XUIDialogTitle.react'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'MNCommerceDialogTitle',render:function(){var i=c('CurrentEnvironment').messengerdotcom,j=i?c('MessengerDialogHeader.react'):c('XUIDialogTitle.react');return (c('React').createElement(j,this.props,this.props.children));}});f.exports=h;},null);
__d('MNCommerceDetailsDialog.react',['cx','fbt','React','MNCommerceDialog.react','MNCommerceDialogBody.react','MNCommerceDialogTitle.react','XUISpinner.react','XUIButton.react'],function a(b,c,d,e,f,g,h,i){'use strict';if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k=c('React').createClass({displayName:'MNCommerceDetailsDialog',propTypes:{error:j.object,errorMessage:j.string,loading:j.bool.isRequired,onToggle:j.func,onTryAgain:j.func,title:j.string,shown:j.bool.isRequired},getDefaultProps:function(){return {shown:false};},render:function(){var l=null;if(this.props.loading){l=this._renderLoading();}else if(this.props.error){l=this._renderError();}else l=this.props.children;return (c('React').createElement(c('MNCommerceDialog.react'),{className:this.props.className,modal:true,onToggle:this.props.onToggle,shown:this.props.shown},this._renderTitle(),c('React').createElement(c('MNCommerceDialogBody.react'),{useCustomPadding:true},l)));},_renderTitle:function(){return this.props.title?c('React').createElement(c('MNCommerceDialogTitle.react'),null,this.props.title):null;},_renderError:function(){return (c('React').createElement('div',{className:"_4y9b"},c('React').createElement('p',{className:"_4y9c"},i._("Sorry, Something Went Wrong")),c('React').createElement('p',{className:"_4y9d"},this.props.errorMessage),c('React').createElement(c('XUIButton.react'),{onClick:this.props.onTryAgain,label:i._("Try Again")})));},_renderLoading:function(){return (c('React').createElement('div',{className:"_4y9e"},c('React').createElement(c('XUISpinner.react'),{background:'light',size:'large',paused:false})));}});f.exports=k;},null);
__d('MNCommerceButton.react',['CurrentEnvironment','MessengerDialogButton.react','React','XUIButton.react'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'MNCommerceButton',render:function(){var i=c('CurrentEnvironment').messengerdotcom,j=i?c('MessengerDialogButton.react'):c('XUIButton.react'),k=this.props.type;if(!k)k=this.props.type==='confirm'?'primary':'secondary';var l=i?'default':this.props.use,m=babelHelpers['extends']({},this.props,{type:k,use:l});return (c('React').createElement(j,m,this.props.children));}});f.exports=h;},null);
__d('MNCommercePromotionManageBlockDialog.react',['fbt','CurrentEnvironment','Link.react','MessengerRadioList.react','MNCommerceButton.react','MNCommerceDetailsDialog.react','MNCommerceDialogBody.react','MNCommerceDialogFooter.react','MNCommerceDialogTitle.react','MNCommerceBlockTypeJSInstance','React','XUIRadioList.react'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('MessengerRadioList.react').Item,j=c('XUIRadioList.react').Item,k=c('React').PropTypes,l=c('React').createClass({displayName:'MNCommercePromotionManageBlockDialog',propTypes:{isAllBlocked:k.bool,isPromotionBlocked:k.bool,error:k.object,loading:k.bool.isRequired,merchantName:k.string,onCancelButtonClick:k.func,onConfirmButtonClick:k.func.isRequired,pageID:k.string},getInitialState:function(){return this._calculateState();},componentWillReceiveProps:function(m){this.setState(this._calculateState(m));},_calculateState:function(m){var n=m||this.props,o=c('MNCommerceBlockTypeJSInstance').ALL;if(n.isAllBlocked){o=c('MNCommerceBlockTypeJSInstance').NONE;}else if(n.isPromotionBlocked)o=c('MNCommerceBlockTypeJSInstance').PROMOTION;return {type:o};},onTypeChange:function(m){this.setState({type:m});},render:function(){var m=this.props.merchantName||'',n=h._("Manage messages from {label for merchant name}",[h.param('label for merchant name',m)]),o=h._("Cancel"),p=h._("Confirm"),q=h._("Manage Options couldn't be shown."),r=c('React').createElement(c('Link.react'),{href:'https://www.facebook.com/help/389645087895231',target:'_blank'},h._("Learn More"));return (c('React').createElement(c('MNCommerceDetailsDialog.react'),babelHelpers['extends']({errorMessage:q,onToggle:this.props.onToggle,shown:this.props.shown},this.props),c('React').createElement(c('MNCommerceDialogTitle.react'),{showCloseButton:true},n),c('React').createElement(c('MNCommerceDialogBody.react'),null,this._renderBody()),c('React').createElement(c('MNCommerceDialogFooter.react'),{leftContent:r},c('React').createElement(c('MNCommerceButton.react'),{label:o,onClick:this.props.onCancelButtonClick,use:'default'}),c('React').createElement(c('MNCommerceButton.react'),{label:p,onClick:this._onConfirm,use:'confirm'}))));},_renderBody:function(){var m=c('CurrentEnvironment').messengerdotcom,n=m?c('MessengerRadioList.react'):c('XUIRadioList.react'),o=m?i:j;return (c('React').createElement(n,{selectedValue:this.state.type,onValueChange:this.onTypeChange},c('React').createElement(o,{value:c('MNCommerceBlockTypeJSInstance').ALL},h._("All messages")),c('React').createElement(o,{value:c('MNCommerceBlockTypeJSInstance').PROMOTION},h._("Only updates")),c('React').createElement(o,{value:c('MNCommerceBlockTypeJSInstance').NONE},h._("No Messages"))));},_onConfirm:function(m){var n=this.props;n.onToggle(false);if(!n.onConfirmButtonClick)return;var o=n.pageID;n.onConfirmButtonClick(o,this.state.type);}});f.exports=l;},null);
__d('MNCommerceCacheTimeoutLimits',[],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={SUCCESS_TIMEOUT:10,ERROR_TIMEOUT:1};f.exports=h;},null);
__d("XMNCommercePromotionStateController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/messages\/commerce\/promotion\/state\/",{page_id:{type:"String",required:true}});},null);
__d('MNCommercePromotionStateDataManager',['AsyncRequest','MNCommercePromotionStateActions','XMNCommercePromotionStateController'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();h.prototype.fetchPromotionState=function(i){var j=c('XMNCommercePromotionStateController').getURIBuilder().setString('page_id',i).getURI();new (c('AsyncRequest'))().setURI(j).setHandler(this.$MNCommercePromotionStateDataManager1).setErrorHandler(this.$MNCommercePromotionStateDataManager2).send();};h.prototype.$MNCommercePromotionStateDataManager1=function(i){var j=i.getRequest().uri.getQueryData(),k=j.page_id;i.payload.pageID=k;c('MNCommercePromotionStateActions').stateLoaded(i.payload);};h.prototype.$MNCommercePromotionStateDataManager2=function(i){var j=i.getRequest().uri.getQueryData(),k=j.page_id;c('MNCommercePromotionStateActions').stateLoadError(k);};function h(){}f.exports=new h();},null);
__d('MNCommercePromotionStateStore',['Cache','FluxStore','LoadObject','MessengerDispatcher','MNCommerceActionTypes','MNCommerceCacheTimeoutLimits','MNCommercePromotionStateDataManager'],function a(b,c,d,e,f,g){'use strict';var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('FluxStore'));i=h&&h.prototype;function j(){i.constructor.call(this,c('MessengerDispatcher'));this.$MNCommercePromotionStateStore1=new (c('Cache'))();}j.prototype.__onDispatch=function(k){var l=k.type,m=k.pageID||k.state&&k.state.pageID;switch(l){case c('MNCommerceActionTypes').PROMOTION_STATE.LOADED:var n=k.state;this.$MNCommercePromotionStateStore1.set(m,c('LoadObject').empty().setValue(n),null,c('MNCommerceCacheTimeoutLimits').SUCCESS_TIMEOUT);this.__emitChange();break;case c('MNCommerceActionTypes').PROMOTION_STATE.LOAD_ERROR:this.$MNCommercePromotionStateStore1.set(m,c('LoadObject').empty().setError(new Error('Unable to load permissions for: '+m)),null,c('MNCommerceCacheTimeoutLimits').ERROR_TIMEOUT);this.__emitChange();break;case c('MNCommerceActionTypes').PROMOTION_STATE.RELOAD:if(m){this.$MNCommercePromotionStateStore1.set(m,c('LoadObject').loading());c('MNCommercePromotionStateDataManager').fetchPromotionState(m);}this.__emitChange();break;}};j.prototype.getPromotionState=function(k){if(k&&!this.$MNCommercePromotionStateStore1.has(k)){this.$MNCommercePromotionStateStore1.set(k,c('LoadObject').loading().setValue({pageID:k}));c('MNCommercePromotionStateDataManager').fetchPromotionState(k);}return this.$MNCommercePromotionStateStore1.get(k)||c('LoadObject').empty();};f.exports=new j();},null);
__d('MNCommercePromotionManageBlockDialogContainer.react',['MNCommerceDialogStateActions','MNCommerceDialogStateStore','MNCommercePromotionManageBlockDialog.react','MNCommercePromotionStateActions','MNCommercePromotionStateStore','PureStoreBasedStateMixin','React'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'MNCommercePromotionManageBlockDialogContainer',mixins:[c('PureStoreBasedStateMixin')(c('MNCommercePromotionStateStore'))],statics:{calculateState:function(){var i=c('MNCommerceDialogStateStore').getState(),j=null;if(i)j=i.pageID;var k=c('MNCommercePromotionStateStore').getPromotionState(j);return {shown:!!i,loading:k.isLoading(),onConfirmButtonClick:i&&i.onConfirmButtonClick,pageID:j,promotionState:k.getValue(),error:k.getError()};}},render:function(){var i=this.state.promotionState;return (c('React').createElement(c('MNCommercePromotionManageBlockDialog.react'),{error:this.state.error,isAllBlocked:i&&i.is_all_blocked,isPromotionBlocked:i&&i.is_promotion_blocked,loading:this.state.loading,merchantName:i&&i.name,onCancelButtonClick:this._hideDialog,onToggle:this._onToggle,pageID:this.state.pageID,onTryAgain:this._onTryAgainClick,onConfirmButtonClick:this.state.onConfirmButtonClick,shown:this.state.shown}));},_onToggle:function(i){if(!i)this._hideDialog();},_onTryAgainClick:function(){c('MNCommercePromotionStateActions').stateReload(this.state.pageID);},_hideDialog:function(){c('MNCommerceDialogStateActions').hideDialog();}});f.exports=h;},null);
__d('MessengerMomentsAppSnippet.react',['cx','fbt','ix','Image.react','MercuryShareAttachmentReactShape','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MessengerMomentsAppSnippet',propTypes:{attachment:c('MercuryShareAttachmentReactShape')},render:function(){var m=this.props.attachment;if(!m||!m.target)return null;return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/messaging/docs/generic.png')}),m.target.snippet));}});f.exports=l;},null);
__d('MercuryThreadMuter',['AsyncDialog','AsyncRequest','DOM','MercuryThreadInfo'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={showMuteChangeDialog:function(i,j){c('AsyncDialog').send(new (c('AsyncRequest'))('/ajax/mercury/mute_thread_dialog.php').setRelativeTo(j),function(k){k.subscribe('confirm',function(){this.hide();var l;c('DOM').scry(this.getRoot(),'input[type="radio"]').forEach(function(m){if(m.checked)l=m.value;});l=h.convertRawMuteSetting(l);e(['MercuryThreadActions'],function(m){m.get().updateMuteSetting(i,l);});}.bind(k));});},convertRawMuteSetting:function(i){switch(i){case 'always':return -1;case '30minutes':return 1800;case '1hour':return 3600;case '8hours':return 8*3600;case '24hours':return 24*3600;case '8am':var j,k=new Date(),l=new Date();l.setHours(8);l.setMinutes(0);l.setSeconds(0);if(l>k){j=l-k;}else j=l-k+24*3600*1000;return j/1000;default:return 0;}}};f.exports=h;},null);
__d('FBRTCVideoCallButtonManagerImpl',['invariant','BanzaiLogger','CurrentUser','FBRTCCallabilityStore','FBRTCCore','FBRTCLogger','MercuryIDs','MercuryParticipants','Tooltip'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i={onCallClicked:function(j,k){if(k===c('FBRTCLogger').Trigger.WEB_MESSENGER)c('BanzaiLogger').log('VideoCallLoggerConfig',{event:'web_messenger_call_click'});var l=c('MercuryIDs').getUserIDFromThreadID(j);!l?h(0):void 0;c('FBRTCCore').startOutgoingCall(l,k,false);},isVideoCallableThread:function(j){if(j){var k=c('MercuryIDs').getUserIDFromThreadID(j);if(k&&k!==c('CurrentUser').getID())return true;}return false;},updateVideoCallButton:function(j,k){if(!k||!i.isVideoCallableThread(k))return;var l=c('MercuryIDs').getUserIDFromThreadID(k);!l?h(0):void 0;j.disabled=!c('FBRTCCallabilityStore').isCallable(l);c('MercuryParticipants').get(c('MercuryIDs').getParticipantIDFromUserID(l),function(m){c('Tooltip').set(j,c('FBRTCCallabilityStore').callButtonTooltip(l,m.short_name));});}};f.exports=i;},null);
__d('MercuryDrafts',['CacheStorage','MercurySingletonProvider','isEmpty'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();h.getForFBID=function(j){'use strict';return i.getForFBID(j);};h.get=function(){'use strict';return i.get();};function h(j){'use strict';this.$MercuryDrafts1=j;this.$MercuryDrafts2=new (c('CacheStorage'))('localstorage','mercury-drafts:'+this.$MercuryDrafts1);}h.prototype.saveDraft=function(j,k){'use strict';if(this.isMessageEmpty(k)){this.removeDraft(j);}else this.$MercuryDrafts2.set(j,this.$MercuryDrafts3(j,k));};h.prototype.removeDraft=function(j){'use strict';this.$MercuryDrafts2.remove(j);};h.prototype.getDraft=function(j){'use strict';var k=this.$MercuryDrafts2.get(j,{});return k.message;};h.prototype.isMessageEmpty=function(j){'use strict';return c('isEmpty')(j)||c('isEmpty')(j.body)&&c('isEmpty')(j.content_attachment)&&c('isEmpty')(j.raw_attachments)&&c('isEmpty')(j.photo_fbids)&&c('isEmpty')(j.image_ids);};h.prototype.$MercuryDrafts3=function(j,k){'use strict';return {thread_id:j,message:k};};var i=new (c('MercurySingletonProvider'))(h);f.exports=h;},null);
__d('MercuryDraftsController',['MercuryDrafts','Input','MercurySingletonProvider','isEmpty'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryDrafts').get();i.getForFBID=function(k){'use strict';return j.getForFBID(k);};i.get=function(){'use strict';return j.get();};function i(k){'use strict';this.$MercuryDraftsController1;}i.prototype.clearDraft=function(k){'use strict';if(this.canSaveDrafts(k))h.removeDraft(k);};i.prototype.saveDraft=function(k,l,m,n,o){'use strict';if(!this.canSaveDrafts(k))return;var p={body:c('Input').getValue(l)};if(m&&!c('isEmpty')(m.getAttachments())){p.has_attachment=true;p.raw_attachments=m.getAttachments();}if(m&&!c('isEmpty')(m.getImageFiles())){p.has_attachment=true;p.image_ids=m.getImageFiles();}if(o&&!c('isEmpty')(o.getSelectedFBIDs())){p.has_attachment=true;p.photo_fbids=o.getSelectedFBIDs();}if(n.getAttachData()){p.has_attachment=true;p.content_attachment=n.getAttachData();}h.saveDraft(k,p);};i.prototype.loadDraft=function(k,l,m,n,o){'use strict';if(!this.canSaveDrafts(k)||this.$MercuryDraftsController2(l,m,n,o))return;var p=h.getDraft(k);if(!c('isEmpty')(p)){if(p.body){l.focus();c('Input').setValue(l,p.body);}if(m&&!c('isEmpty')(p.raw_attachments))m.addCachedAttachments(p.raw_attachments);if(m&&!c('isEmpty')(p.image_ids))m.addCachedImageFiles(p.image_ids);if(!c('isEmpty')(p.content_attachment))n.loadShare(p.content_attachment.attachment.params.url);if(o&&!c('isEmpty')(p.photo_fbids))o.addCachedPhotos(p.photo_fbids);this.clearDraft(k);}};i.prototype.canSaveDrafts=function(k){'use strict';return !!k;};i.prototype.$MercuryDraftsController2=function(k,l,m,n){'use strict';return !c('Input').isEmpty(k)||l&&!c('isEmpty')(l.getAttachments())||l&&!c('isEmpty')(l.getImageFiles())||n&&!c('isEmpty')(n.getSelectedFBIDs())||m.getAttachData();};i.prototype.toString=function(){'use strict';return '[object MercuryDraftsController:'+this.$MercuryDraftsController1+']';};var j=new (c('MercurySingletonProvider'))(i);f.exports=i;},null);
__d('MercuryAnimatedShareSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryAnimatedShareSnippet',propTypes:{isViewerSender:k.bool,senderName:k.string},render:function(){var m=this.props.isViewerSender?i._("You sent a GIF."):i._("{sender name} sent a GIF.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/icons/photo.gif')}),m));}});f.exports=l;},null);
__d('MercuryFallbackShareAttachmentSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryFallbackShareAttachmentSnippet',propTypes:{isViewerSender:k.bool,senderName:k.string},render:function(){var m;if(this.props.isViewerSender){m=i._("You shared a link.");}else m=i._("{sender name} shared a link.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/messaging/docs/generic.png')}),m));}});f.exports=l;},null);
__d('MercuryMessageLocationShareAttachmentSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryMessageLocationShareAttachmentSnippet',propTypes:{isViewerSender:k.bool,senderName:k.string},render:function(){var m;if(this.props.isViewerSender){m=i._("You sent a location.");}else m=i._("{sender name} sent a location.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/messaging/location/location.png')}),m));}});f.exports=l;},null);
__d('MercuryPhotoShareSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryPhotoShareSnippet',propTypes:{isViewerSender:k.bool,senderName:k.string},render:function(){var m=this.props.isViewerSender?i._("You sent a photo."):i._("{sender name} sent a photo.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/icons/photo.gif')}),m));}});f.exports=l;},null);
__d('MercuryProductItemShareSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryProductItemShareSnippet',propTypes:{isViewerSender:k.bool,senderName:k.string},render:function(){var m=this.props.isViewerSender?i._("You sent a for sale item."):i._("{sender name} sent a for sale item.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/messaging/docs/generic.png')}),m));}});f.exports=l;},null);
__d('MercuryPromotionShareAttachmentSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryPromotionShareAttachmentSnippet',propTypes:{senderName:k.string,attachment:k.object},render:function(){var m=this.props.attachment,n=m&&m.target,o=n&&n.message||i._("{sender name} sent an attachment.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/messaging/docs/generic.png')}),o));}});f.exports=l;},null);
__d('MercuryTransactionInvoiceShareSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';var k,l;if(c.__markCompiled)c.__markCompiled();var m=c('React').PropTypes;k=babelHelpers.inherits(n,c('React').Component);l=k&&k.prototype;n.prototype.render=function(){var o=this.props.isViewerSender?i._("You sent an invoice"):i._("Page {sender name} sent you an invoice.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/messaging/docs/generic.png')}),o));};function n(){k.apply(this,arguments);}n.propTypes={isViewerSender:m.bool,senderName:m.string};f.exports=n;},null);
__d('MercuryVideoShareSnippet.react',['cx','fbt','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryVideoShareSnippet',propTypes:{isViewerSender:k.bool,senderName:k.string},render:function(){var m=this.props.isViewerSender?i._("You sent a video."):i._("{sender name} sent a video.",[i.param('sender name',this.props.senderName)]);return (c('React').createElement('span',{className:"uiIconText _3l6h"},c('React').createElement(c('Image.react'),{src:j('/images/icons/video.gif')}),m));}});f.exports=l;},null);
__d('P2PMercuryAttachmentSnippetRendererBase.react',['cx','ix','Image.react','React'],function a(b,c,d,e,f,g,h,i){'use strict';if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k=c('React').createClass({displayName:'P2PMercuryAttachmentSnippetRendererBase',propTypes:{text:j.node},render:function(){return (c('React').createElement('span',{className:"uiIconText _3l6h _3_io"},c('React').createElement(c('Image.react'),{height:12,src:i('/images/p2p/attachment-snippet-icon.png'),width:12}),this.props.text));}});f.exports=k;},null);
__d('P2PMercuryAttachmentSnippet.react',['CurrentUser','MercuryAttachmentSnippetRenderer','P2PMercuryAttachmentSnippetRendererBase.react','React'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'P2PMercuryAttachmentSnippet',propTypes:{amount:h.string,amountWithSymbol:h.string,currency:h.string,groupThreadFBID:h.string,receiver:h.object,sender:h.object},getDefaultProps:function(){return {sender:{},receiver:{}};},render:function(){var j=c('MercuryAttachmentSnippetRenderer').renderP2PPaymentSnippetText(c('CurrentUser').getID()===this.props.sender.id,this.props.sender.name,this.props.amountWithSymbol,this.props.status,c('CurrentUser').getID()===this.props.receiver.id,this.props.receiver.name);return (c('React').createElement(c('P2PMercuryAttachmentSnippetRendererBase.react'),{text:j}));}});f.exports=i;},null);
__d('P2PMercuryShareAttachmentSnippet.react',['MercuryShareAttachmentReactShape','P2PMercuryAttachmentSnippet.react','React'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'P2PMercuryShareAttachmentSnippet',propTypes:{attachment:c('MercuryShareAttachmentReactShape')},render:function(){var i=this.props.attachment?this.props.attachment.target:{};return (c('React').createElement(c('P2PMercuryAttachmentSnippet.react'),i));}});f.exports=h;},null);
__d('P2PPaymentRequestMercuryAttachmentSnippet.react',['CurrentUser','MercuryAttachmentSnippetRenderer','P2PMercuryAttachmentSnippetRendererBase.react','React'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'P2PPaymentRequestMercuryAttachmentSnippet',propTypes:{formattedAmount:h.string.isRequired,requestee:h.object.isRequired,requester:h.object.isRequired,status:h.number.isRequired},render:function(){var j=c('MercuryAttachmentSnippetRenderer').renderP2PPaymentRequestSnippetText(c('CurrentUser').getID()===this.props.requester.id,this.props.requester.name,this.props.formattedAmount,this.props.status,c('CurrentUser').getID()===this.props.requestee.id,this.props.requestee.name);return (c('React').createElement(c('P2PMercuryAttachmentSnippetRendererBase.react'),{text:j}));}});f.exports=i;},null);
__d('P2PPaymentRequestMercuryShareAttachmentSnippet.react',['MercuryShareAttachmentReactShape','P2PPaymentRequestMercuryAttachmentSnippet.react','React'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'P2PPaymentRequestMercuryShareAttachmentSnippet',propTypes:{attachment:c('MercuryShareAttachmentReactShape')},render:function(){var i=this.props.attachment?this.props.attachment.target:{};return (c('React').createElement(c('P2PPaymentRequestMercuryAttachmentSnippet.react'),{formattedAmount:i.amountWithSymbol,requestee:i.requestee,requester:i.requester,status:i.currentStatus}));}});f.exports=h;},null);
__d('MercuryShareStyleMap',['cx','JSResource','Map','MercuryConfig','MercuryShareAttachmentRenderLocations','StoryAttachmentStyle','emptyFunction','MercuryFallbackShareAttachmentSnippet.react','P2PMercuryShareAttachmentSnippet.react','P2PPaymentRequestMercuryShareAttachmentSnippet.react','MercuryPromotionShareAttachmentSnippet.react','MessengerMomentsAppSnippet.react','MercuryPhotoShareSnippet.react','MercuryVideoShareSnippet.react','MercuryMessageLocationShareAttachmentSnippet.react','MercuryAnimatedShareSnippet.react','MercuryProductItemShareSnippet.react','MercuryTransactionInvoiceShareSnippet.react'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=new (c('Map'))();i.set(c('StoryAttachmentStyle').FALLBACK,{componentName:'MercuryFallbackShareAttachment.react',componentLoader:c('JSResource')('MercuryFallbackShareAttachment.react'),getSnippetComponent:function(){return c('MercuryFallbackShareAttachmentSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]])});i.set(c('StoryAttachmentStyle').EVENT,{componentName:'MercuryEventShareAttachment.react',componentLoader:c('JSResource')('MercuryEventShareAttachment.react'),getSnippetComponent:function(){return c('MercuryFallbackShareAttachmentSnippet.react');}});i.set(c('StoryAttachmentStyle').ORION,{componentName:'P2PMercuryShareAttachmentContainer.react',componentLoader:c('JSResource')('P2PMercuryShareAttachmentContainer.react'),getSnippetComponent:function(){return c('P2PMercuryShareAttachmentSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _3-50"]])});i.set(c('StoryAttachmentStyle').ORION_REQUEST,{componentName:'P2PPaymentRequestMercuryShareAttachmentContainer.react',componentLoader:c('JSResource')('P2PPaymentRequestMercuryShareAttachmentContainer.react'),getSnippetComponent:function(){return c('P2PPaymentRequestMercuryShareAttachmentSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _3-50"]])});if(c('MercuryConfig').WWWMessengerCommerceGK){i.set(c('StoryAttachmentStyle').RETAIL_RECEIPT,{componentName:'MNCommerceReceiptMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommerceReceiptMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});i.set(c('StoryAttachmentStyle').RETAIL_CANCELLATION,{componentName:'MNCommerceCancelationMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommerceCancelationMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});i.set(c('StoryAttachmentStyle').RETAIL_SHIPMENT,{componentName:'MNCommerceShippingMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommerceShippingMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});i.set(c('StoryAttachmentStyle').RETAIL_SHIPMENT_TRACKING_EVENT,{componentName:'MNCommerceShippingMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommerceShippingMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});i.set(c('StoryAttachmentStyle').RETAIL_NOW_IN_STOCK,{componentName:'MNCommerceProductSubscriptionMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommerceProductSubscriptionMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});i.set(c('StoryAttachmentStyle').RETAIL_PROMOTION,{componentName:'MNCommercePromotionMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommercePromotionMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _1qml"]])});i.set(c('StoryAttachmentStyle').RETAIL_ITEM,{componentName:'MNCommercePromotionMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommercePromotionMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _1qml"]])});i.set(c('StoryAttachmentStyle').BUSINESS_MESSAGE_ITEMS,{componentName:'MNCommercePromotionMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommercePromotionMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _1qml"]])});i.set(c('StoryAttachmentStyle').H_SCROLL,{componentName:'MNCommerceHScrollMessageAttachment.react',componentLoader:c('JSResource')('MNCommerceHScrollMessageAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _8ka"]])});}if(c('MercuryConfig').WWWMessengerTransportationGK){i.set(c('StoryAttachmentStyle').RIDE_ORDERED,{componentName:'MNTransportationRideConfirmationMercuryAttachment.react',componentLoader:c('JSResource')('MNTransportationRideConfirmationMercuryAttachment.react'),getSnippetComponent:function(){return c('MercuryPromotionShareAttachmentSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});i.set(c('StoryAttachmentStyle').RIDE_RECEIPT,{componentName:'MNTransportationRideReceiptMercuryAttachment.react',componentLoader:c('JSResource')('MNTransportationRideReceiptMercuryAttachment.react'),getSnippetComponent:function(){return c('MercuryPromotionShareAttachmentSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});}if(c('MercuryConfig').WWWMessengerAirlinesGK){i.set(c('StoryAttachmentStyle').AIRLINE_UPDATE,{componentName:'MNAirlineUpdateMercuryAttachment.react',componentLoader:c('JSResource')('MNAirlineUpdateMercuryAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _8kb"]])});i.set(c('StoryAttachmentStyle').AIRLINE_ITINERARY,{componentName:'MNAirlineItineraryMercuryAttachment.react',componentLoader:c('JSResource')('MNAirlineItineraryMercuryAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _8kb"]])});i.set(c('StoryAttachmentStyle').AIRLINE_CHECKIN_REMINDER,{componentName:'MNAirlineCheckInMercuryAttachment.react',componentLoader:c('JSResource')('MNAirlineCheckInMercuryAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _8kb"]])});i.set(c('StoryAttachmentStyle').AIRLINE_BOARDING_PASS,{componentName:'MNAirlineBoardingPassMercuryAttachment.react',componentLoader:c('JSResource')('MNAirlineBoardingPassMercuryAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d _8kb"]])});}if(c('MercuryConfig').WWWMessengerMoneyPennyGK)i.set(c('StoryAttachmentStyle').RETAIL_AGENT_ITEM_SUGGESTION,{componentName:'MNCommerceAgentItemSuggestionMercuryShareAttachment.react',componentLoader:c('JSResource')('MNCommerceAgentItemSuggestionMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});if(c('MercuryConfig').MomentsMessengerWWWGK){var j={componentName:'MessengerMomentsAppShareAttachment.react',componentLoader:c('JSResource')('MessengerMomentsAppShareAttachment.react'),getSnippetComponent:function(){return c('MessengerMomentsAppSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]])};i.set(c('StoryAttachmentStyle').MOMENTS_APP_INVITATION,j);i.set(c('StoryAttachmentStyle').MOMENTS_APP_PHOTO_REQUEST,j);}if(c('MercuryConfig').MercuryGenieRendering)i.set(c('StoryAttachmentStyle').GENIE_MESSAGE,{componentName:'GenieMessageShareAttachment.react',componentLoader:c('JSResource')('GenieMessageShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_2wrf"]]),getSnippetComponent:function(){return c('MercuryFallbackShareAttachmentSnippet.react');}});i.set(c('StoryAttachmentStyle').MOVIE_BOT_MOVIE_LIST,{componentName:'MovieBotMovieListShareAttachment.react',componentLoader:c('JSResource')('MovieBotMovieListShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]])});i.set(c('StoryAttachmentStyle').MOVIE_BOT_MOVIE_SHOWTIME_LIST,{componentName:'MovieBotMovieShowtimeListShareAttachment.react',componentLoader:c('JSResource')('MovieBotMovieShowtimeListShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]])});i.set(c('StoryAttachmentStyle').SHARE_LARGE_IMAGE,{componentName:'MercuryShareLargeImageAttachment.react',componentLoader:c('JSResource')('MercuryShareLargeImageAttachment.react'),getSnippetComponent:function(){return c('MercuryPhotoShareSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]]),unwrapInStory:c('emptyFunction').thatReturnsTrue});i.set(c('StoryAttachmentStyle').IMAGE_SHARE,{componentName:'MercuryImageShareAttachment.react',componentLoader:c('JSResource')('MercuryImageShareAttachment.react'),getSnippetComponent:function(){return c('MercuryPhotoShareSnippet.react');},cx:null,unwrapInStory:c('emptyFunction').thatReturnsTrue});i.set(c('StoryAttachmentStyle').VIDEO,{componentName:'MercuryVideoShareAttachment.react',componentLoader:c('JSResource')('MercuryVideoShareAttachment.react'),getSnippetComponent:function(){return c('MercuryVideoShareSnippet.react');},cx:null,unwrapInStory:c('emptyFunction').thatReturnsTrue});i.set(c('StoryAttachmentStyle').MESSAGE_LOCATION,{componentName:'MercuryMessageLocationShareAttachment.react',componentLoader:c('JSResource')('MercuryMessageLocationShareAttachment.react'),getSnippetComponent:function(){return c('MercuryMessageLocationShareAttachmentSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]])});i.set(c('StoryAttachmentStyle').ANIMATED_IMAGE_SHARE,{componentName:'MercuryAnimatedShareAttachment.react',componentLoader:c('JSResource')('MercuryAnimatedShareAttachment.react'),getSnippetComponent:function(){return c('MercuryAnimatedShareSnippet.react');},cx:null,unwrapInStory:c('emptyFunction').thatReturnsFalse});i.set(c('StoryAttachmentStyle').GROUP_SELL_PRODUCT_ITEM,{componentName:'MercuryProductItemShareAttachment.react',componentLoader:c('JSResource')('MercuryProductItemShareAttachment.react'),getSnippetComponent:function(){return c('MercuryProductItemShareSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]]),unwrapInStory:c('emptyFunction').thatReturnsTrue});i.set(c('StoryAttachmentStyle').TRANSACTION_INVOICE,{componentName:'MercuryTransactionInvoiceShareAttachment.react',componentLoader:c('JSResource')('MercuryTransactionInvoiceShareAttachment.react'),getSnippetComponent:function(){return c('MercuryTransactionInvoiceShareSnippet.react');},cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]]),unwrapInStory:c('emptyFunction').thatReturnsTrue});i.set(c('StoryAttachmentStyle').FINANCIAL_BILL_PAYMENT_REQUEST,{componentName:'MNBillPaymentRequestMercuryShareAttachment.react',componentLoader:c('JSResource')('MNBillPaymentRequestMercuryShareAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d _205d"]])});i.set(c('StoryAttachmentStyle').MUSIC_AGGREGATION,{componentName:'MercuryMusicAttachment.react',componentLoader:c('JSResource')('MercuryMusicAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]])});i.set(c('StoryAttachmentStyle').VIDEO_SHARE_YOUTUBE,{componentName:'MercuryVideoShareYoutubeAttachment.react',componentLoader:c('JSResource')('MercuryVideoShareYoutubeAttachment.react'),cx:new (c('Map'))([[c('MercuryShareAttachmentRenderLocations').MESSENGER,"_5i_d"]])});i.set(c('StoryAttachmentStyle').RTC_CALL_LOG,{componentName:'MercuryRTCShareAttachment.react',componentLoader:c('JSResource')('MercuryRTCShareAttachment.react')});var k={getStyleFactory:function(l){if(!l||!l.style_list)return null;if(l.style_list[0]===c('StoryAttachmentStyle').ATTACHED_STORY){var m=l.subattachments,n=m&&m.length?m[0].style_list:[],o=this._getStyleMapEntry(n);if(o&&o.unwrapInStory&&o.unwrapInStory())return {attachment:m[0],factory:o};}var p=this._getStyleMapEntry(l.style_list);if(!p)return null;return {attachment:l,factory:p};},_getStyleMapEntry:function(l){for(var m=0;m<l.length;m++){var n=i.get(l[m]);if(n)return n;}return null;}};f.exports=k;},null);
__d('MercuryShareAttachmentSnippet.react',['MercuryShareAttachmentReactShape','MercuryShareStyleMap','React'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'MercuryShareAttachmentSnippet',propTypes:{attachment:c('MercuryShareAttachmentReactShape'),isSenderViewer:h.bool,senderName:h.string},render:function(){var j=c('MercuryShareStyleMap').getStyleFactory(this.props.attachment);if(j.factory&&!!j.factory.getSnippetComponent){var k=j.factory.getSnippetComponent();return (c('React').createElement(k,babelHelpers['extends']({},this.props,{attachment:j.attachment})));}return null;}});f.exports=i;},null);
__d('MercuryAttachmentSnippet.react',['cx','ix','fbt','EmoticonsList','Image.react','MercuryAttachment','MercuryAttachmentSnippetRenderer','MercuryAttachmentSnippetType','MercuryAttachmentType','MercuryConfig','MercuryIDs','MercuryShareAttachmentSnippet.react','MercuryParticipants','React','StickerConstants','TextWithEmoticons.react','joinClasses'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'MercuryAttachmentSnippet',propTypes:{thread:k.object.isRequired,viewer:k.string.isRequired},componentWillMount:function(){this._ensureParticipant(this.props.thread.snippet_sender);this._setVariables(this.props);},componentWillReceiveProps:function(o){this._ensureParticipant(o.thread.snippet_sender);this._setVariables(o);},componentWillUnmount:function(){this._cancelParticipantFetch();},render:function(){var o=this._getSenderName(),p=c('MercuryAttachmentSnippetRenderer').getAttachmentSnippetType(this._attachments);switch(p){case c('MercuryAttachmentSnippetType').PHOTO:return this._renderPhotoSnippet(o);case c('MercuryAttachmentSnippetType').GIF:return this._renderAnimatedImageSnippet(o);case c('MercuryAttachmentSnippetType').VIDEO:return this._renderVideoSnippet(o);case c('MercuryAttachmentSnippetType').AUDIO_CLIP:return this._renderAudioClipSnippet(o);case c('MercuryAttachmentSnippetType').STICKER:return this._renderStickerSnippet(o);case c('MercuryAttachmentSnippetType').SHARE:return this._renderShareSnippet(o);case c('MercuryAttachmentSnippetType').GIFT:return this._renderGiftSnippet(o);case c('MercuryAttachmentSnippetType').ERROR:return this._renderError(o);case c('MercuryAttachmentSnippetType').THIRDPARTYSTICKER:return this._renderThirdPartyStickerSnippet(o);default:return this._renderMixedSnippet(o);}},_renderPhotoSnippet:function(o){return this._renderSnippet(c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').PHOTO,this._isViewerSender,o,this._attachments));},_renderAnimatedImageSnippet:function(o){return this._renderSnippet(c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').GIF,this._isViewerSender,o,this._attachments));},_renderVideoSnippet:function(o){return this._renderSnippet(c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').VIDEO,this._isViewerSender,o));},_renderAudioClipSnippet:function(o){return this._renderSnippet(c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').AUDIO_CLIP,this._isViewerSender,o));},_renderThirdPartyStickerSnippet:function(o){return (c('React').createElement('span',null,c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').THIRDPARTYSTICKER,this._isViewerSender,o)));},_renderStickerSnippet:function(o){if(m(this._attachments[0].metadata.stickerID)){var p=c('React').createElement(c('TextWithEmoticons.react'),{renderEmoticons:true,text:c('EmoticonsList').symbols.like});if(this._isViewerSender){return (c('React').createElement('span',null,j._("You: {conversation_snippet}",[j.param('conversation_snippet',p)])));}else return (c('React').createElement('span',null,j._("{sender name}: {conversation_snippet}",[j.param('sender name',o),j.param('conversation_snippet',p)])));}else return (c('React').createElement('span',null,c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').STICKER,this._isViewerSender,o)));},_renderShareSnippet:function(o){if(!!this._attachments[0].share)return (c('React').createElement(c('MercuryShareAttachmentSnippet.react'),{attachment:this._attachments[0].share,senderName:o,isViewerSender:this._isViewerSender}));return this._renderSnippet(c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').SHARE,this._isViewerSender,o));},_renderGiftSnippet:function(o){return (c('React').createElement('span',null,c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').GIFT,this._isViewerSender,o)));},_renderMixedSnippet:function(o){return (c('React').createElement('span',null,this._attachments.filter(function(p){return (p.attach_type===c('MercuryAttachmentType').FILE||p.attach_type===c('MercuryAttachmentType').PHOTO||p.attach_type===c('MercuryAttachmentType').VIDEO);}).map(function(p,q){return this._renderSnippet(p.name,p.icon_type,q);}.bind(this))));},_renderSnippet:function(o,p,q){var r=c('MercuryAttachment').getAttachIconClass(p||this._attachments[0].icon_type),s=c('joinClasses')(r,"uiIconText _3l6h");return (c('React').createElement('span',{className:s,key:q},c('React').createElement(c('Image.react'),{src:i('/images/messaging/docs/generic.png')}),o));},_renderError:function(o){var p=c('MercuryAttachmentSnippetRenderer').renderAttachmentSnippetText(c('MercuryAttachmentSnippetType').ERROR,this._isViewerSender,o);return this._renderSnippet(p);},_setVariables:function(o){this._viewer=o.viewer;this._sender=o.thread.snippet_sender;this._attachments=o.thread.snippet_attachments;this._isViewerSender=n(this._sender,this._viewer);},_getSenderName:function(){if(!this._sender||this._isViewerSender)return null;var o=c('MercuryParticipants').getNow(this._sender);if(!o)return null;var p=c('MercuryIDs').getUserIDFromParticipantID(this._sender),q=this.props.thread.custom_nickname&&this.props.thread.custom_nickname[p];if(q&&c('MercuryConfig').MessengerNewEmojiGK&&c('MercuryConfig').MessengerTextWithEmoticonsModule){var r=c('MercuryConfig').MessengerTextWithEmoticonsModule;q=c('React').createElement(r,{renderEmoticons:true,renderEmoji:true,text:q});}return q?q:o.short_name;},_ensureParticipant:function(o){if(!o)return;this._cancelParticipantFetch();if(!c('MercuryParticipants').getNow(o))this._sub=c('MercuryParticipants').get(o,function(p){return this.forceUpdate();}.bind(this));},_cancelParticipantFetch:function(){this._sub&&this._sub.remove();}});function m(o){return (o==c('StickerConstants').LIKE_STICKER_ID||o==c('StickerConstants').HOT_LIKE_SMALL_STICKER_ID||o==c('StickerConstants').HOT_LIKE_MEDIUM_STICKER_ID||o==c('StickerConstants').HOT_LIKE_LARGE_STICKER_ID);}function n(o,p){return !!(o&&c('MercuryIDs').getParticipantIDFromUserID(p)==o);}f.exports=l;},null);
__d('EmojiSticker.react',['cx','Image.react','React','joinClasses'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'EmojiSticker',propTypes:{emoji:i.string,emojiImage:i.any,sourceURI:i.string.isRequired},render:function(){var k=this.props.emojiImage?this.props.emojiImage:c('React').createElement(c('Image.react'),{src:this.props.sourceURI});return (c('React').createElement('div',{'aria-label':this.props.emoji,className:c('joinClasses')(this.props.className,"_383m"),tabIndex:'0'},k));}});f.exports=j;},null);
__d('MercuryShareAttachment.react',['cx','BootloadedComponent.react','DOM','Event','MercuryShareAttachmentReactShape','MercuryShareAttachmentRenderLocations','MercuryShareStyleMap','React','ReactDOM','StoryAttachmentStyle','emptyFunction','joinClasses'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'MercuryShareAttachment',propTypes:{attachment:c('MercuryShareAttachmentReactShape'),isSponsored:i.bool,location:i.oneOf(c('MercuryShareAttachmentRenderLocations').getValues()),messageID:i.string,onComponentLoaded:i.func.isRequired,pageID:i.string,thread_id:i.string.isRequired},getDefaultProps:function(){return {onComponentLoaded:c('emptyFunction')};},componentDidMount:function(){this._handleComponentLoad();},_renderComponent:function(k,l){if(this.props.location===c('MercuryShareAttachmentRenderLocations').MESSENGER)l=c('joinClasses')("_52mr _2poz _ui9",l);return l?c('React').createElement('div',{className:l},k):k;},render:function(){var k=c('MercuryShareStyleMap').getStyleFactory(this.props.attachment);if(!k)return null;var l=k.attachment,m=k.factory;return (this._renderComponent(c('React').createElement(c('BootloadedComponent.react'),babelHelpers['extends']({},this.props,{attachment:l,bootloadLoader:m.componentLoader,bootloadPlaceholder:c('React').createElement('div',null),module:m.componentName,onComponentLoad:this._onComponentLoad})),m.cx&&m.cx.get(this.props.location)));},_onComponentLoad:function(){this._handleComponentLoad();c('DOM').scry(c('ReactDOM').findDOMNode(this),'img').forEach(function(k){var l=c('Event').listen(k,'load',function(){this._handleComponentLoad();l.remove();}.bind(this));}.bind(this));},_handleComponentLoad:function(){var k=c('ReactDOM').findDOMNode(this).children,l=0;for(var m=0;m<k.length;m++)l+=k[m].offsetHeight;this.props.onComponentLoaded(l);}});f.exports=j;},null);
__d('Sticker.react',['cx','fbt','Arbiter','Image.react','MessengerHotLikeSVG.react','React','ReactDOM','StickerConfig','StickerConstants','emptyFunction','getElementPosition','getObjectValues','joinClasses'],function a(b,c,d,e,f,g,h,i){'use strict';if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k=83,l=5000,m=10,n={CLICK:'click',HOVER:'hover',LOAD_AND_HOVER:'load_and_hover'},o=c('React').createClass({displayName:'Sticker',propTypes:{accessibilityLabel:j.string,animationTrigger:j.oneOf(c('getObjectValues')(n)),forceCursorPointer:j.bool,frameCount:j.number.isRequired,frameRate:j.number,framesPerCol:j.number.isRequired,framesPerRow:j.number.isRequired,onAttachmentLoad:j.func,onStickerClick:j.func,packID:j.string,packName:j.string,sourceURI:j.string.isRequired,sourceWidth:j.number.isRequired,sourceHeight:j.number.isRequired,spriteURI:j.string,stickerID:j.string,subscribedThreadID:j.string,testID:j.string},getInitialState:function(){return {index:0,hasAnimated:false,unsubscribeID:null};},getDefaultProps:function(){return {accessibilityLabel:'',forceCursorPointer:false,frameRate:k,onStickerClick:c('emptyFunction'),packID:null,packName:''};},componentDidMount:function(){this.props.onAttachmentLoad&&this.props.onAttachmentLoad(this.getHeight());this._stopIntervalID=0;if(this.props.animationTrigger===n.LOAD_AND_HOVER&&this.props.frameCount>1&&this.props.spriteURI)this.startAnimation();if(this.props.subscribedThreadID&&this.props.frameCount>1){var p=c('Arbiter').subscribe(this.props.subscribedThreadID,function(q,r){this.isScrolledIntoView(r.scrollTop,r.viewHeight,r.top);}.bind(this));this.setState({unsubscribeID:p});}},componentWillUnmount:function(){if(this.state.unsubscribeID)c('Arbiter').unsubscribe(this.state.unsubscribeID);if(this.isAnimating())clearInterval(this._stopIntervalID);},isAnimating:function(){return !!this._stopIntervalID;},getWidth:function(){return Math.floor(this.props.sourceWidth);},getHeight:function(){return Math.floor(this.props.sourceHeight);},preloadSprite:function(){var p=new window.Image();p.onload=function(){if(this.isMounted()&&!this.state.hasAnimated){this.setState({hasAnimated:true});this._stopIntervalID=setInterval(this.incrementFrameIndex,this.props.frameRate);}}.bind(this);if(c('StickerConfig').ChatPaddedAnimatedStickerGK&&this.props.paddedSpriteURI){p.src=this.props.paddedSpriteURI;}else p.src=this.props.spriteURI;},isScrolledIntoView:function(p,q,r){var s=c('getElementPosition')(c('ReactDOM').findDOMNode(this)),t=p+s.y-r,u=p+q,v=t+s.height;if(this.props.frameCount>1&&!this.state.hasAnimated&&v-m<=u&&t+m>=p)this.startAnimation();},startAnimation:function(){if(!this.state.hasAnimated&&this.props.spriteURI){this.preloadSprite();}else if(!this.isAnimating()){this.setState({hasAnimated:true});this._stopIntervalID=setInterval(this.incrementFrameIndex,this.props.frameRate);}},stopAnimation:function(){this.setState({index:0});clearInterval(this._stopIntervalID);this._stopIntervalID=0;},toggleAnimation:function(){if(this.isAnimating()){this.stopAnimation();}else this.startAnimation();},shouldStopAnimating:function(){var p=this.state.index%this.props.frameCount;if(!(p===0&&this.state.index*this.props.frameRate>l))return false;if(this.props.animationTrigger===n.CLICK)return true;return !this.state.isHovered;},incrementFrameIndex:function(){if(this.shouldStopAnimating()){this.stopAnimation();}else this.setState({index:this.state.index+1});},getStyle:function(){var p=0,q=this.props.spriteURI;if(c('StickerConfig').ChatPaddedAnimatedStickerGK&&this.props.paddedSpriteURI){q=this.props.paddedSpriteURI;var r=240/Math.min(this.getHeight(),this.getWidth());p=Math.floor(c('StickerConstants').SPRITE_PADDING/r);}var s=this.state.index%this.props.frameCount,t=s%this.props.framesPerRow*(this.getWidth()+p*2)+p,u=Math.floor(s/this.props.framesPerRow)*(this.getHeight()+p*2)+p,v=this.props.frameCount>1&&this.props.animationTrigger===n.CLICK||this._isStickerClickable(this.props.packID),w=this.props.forceCursorPointer||v?'pointer':'default';if(!this.state.hasAnimated||!this.props.spriteURI){return {backgroundImage:this._isHotLike()?null:'url('+this.props.sourceURI+')',backgroundRepeat:'no-repeat',backgroundSize:this.getWidth()+'px '+this.getHeight()+'px',cursor:w,height:this.getHeight(),width:this.getWidth()};}else return {backgroundImage:'url('+q+')',backgroundPosition:-t+'px '+ -u+'px',backgroundSize:(this.getWidth()+p*2)*this.props.framesPerRow+'px '+(this.getHeight()+p*2)*this.props.framesPerCol+'px',cursor:w,height:this.getHeight(),width:this.getWidth()};},_isStickerClickable:function(p){return p&&p!=c('StickerConstants').MOBILE_LIKE_STICKER_PACK_ID&&p!=c('StickerConstants').GRAVEYARD_PACK_ID;},onStickerClick:function(){if(!this._isStickerClickable(this.props.packID))return;if(this.props.onStickerClick)this.props.onStickerClick(this.props.packID,this.props.stickerID);},mouseLeft:function(){this.setState({isHovered:false});},mouseEntered:function(){this.setState({isHovered:true});if(!this.isAnimating())this.startAnimation();},tabFocusSelected:function(){this.setState({isHovered:true});if(!this.isAnimating())this.startAnimation();},tabFocusUnselected:function(){this.setState({isHovered:false});},getAriaLabel:function(){return i._("{pack name} {sticker name} sticker",[i.param('pack name',this.props.packName),i.param('sticker name',this.props.accessibilityLabel)]);},render:function(){var p,q;if(this.props.animationTrigger===n.CLICK&&this.props.frameCount>1&&this.props.spriteURI){p=true;}else if((this.props.animationTrigger===n.HOVER||this.props.animationTrigger===n.LOAD_AND_HOVER)&&this.props.frameCount>1&&this.props.spriteURI)q=true;var r=p?this.toggleAnimation:null;if(this.props.packID)r=this.onStickerClick;var s=this.props.className,t=null;if(this._isHotLike()){s=c('joinClasses')(s,"_576q");t=c('React').createElement(c('MessengerHotLikeSVG.react'),{color:this.props.customColor});}return (c('React').createElement('div',{'aria-label':this.getAriaLabel(),className:s,'data-testid':this.props.testID,tabIndex:'0',style:this.getStyle(),onClick:r,onMouseEnter:q?this.mouseEntered:null,onMouseLeave:q?this.mouseLeft:null,onFocus:this.tabFocusSelected,onBlur:this.tabFocusUnselected},t));},_isHotLike:function(){if(!!document.createElementNS&&!!document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect)return (this.props.stickerID===c('StickerConstants').HOT_LIKE_SMALL_STICKER_ID||this.props.stickerID===c('StickerConstants').HOT_LIKE_MEDIUM_STICKER_ID||this.props.stickerID===c('StickerConstants').HOT_LIKE_LARGE_STICKER_ID);return false;}});f.exports=o;},null);
__d("XMNStickerAssociatedPageSubscriptionController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/messages\/commerce\/stickers\/subscription\/",{pack_id:{type:"FBID"}});},null);
__d("XStickerQueryImagesController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/stickers\/query\/images\/",{query:{type:"String",required:true},sticker_interface:{type:"String"}});},null);
__d("XStickerStateInitialDataController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/stickers\/state\/",{});},null);
__d("XStickerStatePackDataController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/stickers\/state\/pack\/",{pack_id:{type:"Int",required:true}});},null);
__d("XStickerStateStoreDataController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/stickers\/state\/store\/",{});},null);
__d("XStickersAddPackController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/stickers\/addpack\/",{pack_id:{type:"Int"},size:{type:"String"},redirect_uri:{type:"String"},is_promoted:{type:"Bool",defaultValue:false},no_async_dom:{type:"Bool",defaultValue:false}});},null);
__d('StickerServerRequests',['Promise','AsyncRequest','XMNStickerAssociatedPageSubscriptionController','XStickerPackImagesController','XStickersAddPackController','XStickersRemovePackController','XStickerStateInitialDataController','XStickerStatePackDataController','XStickerStateStoreDataController','XStickerQueryImagesController'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={addPack:function(j,k,l){var m=c('XStickersAddPackController').getURIBuilder().setInt('pack_id',j).setBool('is_promoted',k).getURI();new (c('AsyncRequest'))(m).setHandler(function(n){return l(n.payload);}).send();},removePack:function(j,k){var l=c('XStickersRemovePackController').getURIBuilder().setInt('pack_id',j).getURI();new (c('AsyncRequest'))(l).setHandler(function(m){return k(m.payload);}).send();},getStickersForPack:function(j,k){var l=c('XStickerPackImagesController').getURIBuilder().setInt('pack_id',j).setInt('sticker_size',k).getURI();return new (c('Promise'))(function(m,n){return (new (c('AsyncRequest'))().setURI(l).setMethod('GET').setReadOnly(true).setHandler(function(o){return m(o.payload);}).send());});},getStickersForQuery:function(j,k,l){new (c('AsyncRequest'))().setURI(c('XStickerQueryImagesController').getURIBuilder().setString('query',j).setString('sticker_interface',k).getURI()).setMethod('GET').setReadOnly(true).setHandler(function(m){return l(m);}).send();},fetchTrayData:function(j){return i(c('XStickerStateInitialDataController').getURIBuilder().getURI(),j,true);},fetchStoreData:function(j){return i(c('XStickerStateStoreDataController').getURIBuilder().getURI(),j);},fetchPackData:function(j,k){return i(c('XStickerStatePackDataController').getURIBuilder().setInt('pack_id',j).getURI(),k);},subscribeAssociatedPage:function(j,k){var l=c('XMNStickerAssociatedPageSubscriptionController').getURIBuilder().setFBID('pack_id',j).getURI();new (c('AsyncRequest'))(l).setHandler(function(m){return k();}).send();}};function i(j,k,l){return new (c('Promise'))(function(m,n){return (new (c('AsyncRequest'))(j).setHandler(function(o){return m(o.getPayload());}).setAllowCrossPageTransition(l).send());}).then(k);}f.exports=h;},null);
__d('StickerImages',['StickerServerRequests'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={},i={},j={requestStickersForPack:function(k,l,m){if(!k)return;if(!i[k]){i[k]=c('StickerServerRequests').getStickersForPack(k,l);i[k].then(function(n){n.forEach(function(o){return this.cacheSticker(o);}.bind(this));}.bind(this));}i[k].then(function(n){return m(n);});},cacheSticker:function(k){h[k.id]=k;},getSticker:function(k){return h[k];}};f.exports=j;},null);
__d("StickerUtils",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={getScaledDimensions:function(i,j,k){var l,m,n;if(j>i){n=k/j;l=i*n;m=j*n;}else{n=k/i;l=i*n;m=j*n;}return {height:Math.round(l),width:Math.round(m)};},capitalizeWords:function(i){var j=i.split(" ");for(var k=0;k<j.length;k++){var l=j[k].charAt(0).toUpperCase();j[k]=l+j[k].substr(1);}return j.join(" ");}};f.exports=h;},null);
__d('MercuryAttachmentRenderer',['cx','MercuryAttachmentAudioClip.react','ChatAttachmentAttribution.react','EmojiLikeUtils','EmojiSticker.react','ImmutableObject','MercuryAttachment','MercuryAttachmentFile.react','MercuryAttachmentPhoto.react','MercuryAttachmentPhotoGrid.react','MercuryAttachmentVideo.react','MercuryConfig','MercuryMessageInfo','MercuryShareAttachment.react','MercuryShareAttachmentRenderLocations','MessagingGiftWrapChecker','MessengerHotLikeUtils','MessagingSourceEnum','React','Sticker.react','StickerAssetType','StickerConstants','StickerImages','StickerUtils','joinClasses','XStickerAssetController'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i={renderFile:function(j,k){return (c('React').createElement(c('MercuryAttachmentFile.react'),{name:j.name,open_url:k?null:j.open_url,rel:j.rel,type:j.icon_type,url:j.url}));},renderAudioClip:function(j,k){var l=j.metadata.duration/1000,m=100,n=k?160:400,o=100;if(l>=5)o=(1-Math.pow(10,(l-5)/-30))*(n-m)+m;return [c('React').createElement(c('MercuryAttachmentAudioClip.react'),{duration:j.metadata.duration/1000,key:'audioClip',rootClassName:c('MercuryAttachment').hasAttribution(j)?"_4yjw":'',showHelp:false,src:j.url,width:o}),c('React').createElement(c('ChatAttachmentAttribution.react'),{attachment:new (c('ImmutableObject'))(j),key:'audioAttribution'})];},renderVideo:function(j,k,l,m){var n=k?j.metadata.chat_size:j.metadata.inbox_size,o=k?j.metadata.chat_preview:j.metadata.inbox_preview;return (c('React').createElement(c('MercuryAttachmentVideo.react'),{attachment:new (c('ImmutableObject'))(j),duration:j.metadata.duration,isInbound:c('MercuryMessageInfo').isInbound(l),isChat:k,name:j.name,onAttachmentLoad:m,pageID:j.metadata.pageid,thumbSize:n,thumbnail:o,videoSize:j.metadata.dimensions,videoID:j.metadata.fbid,videoURI:j.url}));},constructStickerComponent:function(j,k,l,m,n,o){var p=m?'chatScrolled/':'messengerScrolled/';p+=j.thread_id;if(!k){k=c('MessengerHotLikeUtils').getMetadataForHotLike(j.sticker_id);if(!k){var q=c('StickerImages').getSticker(j.sticker_id),r=Object.assign({},q),s=q?c('StickerUtils').getScaledDimensions(q.height,q.width,c('StickerConstants').THREAD_SIZE):{height:c('StickerConstants').THREAD_SIZE,width:c('StickerConstants').THREAD_SIZE},t=s.height,u=s.width;r.height=t;r.width=u;r.stickerID=j.sticker_id;r.spriteURI='';r.spriteURI2x='';r.paddedSpriteURI='';r.paddedSpriteURI2x='';k=r;}}var v=null;if(k.stickerID){v=k.stickerID.toString();}else if(j.sticker_id)v=j.sticker_id.toString();var w=null;if(k.packID)w=k.packID.toString();var x=c('XStickerAssetController').getURIBuilder().setInt('sticker_id',v),y=null,z=null;if(window.devicePixelRatio&&window.devicePixelRatio>1){z=k.paddedSpriteURI2x;y=k.spriteURI2x;}else{z=k.paddedSpriteURI;y=k.spriteURI;}var aa=!!c('MessengerHotLikeUtils').getMetadataForHotLike(v)&&c('MessagingGiftWrapChecker').shouldRenderWithGiftWrap(j);return (c('React').createElement(c('Sticker.react'),{animationTrigger:'hover',className:c('joinClasses')(aa?"_3m7x":'','mvs'),customColor:o,frameCount:k.frameCount||1,frameRate:k.frameRate||83,framesPerCol:k.framesPerCol||1,framesPerRow:k.framesPerRow||1,onAttachmentLoad:n,onStickerClick:l,packID:w,paddedSpriteURI:z,sourceHeight:k.height,sourceURI:x.setEnum('image_type',c('StickerAssetType').IMAGE).getURI().toString(),sourceWidth:k.width,spriteURI:y,stickerID:v,subscribedThreadID:p}));},constructEmojiLikeAttachment:function(j,k){var l=c('MercuryConfig').MessengerNewEmojiGK&&c('MercuryConfig').MessengerNewEmojiUtils?c('MercuryConfig').MessengerNewEmojiUtils.getNewEmojiData(k.body,j.size):null,m=l?l.emoji:undefined;if(!l){var n=c('EmojiLikeUtils').getURI(k.body,j.size);if(!n)return null;}return (c('React').createElement(c('EmojiSticker.react'),{className:"_2poz _ui9",key:'sticker:'+k.message_id,emoji:k.body,emojiImage:m,sourceURI:n?n:''}));},renderPhotoAttachments:function(j,k,l,m){var n=j.length;if(!n)return null;if(n===1){var o=j[0],p=c('MercuryAttachment').resizeContain({width:l,height:l},{width:o.preview_width,height:o.preview_height});return (c('React').createElement('div',{className:"_55pk"+(' '+"_59go")+(c('MercuryAttachment').hasAttribution(o)?' '+"_4yjw":'')},c('React').createElement(c('MercuryAttachmentPhoto.react'),{image:o,width:p.width,height:p.height,message:k,onAttachmentLoad:m,round:true}),c('React').createElement(c('ChatAttachmentAttribution.react'),{attachment:new (c('ImmutableObject'))(j[0])})));}return (c('React').createElement('div',{className:"_55pk"},c('React').createElement(c('MercuryAttachmentPhotoGrid.react'),{images:j,size:l,message:k})));},sortAttachmentsStablyByType:function(j){var k=[c('MercuryAttachment').isPhotoAttachment,c('MercuryAttachment').isShareAttachment,c('MercuryAttachment').isFileAttachment,c('MercuryAttachment').isErrorAttachment];k.push(function(m){return true;});var l=k.map(function(m){return [];});j.forEach(function(m){for(var n=0;n<k.length;n++)if(k[n](m)){l[n].push(m);break;}});return Array.prototype.concat.apply([],l);},constructStoryBasedShareAttachment:function(j,k,l,m,n){var o=l?c('MercuryShareAttachmentRenderLocations').CHAT:c('MercuryShareAttachmentRenderLocations').WEB_INBOX;return (c('React').createElement('div',{className:!!j.body&&l?"_r38":''},c('React').createElement(c('MercuryShareAttachment.react'),{attachment:k.share,isSponsored:j.is_sponsored,location:o,maxWidth:m,messageID:j.message_id,onComponentLoaded:n,pageID:j.author,thread_id:j.thread_id})));}};f.exports=i;},null);
__d('MercuryAttachments.react',['MercuryAttachmentRenderer','ImmutableObject','MercuryAttachment','MercuryAttachmentMalicious.react','MercuryAttachmentError.react','MessagingGiftWrap.react','MessengerHotLikePreview.react','React','SubscriptionsHandler','emptyFunction'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'MercuryAttachments',propTypes:{attachments:h.array.isRequired,customColor:h.string,customLike:h.object,maxWidth:h.number.isRequired,message:h.instanceOf(c('ImmutableObject')).isRequired,isChat:h.bool,isGiftWrapped:h.bool,onAttachmentLoad:h.func,onStickerClick:h.func,onProgressBarLoad:h.func,onUnwrap:h.func},getDefaultProps:function(){return {isChat:false,onAttachmentLoad:c('emptyFunction'),onStickerClick:c('emptyFunction')};},_onAttachmentLoad:function(j){this.props.onAttachmentLoad&&this.props.onAttachmentLoad(j);},_subscriptionsHandler:null,componentDidMount:function(){this._subscriptionsHandler=new (c('SubscriptionsHandler'))();},componentWillUnmount:function(){this._subscriptionsHandler&&this._subscriptionsHandler.release();},_renderAttachment:function(j){if(c('MercuryAttachment').isStickerAttachment(j)){return c('MercuryAttachmentRenderer').constructStickerComponent(this.props.message,this.props.attachments[0].metadata,this.props.onStickerClick,this.props.isChat,this._onAttachmentLoad,this.props.customColor);}else if(c('MercuryAttachment').isEmojiLikeAttachment(j)){var k=c('MercuryAttachmentRenderer').constructEmojiLikeAttachment(this.props.attachments[0],this.props.message);return k?k:c('React').createElement(c('MercuryAttachmentError.react'),null);}else if(c('MercuryAttachment').isVoiceAttachment(j)){return c('MercuryAttachmentRenderer').renderAudioClip(this.props.attachments[0],this.props.isChat);}else if(c('MercuryAttachment').isVideoAttachment(j)){return c('MercuryAttachmentRenderer').renderVideo(j,this.props.isChat,this.props.message,this._onAttachmentLoad);}else if(c('MercuryAttachment').isShareAttachment(j)){return c('MercuryAttachmentRenderer').constructStoryBasedShareAttachment(this.props.message,j,this.props.isChat,this.props.maxWidth,this._onAttachmentLoad);}else if(c('MercuryAttachment').isFileAttachment(j)){return c('MercuryAttachmentRenderer').renderFile(j,this.props.isChat);}else if(c('MercuryAttachment').isErrorAttachment(j))return c('React').createElement(c('MercuryAttachmentError.react'),null);return c('React').createElement(c('MercuryAttachmentMalicious.react'),null);},render:function(){if(this.props.message.is_like_preview)return (c('React').createElement(c('MessengerHotLikePreview.react'),{isChat:this.props.isChat,key:'hlp:'+this.props.message.like_preview_since,since:this.props.message.like_preview_since,customLike:this.props.customLike,customColor:this.props.customColor}));if(this.props.attachments.length===0)return c('React').createElement('div',this.props);var j=c('MercuryAttachmentRenderer').renderPhotoAttachments(this.props.attachments.filter(c('MercuryAttachment').isPhotoAttachment),this.props.message,this.props.maxWidth,this._onAttachmentLoad),k=c('MercuryAttachmentRenderer').sortAttachmentsStablyByType(this.props.attachments.filter(function(l){return !c('MercuryAttachment').isPhotoAttachment(l);})).map(function(l,m){return (c('React').createElement('span',{key:m},this._renderAttachment(l)));}.bind(this));return (c('React').createElement('div',this.props,j,k,this.props.renderProgressBar&&this.props.renderProgressBar(),this.props.isGiftWrapped?c('React').createElement(c('MessagingGiftWrap.react'),{onUnwrap:this.props.onUnwrap}):null));}});f.exports=i;},null);
__d('WebMessengerStateConstants',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={STATE_CHANGE_EVENT:'state-changed',DETAIL:{COMPOSE_MAIN:'compose-main',COMPOSE_TYPEAHEAD_RESULTS:'compose-typeahead-results',COMPOSE_ALL_PEOPLE_RESULTS:'compose-all-people-results',RECENT_MESSAGES:'recent-messages',SEARCH_CONTEXT:'search-context',SEARCH_SNIPPET:'search-snippet',SEARCH_THREAD_SNIPPET:'search-thread-snippet',SHARED_PHOTOS:'shared-photos'},MASTER:{RECENT_THREADS:'recent-threads',SEARCH:'search'},MESSAGE_ACTION:{DELETE:'delete'}};f.exports=h;},null);
__d('WebMessengerOldToNewPermalink',['WebMessengerPermalinkConstants','WebMessengerStateConstants'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(m){if(!i(m))return m;j(m);l(m);k(m);return m;}function i(m){var n=m.getQueryData();if(n.sk)switch(n.sk){case 'inbox':m.setPath(c('WebMessengerPermalinkConstants').BASE_PATH);m.removeQueryData('sk');break;case 'other':m.setPath(c('WebMessengerPermalinkConstants').OTHER_PATH);m.removeQueryData('sk');break;default:return false;}return true;}function j(m){var n=m.getQueryData();switch(n.action){case 'read':if(!n.tid){m.addQueryData({action:c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES});}else m.removeQueryData('action');break;}}function k(m){var n=m.getQueryData();if(n.tid){m.setPath(c('WebMessengerPermalinkConstants').getURIPathForThreadID(n.tid,m.getPath()));m.removeQueryData('tid');}}function l(m){var n=m.getQueryData();if(!m.getPath().match(c('WebMessengerPermalinkConstants').SEARCH_POSTFIX_PATH)&&n.action!=c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET&&!n.mid){var o=n.query;if(n.query){var p=/\bis:(archived|spam)\b(.*)/,q=p.exec(n.query);if(q){switch(q[1]){case 'archived':m.setPath(c('WebMessengerPermalinkConstants').ARCHIVED_PATH);break;case 'spam':m.setPath(c('WebMessengerPermalinkConstants').SPAM_PATH);break;}var r=n.query.substr(0,n.query.length-q[0].length),s=q[2];o=(r.trim()+' '+s.trim()).trim();}}if(n.thread_query){m.setPath(m.getPath()+c('WebMessengerPermalinkConstants').SEARCH_POSTFIX_PATH);m.setQueryData({query:n.thread_query});}else if(o){m.setPath(m.getPath()+c('WebMessengerPermalinkConstants').SEARCH_POSTFIX_PATH);m.addQueryData({query:o});}else m.removeQueryData('query');}}f.exports=h;},null);
__d('WebMessengerStateStore',['MercuryAssert','PresenceState'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=null;function i(){var k=c('PresenceState').get();if(k&&k.wml)return k.wml;return {};}c('PresenceState').registerStateStorer(function(k){if(h)k.wml=h;h=null;});var j={getLastSeenThreadID:function(){var k=i();return k.thread_id||null;},getLastSeenFolder:function(){var k=i();return k.folder||null;},setLastSeen:function(k,l){l&&c('MercuryAssert').isThreadID(l);h={folder:k,thread_id:l||null};c('PresenceState').doSync();}};f.exports=j;},null);
__d('WebMessengerPermalinks',['MercuryAPIArgsSource','MercuryFilters','MercuryIDs','MercuryParticipants','MercuryParticipantTypes','MercuryThreadIDMap','MercuryTypeaheadConstants','MessagingTag','WebMessengerOldToNewPermalink','WebMessengerPermalinkConstants','WebMessengerStateConstants','WebMessengerStateStore','MercuryThreads','Token','URI','WebMessengerPreferences','WWWBase','MercuryUnreadState','createCancelableFunction','goURI','isWebMessengerURI'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryThreadIDMap').get(),i=c('MercuryThreads').get(),j='(/|\\?|$)';c('MercuryParticipants');c('MercuryIDs');var k={getDefaultURI:function(){var x=new (c('URI'))(c('WWWBase').uri);x.setPath(c('WebMessengerPermalinkConstants').BASE_PATH);return x;},goNextURI:function(x,y,z,aa){if(t(x,y,z)){var ba=k.getURI(x,y,z);c('goURI')(ba,false,aa);return true;}return false;},getURI:function(x,y,z){var aa=k.getDefaultURI();if(!x||!y||!z)return aa;switch(z.folder){case c('MessagingTag').OTHER:aa.setPath(c('WebMessengerPermalinkConstants').OTHER_PATH);break;case c('MessagingTag').ACTION_ARCHIVED:aa.setPath(c('WebMessengerPermalinkConstants').ARCHIVED_PATH);break;case c('MessagingTag').SPAM:aa.setPath(c('WebMessengerPermalinkConstants').SPAM_PATH);break;case c('MessagingTag').PENDING:aa.setPath(c('WebMessengerPermalinkConstants').PENDING_PATH);break;}if(z.filter&&z.filter!=c('MercuryFilters').ALL)aa.addQueryData({filter:z.filter});var ba;switch(x){case c('WebMessengerStateConstants').MASTER.SEARCH:ba=false;aa.setPath(aa.getPath()+c('WebMessengerPermalinkConstants').SEARCH_POSTFIX_PATH);break;}switch(y){case c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN:case c('WebMessengerStateConstants').DETAIL.COMPOSE_TYPEAHEAD_RESULTS:case c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:aa.setPath(aa.getPath()+c('WebMessengerPermalinkConstants').COMPOSE_POSTFIX_PATH);ba=false;break;case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:ba=!z.thread_id;break;case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:case c('WebMessengerStateConstants').DETAIL.SHARED_PHOTOS:ba=false;break;default:ba=true;break;}if(ba)aa.addQueryData({action:y});if(z.thread_id){var ca=c('MercuryIDs').getUserIDFromThreadID(z.thread_id),da=ca&&c('MercuryParticipants').getNow(c('MercuryIDs').getParticipantIDFromUserID(ca));if(da&&da.type!==c('MercuryParticipantTypes').EVENT){var ea=da&&da.vanity||ca;aa.setPath(c('WebMessengerPermalinkConstants').getURIPathForIDOrVanity(ea,aa.getPath()));}else{var fa=h.getServerIDFromClientIDNow(z.thread_id),ga=fa?fa:z.thread_id;aa.setPath(c('WebMessengerPermalinkConstants').getURIPathForThreadID(ga,aa.getPath()));}}if(z.query)aa.addQueryData({query:z.query});if(z.message_query)aa.addQueryData({mquery:z.message_query});if(z.message_id)aa.addQueryData({mid:z.message_id});if(z.reuse_composer)aa.addQueryData({rc:true});if(z.isStandaloneMode)aa.addQueryData({standalone:true});return aa;},processURI:function(x,y){x=c('WebMessengerOldToNewPermalink')(x);if(!c('isWebMessengerURI')(x))return y(false);var z,aa=u(x),ba=!aa.master_state||!aa.detail_state;if(ba){z=v(x);}else{z={data:{folder:r(x),filter:s(x)},redirect:false,master_state:aa.master_state,detail_state:aa.detail_state};if(x.getQueryData().rc)z.data.reuse_composer=true;z=o(x,z);}z.data.isStandaloneMode=x.getQueryData().standalone;if(ba)return y(z);switch(aa.detail_state){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:return q(x,z,y);case c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN:return l(x,z,y);case c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET:return p(x,z,y);case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:return q(x,z,function(ca){p(x,ca,function(da){n(x,da,y);});});}z.redirect=true;z.detail_state=null;return y(z);}};function l(x,y,z){var aa=null;if(x.getQueryData().to)aa=[].concat(x.getQueryData().to);z(m(aa,y));}function m(x,y){if(x){y.data.new_tokens=[];x.forEach(function(z){var aa=c('MercuryParticipants').getNow(c('MercuryIDs').getParticipantIDFromUserID(z));if(aa){var ba={uid:z,text:aa.name,type:c('MercuryTypeaheadConstants').USER_TYPE};y.data.new_tokens.push(new (c('Token'))(ba));}});}y.data.start=true;return y;}function n(x,y){var z=x.getQueryData().mid;if(z){y.data.message_id=z;}else y.redirect=true;return y;}function o(x,y){var z=x.getQueryData().query;y.data.query=z;return y;}function p(x,y,z){var aa=x.getQueryData().mquery;y.data.message_query=aa;z(y);}function q(x,y,z){var aa=c('WebMessengerPermalinkConstants').getThreadIDFromURI(x);if(aa){var ba=c('MercuryIDs').isValidThreadID(aa)?aa:h.getClientIDFromServerIDNow(aa);if(ba){y.data.thread_id=ba;}else y.redirect=true;}else{var ca=c('WebMessengerPermalinkConstants').getUserIDOrVanity(x.getPath());if(ca){var da=c('MercuryParticipants').getIDFromVanityOrFBID(ca);if(!da){if(!y.waiting){y.waiting=true;y.retry=c('createCancelableFunction')(function(){q(x,y,z);});c('MercuryParticipants').addListener('change',y.retry);z(y);}return;}var ea=da&&i.getCanonicalThreadToParticipant(da,null,c('MercuryAPIArgsSource').WEBMESSENGER);if(ea){delete y.waiting;if(y.retry)y.retry.cancel();if(ea.timestamp){y.data.thread_id=ea.thread_id;}else{y.detail_state=c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN;y=m([c('MercuryIDs').getUserIDFromParticipantID(da)],y);}}else y.redirect=true;}}z(y);}function r(x,y){var z=x.getPath();if(z.match('^'+c('WebMessengerPermalinkConstants').ARCHIVED_PATH+j))return c('MessagingTag').ACTION_ARCHIVED;if(z.match('^'+c('WebMessengerPermalinkConstants').OTHER_PATH+j))return c('MessagingTag').OTHER;if(z.match('^'+c('WebMessengerPermalinkConstants').SPAM_PATH+j))return c('MessagingTag').SPAM;if(z.match('^'+c('WebMessengerPermalinkConstants').PENDING_PATH+j))return c('MessagingTag').PENDING;if(y!==undefined)return y;return c('MessagingTag').INBOX;}function s(x){return x.getQueryData().filter||c('MercuryFilters').ALL;}function t(x,y,z){if(y===c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT||y===c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET||y===c('WebMessengerStateConstants').DETAIL.SHARED_PHOTOS)return false;if(z&&z.no_uri===true){delete z.no_uri;return false;}var aa=y==c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN||y==c('WebMessengerStateConstants').DETAIL.COMPOSE_TYPEAHEAD_RESULTS||y==c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS;if(aa&&(!z.start||z.new_tokens))return false;if(!x||!y||!z)return true;if(z.bug_reporting_enabled)return false;return !z.message_action;}function u(x){var y={},z=x.getPath(),aa=x.getQueryData(),ba=z.match(c('WebMessengerPermalinkConstants').BASE_PATH+'(/[^/]+)?'+c('WebMessengerPermalinkConstants').SEARCH_POSTFIX_PATH+j);y.master_state=ba&&aa.query?c('WebMessengerStateConstants').MASTER.SEARCH:c('WebMessengerStateConstants').MASTER.RECENT_THREADS;if(aa.action){y.detail_state=aa.action;return y;}if(z.match('(?:'+c('WebMessengerPermalinkConstants').BASE_PATH+'|'+c('WebMessengerPermalinkConstants').OTHER_PATH+')'+'(/[^/]+)?'+c('WebMessengerPermalinkConstants').COMPOSE_POSTFIX_PATH+j)){y.detail_state=c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN;return y;}if(z.match(c('WebMessengerPermalinkConstants').TID_POSTFIX_PARTIAL_PATH)||c('WebMessengerPermalinkConstants').getUserIDOrVanity(z)){if(aa.mid&&aa.mquery){y.detail_state=c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT;}else y.detail_state=c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES;}else if(aa.mquery)y.detail_state=c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET;return y;}function v(x){var y=r(x,null)||c('WebMessengerStateStore').getLastSeenFolder(),z=c('WebMessengerStateStore').getLastSeenThreadID()||w(y||c('MessagingTag').INBOX),aa=c('MercuryUnreadState').get();if(y===c('MessagingTag').OTHER&&aa.getUnreadCount(y)===0){var ba=c('MessagingTag').INBOX;if(aa.exceedsMaxCount(ba)||aa.getUnreadCount(ba)>0)y=ba;}var ca={redirect:!!z||!!y,replace:true,master_state:c('WebMessengerStateConstants').MASTER.RECENT_THREADS,detail_state:c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,data:{folder:y||c('MessagingTag').INBOX,filter:c('MercuryFilters').ALL,thread_id:z}};return ca;}function w(x){var y=c('WebMessengerPreferences').lastReadThreadForFolder[x];if(y){var z=y.other_user_fbid||y.thread_fbid;return h.getClientIDFromServerIDNow(z);}else return null;}f.exports=k;},null);
__d('WebMessengerStateManager',['Arbiter','CurrentUser','Dialog','Focus','JSLogger','MercuryFilters','MessagingTag','WebMessengerPermalinks','WebMessengerStateConstants'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('JSLogger').create('wm_state_manager'),i=c('CurrentUser').getID(),j=false,k=Object.assign(new (c('Arbiter'))(),{getCurrentUserID:function(){return i;},getCurrentMasterState:function(){return n;},getCurrentDetailState:function(){return o;},getCurrentStateData:function(){return p;},getStandaloneMode:function(){return j;},setUserID:function(r){i=r||c('CurrentUser').getID();},setStandaloneMode:function(r){j=Boolean(r);},updateMasterState:function(r,s){k.updateAllStates(r,o,s);},updateDetailState:function(r,s){k.updateAllStates(n,r,s);},updateAllStates:function(r,s,t){for(var u=0;u<q.length;u++)if(q[u]){var v=q[u](r,s,t);if(v){h.log('confirmation_dialog',{master_state:n,detail_state:o,data:p,new_master_state:r,new_detail_state:s,new_data:t});v.setHandler(l.bind(null,r,s,t)).show();var w=v.getButtonElement(c('Dialog').OK.label);w&&c('Focus').set(w);return;}}l(r,s,t);},updateStateOnURI:function(r,s,t){m(r,s,t);},registerConfirmationBeforeStateUpdate:function(r){var s=q.length;q.push(r);return s;},unregisterConfirmationBeforeStateUpdate:function(r){delete q[r];}});function l(r,s,t){if(!t.folder)t.folder=p.folder;if(!t.filter)t.filter=p.filter;t.isStandaloneMode=k.getStandaloneMode();if(!c('WebMessengerPermalinks').goNextURI(r,s,t))m(r,s,t);}function m(r,s,t){n=r;o=s;p=t;var u=babelHelpers['extends']({},p);u.new_tokens=[];(p.new_tokens||[]).forEach(function(v){u.new_tokens.push(v.getInfo());});u.new_tokens=[];h.log('state_updated',{master_state:n,detail_state:o,data:u});k.inform(c('WebMessengerStateConstants').STATE_CHANGE_EVENT);}var n=c('WebMessengerStateConstants').MASTER.RECENT_THREADS,o=c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,p={thread_id:null,folder:c('MessagingTag').INBOX,filter:c('MercuryFilters').ALL},q=[undefined];f.exports=k;},null);
__d('WebMessengerAdsControl',['csx','cx','AdsMouseStateStore','Animation','Arbiter','WebMessengerConstants','CSS','CurrentUser','DOM','EgoAdsObjectSet','Event','KeyedCallbackManager','MercuryIDs','MercuryThreads','UIPagelet','URI','UserActivity','Vector','WebMessengerAdsConfig','WebMessengerStateManager','WebMessengerSubscriptionsHandler','getOrCreateDOMID','shield','throttle'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('MercuryThreads').get(),k=600,l=c('WebMessengerConstants').ADS_ROTATION_INTERVAL_PASSIVE,m=c('WebMessengerConstants').ADS_ROTATION_THRESHOLD_ACTIVE,n=c('WebMessengerConstants').MAX_ADS,o=2,p=165,q=c('AdsMouseStateStore').STATES,r='data-height',s=new (c('KeyedCallbackManager'))(),t='webMessengerAdsStage',u=0,v={};function w(){}Object.assign(w,{init:function(){this._ads=new (c('EgoAdsObjectSet'))();this._initializedAds=false;this._loadingCount=null;this._stage=null;this._drawCount=0;this._lastRefresh=0;this._pageletInProgress=null;this._lastMousedOnAds=false;this._waitOn(['codes','container','sidebar','footer'],this.start.bind(this));c('WebMessengerSubscriptionsHandler').addSubscriptions(c('UserActivity').subscribe(c('shield')(this._refreshIfReady,this)),c('Arbiter').subscribe('footerLoaded',function(){s.setResource('footer',1);}),c('Arbiter').subscribe(['sidebar/initialized','sidebar/visibility','minisidebar/show'],this._sideBarChanged.bind(this)),s);return this;},setContainer:function(da){s.setResource('container',da);this._container=da;},setTrackingCodes:function(da){s.setResource('codes',da);},getTrackingCodes:function(){return s.getResource('codes');},updateRhcID:function(){var da=c('DOM').scry(this._container,'div.ego_section')[0];if(!da)return;c('AdsMouseStateStore').updateRhcID(c('getOrCreateDOMID')(da));},start:function(){this._stage=c('DOM').create('div',{id:t,className:"_2rn"});this._ego=c('DOM').find(this._container,"._81");c('DOM').insertAfter(this._ego,this._stage);this.updateRhcID();this._updateFooterHeight();this.waitForAdsLoad(this._container,this._processOnPageUnits.bind(this));c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(window,'resize',c('throttle')(this.draw,100,this)),c('Event').listen(this._ego,'mouseenter',c('shield')(this._mouseEvent,this,true)),c('Event').listen(this._ego,'mouseleave',c('shield')(this._mouseEvent,this,false)));},stateChanged:function(da,ea){da=da||{};ea=ea||{};if(da.thread_id&&ea.thread_id&&ea.thread_id!==da.thread_id)this._refreshIfReady(true);},draw:function(){var da=this._loadingCount<=0;if(!this._initializedAds||!this._drawCount&&!da)return;this._adjustAdsToFit();},_processOnPageUnits:function(){this._ads.init(ba(this._ego));this._initializedAds=true;this._adjustAdsToFit();},_processStagedUnits:function(){this._pageletInProgress=false;var da=ba(this._stage);if(!this._lastMousedOnAds&&da.length&&!this._focusedOnAds()){c('DOM').empty(this._ego);while(this._stage.childNodes.length)c('DOM').appendContent(this._ego,this._stage.firstChild);this._ads.init(da);this._lastRefresh=Date.now();this._adjustAdsToFit();}},waitForAdsLoad:function(da,ea){var fa=ba(da);this._loadingCount=fa.length;if(!this._loadingCount){this._lastRefresh=Date.now()-l/2;this._pageletInProgress=false;return;}var ga=function(ha){aa(ha);if(--this._loadingCount<=0)ea();}.bind(this);fa.forEach(function(ha){function ia(){setTimeout(ga.bind(null,ha),0);}var ja=c('DOM').scry(ha,'img.img')[0];if(!ja||ja.complete){ia();}else c('Event').listen(ja,{load:ia,error:ia,abort:ia});}.bind(this));},_adjustAdsToFit:function(){this._drawCount++;var da=c('Vector').getViewportDimensions().y,ea=da-this._footerHeight-p,fa=ea,ga=0;while(fa>0&&ga<this._ads.getCount()){fa-=z(this._ads.getUnit(ga));if(fa>=0)ga++;}ga=Math.max(ga,o);for(var ha=0;ha<this._ads.getCount();ha++)y(this._ads.getUnit(ha),ha>=ga);c('CSS').conditionShow(this._ego,ga);c('CSS').addClass(this._ads.getUnit(0),'ego_unit_no_top_border');var ia=c('DOM').scry(this._container,'.ego_section');ia.forEach(function(ja){x(ja,c('DOM').scry(ja,'[data-onscreen]').length);});x(this._container,true);this._registerImpressions(ga);this._registerHoldoutImpressions(ea);c('Arbiter').inform('WebMessengerAdsControl/adjustAds');},_waitOn:function(da,ea){s.executeOrEnqueue(da,ea);},_mouseEvent:function(da){this._lastMousedOnAds=da;},intentShown:function(){if(!c('WebMessengerAdsConfig').stateRefresh)return false;var da=c('AdsMouseStateStore').getState();switch(da){case q.STATIONARY:return !c('WebMessengerAdsConfig').refreshOnStationary;case q.INTENT:case q.HOVER:return true;default:return false;}},_focusedOnAds:function(){return c('DOM').contains(this._container,document.activeElement);},_refreshIfReady:function(da){var ea=da?m:l;if(this._lastRefresh===0){this._lastRefresh=Date.now();return;}else if(this._pageletInProgress||!this._drawCount||this._lastMousedOnAds||this._focusedOnAds()||this.intentShown()||this._lastRefresh+ea>Date.now())return;s.reset();this._waitOn(['codes'],this.waitForAdsLoad.bind(this,this._stage,this._processStagedUnits.bind(this)));this._pageletInProgress=c('UIPagelet').loadFromEndpoint('WebEgoPane',t,{pid:43,data:[c('CurrentUser').getID(),n,++u,ca()]},{crossPage:true,bundle:false,handler:this.onLoadHandler.bind(this)});},onLoadHandler:function(){if(!c('WebMessengerAdsConfig').fade)return;new (c('Animation'))(this._container).from('opacity',0).to('opacity',1).duration(k).go();},_updateFooterHeight:function(){c('CSS').hide(this._ego);this._footerHeight=c('Vector').getElementDimensions(this._container).y;c('CSS').show(this._ego);},_registerImpression:function(da){var ea=this.getTrackingCodes();if(!ea||!ea[da])return null;var fa=c('DOM').create('iframe',{src:new (c('URI'))('/ai.php').addQueryData({aed:ea[da]}),width:0,height:0,frameborder:0,scrolling:'no',className:'fbEmuTracking'});fa.setAttribute('aria-hidden','true');c('DOM').appendContent(this._container,fa);return fa;},_registerImpressions:function(da){var ea=this.getTrackingCodes(),fa=v;v={};for(var ga=0;ga<da;ga++){if(!this._ads.getUnit(ga))continue;var ha=c('DOM').scry(this._ads.getUnit(ga),"div._4u8");if(!ha.length)continue;var ia=ha[0].getAttribute('data-ad'),ja=JSON.parse(ia).adid;if(ja in fa){v[ja]=fa[ja];delete fa[ja];}else{if(!ea||!ea[ja])continue;var ka=this._registerImpression(ja);delete ea[ja];if(ka)v[ja]=ka;}}for(ja in fa)c('DOM').remove(fa[ja]);},_registerHoldoutImpressions:function(da){var ea=this._ads.getHoldoutAdIDsForSpace(da,z);if(ea)ea.forEach(this._registerImpression.bind(this));},_sideBarChanged:function(da){if(da=='sidebar/initialized')s.setResource('sidebar',1);this._initializedAds&&this.draw();}});function x(da,ea){c('CSS').conditionClass(da,"_2rn",!ea);}function y(da,ea){c('CSS').conditionClass(da,"_22r",ea);da.setAttribute('aria-hidden',ea?'true':'false');if(ea){da.removeAttribute('data-onscreen');}else da.setAttribute('data-onscreen','1');}function z(da){if(!da)return 0;var ea=da.getAttribute(r)||aa(da);return parseInt(ea,10);}function aa(da){var ea=c('Vector').getElementDimensions(da).y;da.setAttribute(r,ea);return ea;}function ba(da){return c('DOM').scry(da,'div.ego_unit');}function ca(){var da=c('WebMessengerStateManager').getCurrentStateData();if(da.thread_id){var ea=j.getThreadMetaNow(da.thread_id);if(ea)return ea.participants.map(function(fa){return c('MercuryIDs').getUserIDFromParticipantID(fa);}).filter(function(fa){return fa&&fa!=c('CurrentUser').getID();});}return [];}f.exports=w;},null);
__d('WebMessengerActionsMenuItem',['CSS','MenuItem','WebMessengerStateManager'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('MenuItem'));i=h&&h.prototype;function j(k){'use strict';k.href=k.href||'#';i.constructor.call(this,k);this.setOnClickHandler(this.handleMenuItemClick);this.showFn=this._data.should_show_fn;this.hasAction=function(){return !this._data.hideManually;}.bind(this);}j.prototype.handleMenuItemClick=function(){'use strict';var k=c('WebMessengerStateManager').getCurrentStateData().thread_id;k&&this._data.onclick(k);};j.prototype.updateShownState=function(k){'use strict';if(this.showFn){this._isHidden=!this.showFn(k);if(this._root)c('CSS').conditionShow(this._root,!this._isHidden);}};j.prototype.isShown=function(k){'use strict';var l=this.showFn?this.showFn(k):true;return l;};j.prototype.render=function(){'use strict';var k=i.render.call(this);if(this._isHidden)c('CSS').hide(k);return k;};f.exports=j;},null);
__d('MercuryTypeahead',['cx','Event','ArbiterMixin','DOM','DOMDimensions','Input','Keys','MercuryTypeaheadTemplates','Tokenizer','Typeahead','TypeaheadCore','WorkModeConfig'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=function(j,k){this._domElement=null;this._typeahead=null;this._tokenizer=null;this._placeholder='';this._exclusions=[];this._viewNodeOrID=null;this._viewOptions={renderer:'compact',autoSelect:true};this._tokenizerBehaviors=[];this._heightPrev=null;this._dataSource=j;this._view=k;};Object.assign(i.prototype,c('ArbiterMixin'));Object.assign(i.prototype,{setPlaceholder:function(j){this._placeholder=j;return this;},setExcludedParticipantsFromThreadMeta:function(j){if(!j)return;if(!j.former_participants||c('WorkModeConfig').is_work_user){this.setExcludedParticipants(j.participants);return;}var k=j.former_participants.filter(function(l){return l.is_friend===false;}).map(function(l){return l.id;});this.setExcludedParticipants(k.concat(j.participants));},setExcludedParticipants:function(j){this._exclusions=[];j.forEach(function(k){var l=k.indexOf(':');if(k.substr(0,l)=='fbid')this._exclusions.push(k.substr(l+1));}.bind(this));return this;},setViewNodeID:function(j){this._viewNodeOrID=j;},setViewNode:function(j){this._viewNodeOrID=j;},setFullWidthView:function(j){var k=c('DOM').create('div',{className:"_4ck uiTypeaheadView"});c('DOM').setContent(j,k);this.setViewNode(k);},setViewOption:function(j,k){this._viewOptions[j]=k;},addTokenizerBehavior:function(j){this._tokenizerBehaviors.push(j);},build:function(j){if(this._domElement)return;var k=c('MercuryTypeaheadTemplates')[':fb:mercury:tokenizer'].build(),l=c('MercuryTypeaheadTemplates')[':fb:mercury:typeahead'].build();this._domElement=k.getRoot();c('DOM').appendContent(this._domElement,l.getRoot());var m=l.getNode('textfield');c('Input').setPlaceholder(m,this._placeholder);m.setAttribute('data-placeholder',this._placeholder);this._input=m;var n={node_id:this._viewNodeOrID,ctor:this._view,options:this._viewOptions},o={ctor:c('TypeaheadCore'),options:{setValueOnSelect:true}};this._typeahead=new (c('Typeahead'))(this._dataSource,n,o,l.getRoot());this._typeahead.init();var p={inline:true,behaviors:this._tokenizerBehaviors};this._tokenizer=new (c('Tokenizer'))(this._domElement,this._typeahead);this._tokenizer.init(k.getNode('tokenarea'),'participants',[],p);this._tokenizer.subscribe(['addToken','removeToken','removeAllTokens'],this._tokensChanged.bind(this));this._tokenizer.subscribe('resize',function(){this.inform('resize');}.bind(this));c('Event').listen(m,'focus',function(){this._resetDataSource();this._typeahead.init();}.bind(this));c('Event').listen(this._domElement,'click',this.focus.bind(this));c('Event').listen(m,'keydown',this.keydown.bind(this));this._heightPrev=c('DOMDimensions').getElementDimensions(this._domElement).height;},getElement:function(){return this._domElement;},getSelectedParticipantIDs:function(){var j=[];if(this._tokenizer)(this._tokenizer.getTokenValues()||[]).forEach(function(k){j.push('fbid:'+k);});return j;},getTokens:function(){var j=[];if(this._tokenizer)j=this._tokenizer.getTokens();return j;},getTokenizer:function(){return this._tokenizer;},keydown:function(event){if(this._tokenizer.inline&&event.keyCode==c('Keys').ESC){if(c('Input').isEmpty(this._input)){var j=this._tokenizer.getLastToken();if(j&&j.isRemovable()){this._tokenizer.removeToken(j);event.stopPropagation();return;}}else{this._typeahead.getCore().reset();event.stopPropagation();return;}this.inform('esc-pressed');return;}if(c('Input').isEmpty(this._input)&&this._tokenizer.inline&&event.keyCode===c('Keys').RETURN){event.preventDefault();return this.inform('tokens-return');}},reset:function(){this._tokenizer&&this._tokenizer.removeAllTokens();this._typeahead&&this._typeahead.getCore().reset();},focus:function(){this._tokenizer&&this._tokenizer.focusInput();},getTypeahead:function(){return this._typeahead;},_resetDataSource:function(){this._dataSource.setExclusions(this._exclusions);},_tokensChanged:function(){this.inform('tokens-changed');}});f.exports=i;},null);
__d('MercuryTypeaheadRenderer',['cx','Event','Badge.react','CSS','DOM','Image.react','MercuryTypeaheadConstants','MercuryParticipantsConstants','React','ReactDOM','MercuryTypeaheadTemplates'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();function i(k,l){var m;switch(k.type){case c('MercuryTypeaheadConstants').HEADER_TYPE:m=c('MercuryTypeaheadTemplates')[':fb:mercury:typeahead:header'].build();i.renderHeader(m,k);break;case c('MercuryTypeaheadConstants').USER_TYPE:case c('MercuryTypeaheadConstants').PAGE_TYPE:m=c('MercuryTypeaheadTemplates')[':fb:mercury:typeahead:result'].build();i.renderPerson(m,k);break;default:throw new Error('Unsupported result type: '+k.type);}return m.getRoot();}Object.assign(i,{renderHeader:function(k,l){if(l.disabled){c('CSS').hide(k.getRoot());return;}var m=l.getLinkHandler&&l.getLinkHandler();if(m){var n=k.getNode('link');c('DOM').setContent(n,l.linkText);c('Event').listen(n,'click',m);}else c('CSS').hide(k.getNode('link'));k.setNodeContent('text',l.text);},renderPersonWithBigPhoto:function(k,l){j(k,l,c('MercuryParticipantsConstants').BIG_IMAGE_SIZE);},renderPerson:function(k,l){j(k,l,c('MercuryParticipantsConstants').IMAGE_SIZE);},renderPage:function(k,l){j(k,l,c('MercuryParticipantsConstants').IMAGE_SIZE);}});function j(k,l,m){if(l.photo){var n=c('React').createElement(c('Image.react'),{width:m,height:m,src:l.photo});c('ReactDOM').render(n,k.getNode('image'));}if(l.text){c('DOM').setContent(k.getNode('name'),l.text);k.getRoot().setAttribute('aria-label',l.text);}var o=[];if(l.subtext||l.category){if(l.subtext)o.push(l.subtext);if(l.category)o.push(l.category);c('DOM').appendContent(k.getNode('snippet'),o.join(" \u00b7 "));}var p=null;if(l.is_verified){p=c('React').createElement(c('Badge.react'),{type:'verified',size:'xsmall'});c('ReactDOM').render(p,k.getNode('badge'));}else if(l.is_work_user){p=c('React').createElement(c('Badge.react'),{type:'work',size:'xsmall'});c('ReactDOM').render(p,k.getNode('badge'));}if(l.non_employee){if(o.length)c('DOM').prependContent(k.getNode('snippet')," \u00b7 ");var q=c('DOM').create('span',{className:"_52l8 highlight"},'(Non-Employee)');c('DOM').prependContent(k.getNode('snippet'),q);}}f.exports=i;},null);
__d('WebMessengerAddPeopleToConversationDialog',['fbt','ContextualTypeaheadView','Dialog','DOM','MercuryAPIArgsSource','MercuryDataSources','MercuryIDs','MercuryLogMessageType','MercurySourceType','MercuryTypeahead','MercuryTypeaheadConstants','MercuryTypeaheadRenderer','MercuryMessageObject','MercuryMessageActions','WebMessengerTemplates','MercuryThreads','WorkModeConfig'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercuryMessageObject').get(),j=c('MercuryMessageActions').get(),k=c('MercuryThreads').get(),l={show:function(n){var o=h._("Add People"),p={};p[c('MercuryTypeaheadConstants').FRIEND_TYPE]={uid:c('MercuryTypeaheadConstants').FRIEND_TYPE,type:c('MercuryTypeaheadConstants').HEADER_TYPE,disabled:true};p[c('MercuryTypeaheadConstants').NON_FRIEND_TYPE]={uid:c('MercuryTypeaheadConstants').NON_FRIEND_TYPE,text:h._("Other People"),type:c('MercuryTypeaheadConstants').HEADER_TYPE};var q=new (c('MercuryTypeahead'))(c('MercuryDataSources').get('MercuryRecipientsDataSource'),c('ContextualTypeaheadView'));q.setViewOption('renderer',c('MercuryTypeaheadRenderer'));q.setViewOption('typeObjects',p);var r=c('WorkModeConfig').is_work_user?h._("Add co-workers to this chat"):h._("Add friends to this chat");q.setPlaceholder(r);var s=[];s.push({name:'subscribe',label:o,handler:m.bind(null,n,q)});s.push(c('Dialog').CANCEL);var t=c('WebMessengerTemplates')[':fb:web-messenger:add-people-dialog'].build(),u=new (c('Dialog'))().setTitle(o).setBody(t.getRoot()).setButtons(s).showLoading();k.getThreadMeta(n,function(v){q.setFullWidthView(t.getNode('participantsTypeahead'));q.setExcludedParticipantsFromThreadMeta(v);q.build();c('DOM').appendContent(t.getNode('participantsTypeahead'),q.getElement());u.show();q.focus();},c('MercuryAPIArgsSource').WEBMESSENGER);}};function m(n,o){var p=o.getTokens(),q=p.map(function(r){return c('MercuryIDs').getParticipantIDFromUserID(r.getValue());});if(!q.length)return false;j.send(i.constructLogMessageObject(c('MercurySourceType').TITAN_WEB,n,c('MercuryLogMessageType').SUBSCRIBE,{added_participants:q}),null,c('MercuryAPIArgsSource').WEBMESSENGER);return true;}f.exports=l;},null);
__d('WebMessengerDeleteThreadDialog',['fbt','React','SimpleXUIDialog','MercuryThreadActions','XUIDialogButton.react','XUIDialogCancelButton.react'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercuryThreadActions').get(),j={show:function(k){var l=h._("Delete This Entire Conversation?"),m=h._("Once you delete your copy of this conversation, it cannot be undone."),n=c('React').createElement('div',null,c('React').createElement(c('XUIDialogCancelButton.react'),null),c('React').createElement(c('XUIDialogButton.react'),{action:'cancel',label:h._("Delete Conversation"),use:'confirm',onClick:function(){return i['delete'](k);}}));c('SimpleXUIDialog').showEx(m,l,n);}};f.exports=j;},null);
__d('WebMessengerEditThreadDialog',['csx','cx','Event','Button','ContextualDialog','CSS','DOM','FileInput','FileInputUploader','Input','InputSelection','LayerFadeOnHide','LayerFadeOnShow','LayerHideOnTransition','MercuryAPIArgsSource','MercuryLogMessageType','MercurySourceType','MercuryMessageObject','MercuryMessageActions','WebMessengerTemplates','MercuryThreads','URI','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('MercuryMessageObject').get(),k=c('MercuryMessageActions').get(),l=c('MercuryThreads').get(),m=':fb:web-messenger:read-view:header:edit-multichat';function n(){'use strict';var o=c('WebMessengerTemplates')[m].build();this._dialog=new (c('ContextualDialog'))({position:'below',addedBehaviors:[c('LayerFadeOnHide'),c('LayerFadeOnShow'),c('LayerHideOnTransition')]},o.getRoot());this._saveButton=o.getNode('saveButton');this._cancelButton=o.getNode('cancelButton');this._pictureInput=o.getNode('newPicture');this._uploadButton=o.getNode('uploadButton');this._uploadingThrobber=o.getNode('uploadingThrobber');this._uploadedFileDetails=o.getNode('uploadedFileDetails');this._fileNameNode=o.getNode('fileName');this._cancelImageButton=o.getNode('cancelImage');this._threadID=null;var p=o.getNode('newName');this._uploadedImage=null;if(!this._pictureInput){var q=c('DOM').scry(o.getRoot(),"._8-9")[0];this._pictureInput=c('DOM').create('input',{accept:'image/*',type:'file',className:"_n",name:'attachment[]',tabindex:2});new (c('FileInput'))(q,this._uploadButton,this._pictureInput);}var r=new (c('URI'))('/ajax/mercury/upload.php').setSubdomain('upload').toString();this._uploader=new (c('FileInputUploader'))(this._pictureInput).setURI(r).setAllowCrossOrigin(true).setData({images_only:true});c('WebMessengerSubscriptionsHandler').addSubscriptions(this._uploader.subscribe('success',this._onFileUploadSuccess.bind(this)),this._uploader.subscribe('failure',this._onFileUploadFailure.bind(this)),c('Event').listen(this._pictureInput,'change',this._onFileUploadChange.bind(this)),c('Event').listen(this._cancelImageButton,'click',this._resetImageUpload.bind(this)));c('Event').listen(this._saveButton,'click',function(){this.save(c('Input').getValue(p));this._dialog.hide();}.bind(this));c('Event').listen(this._cancelButton,'click',function(){this._dialog.hide();}.bind(this));this._dialog.subscribe('show',function(){var s=l.getThreadMetaNow(this._threadID);c('Input').setValue(p,s.name);this._resetImageUpload();}.bind(this));this._dialog.subscribe('aftershow',function(){c('InputSelection').set(p,0,c('Input').getValue(p).length);}.bind(this));}n.prototype.toggleShown=function(o,p){'use strict';if(!this._dialog.isShown()){this._dialog.setContext(o);this._threadID=p;this._uploadedImage=null;this._dialog.show();}else this._dialog.hide();};n.prototype.save=function(o){'use strict';var p=null,q=l.getThreadMetaNow(this._threadID);if(q)p=q.name;if((o||p)&&o!=p)k.send(j.constructLogMessageObject(c('MercurySourceType').CHAT_WEB,this._threadID,c('MercuryLogMessageType').THREAD_NAME,{name:o}),null,c('MercuryAPIArgsSource').WEBMESSENGER);if(this._uploadedImage)k.send(j.constructLogMessageObject(c('MercurySourceType').CHAT_WEB,this._threadID,c('MercuryLogMessageType').THREAD_IMAGE,{image:this._uploadedImage}));};n.prototype._onFileUploadChange=function(event){'use strict';var o=c('Input').getValue(event.getTarget());if(o){c('Button').setEnabled(this._saveButton,false);c('CSS').hide(this._uploadButton);c('CSS').hide(this._uploadedFileDetails);c('CSS').show(this._uploadingThrobber);this._uploader.send();}};n.prototype._onFileUploadSuccess=function(o,p){'use strict';var q=p.response.getPayload();this._uploadedImage=q.metadata[0];c('DOM').setContent(this._fileNameNode,this._uploadedImage.filename);c('CSS').hide(this._uploadingThrobber);c('CSS').hide(this._uploadButton);c('CSS').show(this._uploadedFileDetails);c('Button').setEnabled(this._saveButton,true);};n.prototype._onFileUploadFailure=function(o,p){'use strict';c('Button').setEnabled(this._saveButton,true);this._resetImageUpload();};n.prototype._resetImageUpload=function(){'use strict';this._uploadedImage=null;this._pictureInput.value=null;c('CSS').hide(this._uploadingThrobber);c('CSS').hide(this._uploadedFileDetails);c('CSS').show(this._uploadButton);};f.exports=n;},null);
__d("ListInputTargetTracker",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(){"use strict";this._index=undefined;this._items=[];}h.prototype.getIndex=function(){"use strict";return this._index;};h.prototype.setIndex=function(i){"use strict";this._index=Math.max(0,Math.min(i,this._items.length-1));};h.prototype.getNumItems=function(){"use strict";return this._items.length;};h.prototype.getItem=function(){"use strict";if(this._index!==undefined)return this._items[this._index];};h.prototype.setTargetItem=function(i){"use strict";this.updateIndex(this._items,i);};h.prototype.addItem=function(i){"use strict";this._items.push(i);};h.prototype.removeItemAtIndex=function(i){"use strict";this._items.splice(i,1);};h.prototype.removeItemByValue=function(i){"use strict";var j=this._items.indexOf(i);this.removeItemAtIndex(j);};h.prototype.moveUp=function(){"use strict";if(this._index===undefined||this._index===0){if(this._items.length){this._index=this._items.length-1;return true;}}else if(this._index>0){this._index--;return true;}return false;};h.prototype.moveDown=function(){"use strict";if(this._index===undefined||this._index===this._items.length-1){if(this._items.length){this._index=0;return true;}}else if(this._index<this._items.length-1){this._index++;return true;}return false;};h.prototype.updateIndex=function(i,j){"use strict";this._items=i||[];if(j){var k=this._items.indexOf(j);if(k>=0){this._index=k;}else if(this._index!==undefined)if(this._items.length>0){this._index=Math.min(this._index,this._items.length-1);}else this._index=undefined;}else this._index=undefined;return this._index;};f.exports=h;},null);
__d('WebMessengerShortcuts',['csx','cx','fbt','BanzaiODS','DialogX','DOM','KeyEventController','LayerHideOnEscape','ListInputTargetTracker','MercuryAPIArgsSource','MessagingTag','Parent','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','UserAgent_DEPRECATED','WebMessengerEvents','arrayContains','ge','getOrCreateDOMID','shield','MercuryThreadActions','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercuryThreadActions').get(),l=c('MercuryThreads').get(),m=null,n=null,o=null,p={g:{callback:v,description:j._("Search conversations"),section:'searchAndHelp',uses_meta:true},m:{callback:u,description:j._("Start a new message"),section:'navigation',uses_meta:true},i:{callback:da.bind(null,c('MessagingTag').INBOX),description:j._("Go to Inbox"),section:'navigation',uses_meta:true},u:{callback:da.bind(null,c('MessagingTag').OTHER),description:j._("Go to Other"),section:'navigation',uses_meta:true},z:{callback:x,description:j._("Archive\/unarchive conversation"),otherKeys:['y'],section:'conversation',uses_meta:true},r:{callback:y,description:j._("Mark message as read\/unread"),section:'conversation',uses_meta:true},UP:{callback:z,description:j._("Select next conversation"),section:'navigation',uses_meta:false},DOWN:{callback:aa,description:j._("Select previous conversation"),section:'navigation',uses_meta:false},q:{callback:c('shield')(fa),description:j._("Show\/hide keyboard shortcuts"),section:'searchAndHelp',uses_meta:true}},q={registerGeneralShortcuts:function(){n=new (c('ListInputTargetTracker'))();for(var ga in p){var ha=p[ga],ia=[ga];if(ha.otherKeys)ia=ha.otherKeys.concat(ia);for(var ja=0;ja<ia.length;ja++)c('KeyEventController').registerKey(ia[ja],ha.callback,t.bind(null,ha.uses_meta));}},updateThreadlistIndex:function(ga,ha,ia){m=ga;if(n){if(!c('arrayContains')(ha,ia))ia=null;n.updateIndex(ha,ia);}},openSearchThread:function(){var ga=ca(),ha=c('WebMessengerStateManager').getCurrentMasterState();if(ga&&ha==c('WebMessengerStateConstants').MASTER.SEARCH)m.openSearchThread(ga);},showOrHideShortcuts:fa};function r(){return c('UserAgent_DEPRECATED').osx()?'CTRL':'ALT';}function s(ga){function ha(){if(!o){var ia=c('DOM').find(document.body,"._ksg");o=[];do{ia=ia.parentNode;o.push(ia);}while(ia&&ia!==document.body);}return o;}if(!c('Parent').bySelector(ga,"._ksg"))if(!c('arrayContains')(ha(),ga))if(!c('DOM').scry(ga,"._5hu2").length)return false;return true;}function t(ga,event,ha){if(!c('KeyEventController').filterEventTypes(event,ha))return false;if(!s(event.getTarget()))return false;var ia;if(ga)switch(r()){case 'CTRL':ia='ctrlKey';break;case 'ALT':ia='altKey';break;}var ja=['ctrlKey','metaKey','altKey','shiftKey'];for(var ka=0;ka<ja.length;ka++)if(ja[ka]!==ia&&event[ja[ka]])return false;return !ga||event[ia];}function u(){c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.compose');c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN,{start:true});return false;}function v(){c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.search');c('WebMessengerEvents').focusAndSelectSearch();return false;}function w(ga){var ha;if(n.getNumItems()>1){var ia=n.getIndex();n.setIndex(ia===0?1:ia-1);ha=ca();}ga();c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{folder:c('WebMessengerStateManager').getCurrentStateData().folder,thread_id:ha});if(ha)m._manager.scrollIntoView(c('ge')(n.getItem()),false);}function x(){c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.toggle_archive');var ga=ca();if(ga){l.getThreadMeta(ga,function(ha){if(ha.folder==c('MessagingTag').SPAM)return;w(function(){if(ha.is_archived){k.unarchive(ha.thread_id);}else k.archive(ha.thread_id);});},c('MercuryAPIArgsSource').WEBMESSENGER);return false;}}function y(){var ga=ca();c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.toggle_read_status');if(ga){l.getThreadMeta(ga,function(ha){var ia=!ha.unread_count;ia?k.markUnread(ga):k.markRead(ga);},c('MercuryAPIArgsSource').WEBMESSENGER);return false;}}function z(){c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.go_to_next');if(n)if(n.getIndex()===0){switch(c('WebMessengerStateManager').getCurrentMasterState()){case c('WebMessengerStateConstants').MASTER.SEARCH:n.moveUp();ba();m._manager.scrollToBottom(false);break;default:m._manager.scrollToTop(false);c('WebMessengerEvents').focusSearch();}}else{if(n.getItem()){n.moveUp();}else n.moveDown();ba();}return false;}function aa(){c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.go_to_previous');var ga=c('WebMessengerStateManager').getCurrentMasterState();if(n&&(ga!==c('WebMessengerStateConstants').MASTER.RECENT_THREADS||n.getIndex()<n.getNumItems()-1)){n.moveDown();ba();}return false;}function ba(){var ga=ca();if(ga){var ha=c('WebMessengerStateManager').getCurrentMasterState();if(ha==c('WebMessengerStateConstants').MASTER.SEARCH){m.updateKeyboardSelection(ga);c('WebMessengerEvents').focusSearch();}else c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{thread_id:ga});if(n)if(n.getIndex()===0){m._manager.scrollToTop(false);}else m._manager.scrollIntoView(c('ge')(n.getItem()),false);}}function ca(){var ga=n&&n.getItem();if(typeof ga==='string'&&ga.indexOf(':')!==-1)return ga.substr(ga.indexOf(':')+1);return null;}function da(ga){if(ga===c('MessagingTag').INBOX){c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.go_to_inbox');}else if(ga===c('MessagingTag').OTHER)c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.go_to_other');var ha=c('WebMessengerStateManager').getCurrentMasterState(),ia=ha==c('WebMessengerStateConstants').MASTER.SEARCH?null:c('WebMessengerStateManager').getCurrentStateData().thread_id;c('WebMessengerStateManager').updateMasterState(c('WebMessengerStateConstants').MASTER.RECENT_THREADS,{thread_id:ia,folder:ga});}var ea;function fa(ga){c('BanzaiODS').bumpEntityKey('kbshorts_messenger','kbshorts.show_or_hide_shortcuts');if(!ea){var ha={};for(var ia in p){var ja=p[ia];if(!ja.uses_meta)continue;var ka=c('WebMessengerTemplates')[':fb:web-messenger:shortcuts-dialog:row'].build(),la=[ia],ma=[];if(ja.otherKeys)la=ja.otherKeys.concat(la);for(var na=0;na<la.length;na++){var oa=c('WebMessengerTemplates')[':fb:web-messenger:shortcuts-dialog:key'].build();oa.setNodeContent('meta',r());oa.setNodeContent('key',la[na]);ma.push(oa.getRoot());}ka.setNodeContent('keys',ma);ka.setNodeContent('description',ja.description);if(!ha[ja.section])ha[ja.section]=[];ha[ja.section].push(ka.getRoot());}var pa=c('WebMessengerTemplates')[':fb:web-messenger:shortcuts-dialog'].build();for(var qa in ha)pa.setNodeContent(qa,ha[qa]);var ra=c('DOM').scry(pa.getRoot(),"._1yw")[0],sa=null;if(ra)sa=c('getOrCreateDOMID')(ra);ea=new (c('DialogX'))({modal:true,titleID:sa,width:565},pa.getRoot());ea.enableBehavior(c('LayerHideOnEscape'));}if(ea.isShown()){ea.hide();}else{ea.show();if(typeof ga==='function')ea.subscribeOnce('hide',ga);}return false;}f.exports=q;},null);
__d("XMessagingLeaveConversationDialogController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/leave_conversation\/",{__asyncDialog:{type:"Int"}});},null);
__d("XNFXStartForMessageThreadController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/nfx\/start_message_thread\/",{thread_fbid:{type:"String",required:true},responsible_fbid:{type:"Int"},av:{type:"Int"},location:{type:"Enum",enumType:1},__asyncDialog:{type:"Int"}});},null);
__d('WebMessengerDetailViewActionsMenuControl',['fbt','WebMessengerAddPeopleToConversationDialog','AsyncDialog','AsyncRequest','Bootloader','ChatEditParticipantsUtils','ChatOpenTab','ContextualDialogArrow','CSS','CurrentUser','WebMessengerDeleteThreadDialog','DOM','WebMessengerEditThreadDialog','Event','FBRTCCore','FBRTCCallabilityStore','FBRTCVideoCallButtonManager','Input','Keys','Menu','MenuSeparator','MercuryAPIArgsSource','MercuryBlockedParticipants','MercuryIDs','MercuryLogMessageType','MercuryParticipants','MercurySourceType','MercuryThreadIDMap','MercuryThreadInfo','MercuryThreadMuter','MercuryViewer','MercuryMessageObject','MercuryMessageActions','MessagingTag','Popover','PopoverMenu','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','MercuryThreadActions','MercuryThreadInformer','MercuryThreads','Toggler','URI','WebMessengerActionsMenuItem','WebMessengerSubscriptionsHandler','XMessagingLeaveConversationDialogController','XUIMenuTheme','XNFXStartForMessageThreadController','XEventCreateDialogController','emptyFunction','goURI'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('FBRTCVideoCallButtonManager').module,j=c('MercuryBlockedParticipants').get(),k=c('MercuryThreadIDMap').get(),l=c('MercuryMessageObject').get(),m=c('MercuryMessageActions').get(),n=c('MercuryThreadActions').get(),o=c('MercuryThreadInformer').get(),p=c('MercuryThreads').get();function q(ib,jb){'use strict';this._rootElement=ib;this._headerControl=jb;this._menuTemplate=c('WebMessengerTemplates')[':fb:web-messenger:actions-menu'].build();this._newMessageButton=this._menuTemplate.getNode('newMessageButton');this._actionsMenu=this._menuTemplate.getNode('menu');this._searchThreadInput=this._menuTemplate.getNode('searchThreadInput');this._searchThreadButton=this._menuTemplate.getNode('searchThreadButton');this._searchCloseButton=this._menuTemplate.getNode('searchCloseButton');this._videoCallButton=this._menuTemplate.getNode('videoCallButton');var kb=this._menuTemplate.getNode('actionsButton'),lb=function(event){if(!this._searchMode){s(this,true);}else{var mb=c('Input').getValue(this._searchThreadInput);if(mb){var nb=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{message_query:mb});c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET,nb);this._searchThreadInput.focus();}else s(this,false);}event.kill();}.bind(this);c('WebMessengerSubscriptionsHandler').addSubscriptions(o.subscribe('threads-updated',function(mb,nb){nb[this._threadID]&&this.updateView();}.bind(this)),c('Event').listen(this._menuTemplate.getNode('newMessageButton'),'click',function(){c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN,babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{start:true,thread_id:undefined}));}),c('Event').listen(this._actionsMenu,'keydown',function(event){if(event.keyCode===c('Keys').ESC){kb.focus();event.preventDefault();}}),c('Event').listen(this._searchThreadButton,'mousedown',lb),c('Event').listen(this._searchThreadButton,'keydown',function(event){if(event.keyCode===c('Keys').RETURN||event.keyCode===c('Keys').SPACE)lb(event);}),c('Event').listen(this._searchThreadButton,'click',c('emptyFunction').thatReturnsFalse),c('Event').listen(this._searchCloseButton,'keydown',function(event){if(event.keyCode===c('Keys').RETURN||event.keyCode===c('Keys').SPACE){u(this);this._menuTemplate.getNode('searchThreadButton').focus();}}.bind(this)),c('Event').listen(this._searchCloseButton,'mousedown',function(event){u(this);}.bind(this)),c('Event').listen(this._searchThreadInput,'blur',function(event){var mb=c('Input').getValue(this._searchThreadInput);if(!mb)s(this,false);}.bind(this)),c('Event').listen(this._searchThreadInput,'keyup',function(event){var mb=c('Input').getValue(this._searchThreadInput),nb=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{message_query:mb});if(event.keyCode==c('Keys').RETURN&&mb)c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET,nb);if(event.keyCode==c('Keys').ESC)c('Input').reset(this._searchThreadInput);}.bind(this)),c('Event').listen(this._videoCallButton,'click',function(){i.onCallClicked(this._threadID,'web_messenger');}.bind(this)),c('FBRTCCallabilityStore').addListener(function(){i.updateVideoCallButton(this._videoCallButton,this._threadID);}.bind(this)));this.initItems();c('DOM').setContent(this._rootElement,this._menuTemplate.getRoot());}q.prototype.initItems=function(){'use strict';var ib=this._menuTemplate.getNode('actionsButton'),jb=this._menuTemplate.getNode('newMessageButton'),kb=function(){ib.focus();},lb=function(){jb.focus();};this.menuItems=[];this.menuItems.push({ctor:c('WebMessengerActionsMenuItem'),label:h._("Add People..."),onclick:qa,should_show_fn:w},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Edit Participants..."),onclick:ra,should_show_fn:w},{ctor:c('WebMessengerActionsMenuItem'),hideManually:true,label:h._("Edit Conversation Name..."),onclick:ta.bind(null,this),should_show_fn:w},{ctor:c('WebMessengerActionsMenuItem'),hideManually:true,label:h._("Edit Conversation Picture..."),onclick:ta.bind(null,this),should_show_fn:w},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Leave Conversation..."),onclick:sa,should_show_fn:w},{ctor:c('MenuSeparator'),should_show_fn:w});this.menuItems.push({ctor:c('WebMessengerActionsMenuItem'),hideManually:true,label:h._("Open in Chat"),onclick:x,should_show_fn:c('ChatOpenTab').canOpenTab},{ctor:c('WebMessengerActionsMenuItem'),label:h._("View Photos in Thread"),onclick:oa},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Mark as Read"),onclick:cb.bind(null,kb),should_show_fn:ka},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Mark as Unread"),onclick:bb.bind(null,kb),should_show_fn:fa(ka)});this.menuItems.push({ctor:c('MenuSeparator')},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Move to Work Account"),onclick:da,should_show_fn:ca},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Archive"),onclick:wa.bind(null,lb),should_show_fn:fa(ja)},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Unarchive"),onclick:xa.bind(null,lb),should_show_fn:ja},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Mute Conversation..."),onclick:function(mb){c('MercuryThreadMuter').showMuteChangeDialog(mb,ib);},should_show_fn:fa(c('MercuryThreadInfo').isMuted)},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Unmute Conversation"),onclick:t.bind(null,kb),should_show_fn:c('MercuryThreadInfo').isMuted},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Move to Inbox"),onclick:z.bind(null,lb,c('MessagingTag').INBOX),should_show_fn:y.bind(null,c('MessagingTag').OTHER)},{ctor:c('WebMessengerActionsMenuItem'),hideManually:true,label:h._("Delete Conversation..."),onclick:ea},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Delete Messages..."),onclick:db});this.menuItems.push({ctor:c('MenuSeparator')},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Create Group..."),onclick:za,should_show_fn:aa},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Create Event..."),onclick:ab,should_show_fn:ba},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Block Messages..."),onclick:ma.bind(null),should_show_fn:ga},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Unblock Messages..."),onclick:ua.bind(null),should_show_fn:ha},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Report Spam or Abuse..."),onclick:na.bind(null,kb),should_show_fn:fa(ia)},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Not Spam"),onclick:pa.bind(null,lb),should_show_fn:ia},{ctor:c('WebMessengerActionsMenuItem'),hideManually:true,label:h._("Keyboard Shortcuts"),onclick:hb.bind(null,kb)},{ctor:c('WebMessengerActionsMenuItem'),label:h._("Feedback"),onclick:c('goURI').bind(null,'/help/?page=134259426717336')});this._menu=new (c('Menu'))(this.menuItems,{theme:c('XUIMenuTheme')});this._popover=new (c('PopoverMenu'))(new (c('Popover'))(ib.parentNode,ib,[c('ContextualDialogArrow')],{alignh:'right'}),ib,this._menu);v(function(mb){if(!mb)return;var nb=[{ctor:c('MenuSeparator')},{ctor:c('WebMessengerActionsMenuItem'),label:'Enable bug reporting',onclick:eb.bind(null,kb),should_show_fn:fa(la)},{ctor:c('WebMessengerActionsMenuItem'),label:'Disable bug reporting',onclick:fb.bind(null,kb),should_show_fn:la}];Array.prototype.push.apply(this.menuItems,nb);nb.forEach(function(ob){this._menu.addItem(new ob.ctor(ob));},this);}.bind(this));};q.prototype.hideView=function(){'use strict';c('CSS').hide(this._rootElement);};q.prototype.updateView=function(){'use strict';this.hideView();var ib=c('WebMessengerStateManager').getCurrentDetailState(),jb=false,kb=false,lb=false,mb=false,nb=false,ob=false;switch(ib){case c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN:case c('WebMessengerStateConstants').DETAIL.COMPOSE_TYPEAHEAD_RESULTS:case c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:r(this);this._threadID=null;break;case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:if(this._state!==ib)r(this);var pb=c('WebMessengerStateManager').getCurrentStateData().thread_id;jb=true;if(this._searchMode&&this._threadID===pb){mb=true;}else{r(this);kb=true;lb=true;}this._threadID=pb;if(this._threadID)nb=true;break;case c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET:var qb=c('WebMessengerStateManager').getCurrentStateData();c('Input').setValue(this._searchThreadInput,qb.message_query);this._threadID=qb.thread_id;jb=true;mb=true;ob=true;break;case c('WebMessengerStateConstants').DETAIL.SHARED_PHOTOS:var rb=c('WebMessengerStateManager').getCurrentStateData();this._threadID=rb.thread_id;jb=true;kb=true;lb=true;nb=true;break;default:r(this);jb=true;kb=true;this._threadID=null;break;}this._state=ib;c('CSS').conditionShow(this._searchThreadInput,mb);c('CSS').conditionShow(this._searchThreadButton,nb);c('CSS').conditionShow(this._searchCloseButton,ob);c('CSS').conditionShow(this._newMessageButton,kb);c('CSS').conditionShow(this._rootElement,jb);i.updateVideoCallButton(this._videoCallButton,this._threadID);c('CSS').conditionShow(this._videoCallButton,i.isVideoCallableThread(this._threadID)&&!this._searchMode&&c('FBRTCCore').shouldEnableVideoCalling());this._threadSubscription&&p.unsubscribe(this._threadSubscription);if(lb&&this._threadID){this._threadSubscription=p.getThreadMeta(this._threadID,function(sb){this._menu.forEachItem(function(tb){return tb.updateShownState&&tb.updateShownState(sb);});c('CSS').show(this._menuTemplate.getNode('menu'));c('CSS').show(this._rootElement);}.bind(this),c('MercuryAPIArgsSource').WEBMESSENGER);}else c('CSS').hide(this._menuTemplate.getNode('menu'));};q.prototype.destroy=function(){'use strict';};function r(ib){ib._searchMode=false;c('Input').reset(ib._searchThreadInput);}function s(ib,jb){if(jb){ib._searchMode=true;}else r(ib);c('CSS').conditionShow(ib._newMessageButton,!jb);c('CSS').conditionShow(ib._videoCallButton,!jb&&i.isVideoCallableThread(ib._threadID));c('CSS').conditionShow(ib._actionsMenu,!jb);c('CSS').conditionShow(ib._searchThreadInput,jb);if(jb){ib._searchThreadInput.focus();c('Toggler').hide(this._actionsMenu);}}function t(ib,jb){n.unmute(jb);c('Toggler').hide();ib();}function u(ib){s(ib,false);c('CSS').conditionShow(ib._searchThreadButton,true);c('CSS').conditionShow(ib._searchCloseButton,false);var jb=c('WebMessengerStateManager').getCurrentDetailState();if(jb!==c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES)c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{thread_id:c('WebMessengerStateManager').getCurrentStateData().thread_id});}function v(ib){c('MercuryParticipants').get(c('MercuryViewer').getID(),function(jb){ib(jb&&jb.employee);});}function w(ib){return !ib.is_canonical&&ib.is_subscribed&&!ib.has_email_participant&&!ib.read_only;}function x(ib){c('Toggler').hide();c('ChatOpenTab').openThread(ib,'WebMessengerDetailViewActionsMenuControl');}function y(ib,jb){return !jb.is_archived&&jb.folder==ib;}function z(ib,jb,kb){n.changeFolder(kb,jb);gb();ib();}function aa(ib){var jb=ya(ib.participants);return jb.length>2;}function ba(ib){var jb=ya(ib.participants);return jb.length>2;}function ca(ib){if(!c('CurrentUser').isEmployee()||!c('CurrentUser').hasWorkUser()||!c('MercuryIDs').isGroupChat(ib.thread_id))return false;var jb=ib.participants;for(var kb=0;kb<jb.length;++kb){var lb=c('MercuryParticipants').getNow(jb[kb]);if(!lb||!lb.employee)return false;}return true;}function da(ib){if(!p.isEmptyLocalThread(ib)){var jb=l.constructLogMessageObject(c('MercurySourceType').MESSENGER_WEB,ib,c('MercuryLogMessageType').SWITCH_TO_WORK,{removed_participants:[c('MercuryViewer').getID()]});m.send(jb,null,c('MercuryAPIArgsSource').WEBMESSENGER);gb();}return true;}function ea(ib){c('Toggler').hide();c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,c('WebMessengerStateManager').getCurrentStateData());c('WebMessengerDeleteThreadDialog').show(ib);}function fa(ib){return function(){return !ib.apply(this,arguments);};}function ga(ib){return ib.is_canonical&&!j.isMessageBlocked(ib);}function ha(ib){return ib.is_canonical&&j.isMessageBlocked(ib);}function ia(ib){return ib.folder===c('MessagingTag').SPAM;}function ja(ib){return ib.is_archived;}function ka(ib){return ib.unread_count>0;}function la(){return c('WebMessengerStateManager').getCurrentStateData().bug_reporting_enabled;}function ma(ib){n.blockMessages(ib);}function na(ib,jb){k.getServerIDFromClientID(jb,function(kb){var lb=c('XNFXStartForMessageThreadController').getURIBuilder().setString('thread_fbid',kb).getURI();c('AsyncDialog').send(new (c('AsyncRequest'))(lb));});}function oa(ib){c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.SHARED_PHOTOS,babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData()));}function pa(ib,jb){n.unmarkSpam(jb);gb();ib();}function qa(ib){c('WebMessengerAddPeopleToConversationDialog').show(ib);}function ra(ib){c('ChatEditParticipantsUtils').showParticipantsModal(ib);}function sa(ib){var jb=c('XMessagingLeaveConversationDialogController').getURIBuilder().getURI();c('AsyncDialog').send(new (c('AsyncRequest'))(jb),function(kb){kb.subscribe('confirm',function(){va(ib);kb.hide();});});}function ta(ib,jb){c('Toggler').hide();var kb=new (c('WebMessengerEditThreadDialog'))();kb.toggleShown(ib._headerControl?ib._headerControl._headerBar.getNode('headerName'):ib._rootElement,jb);}function ua(ib){var jb=p.getThreadMetaNow(ib),kb=c('MercuryIDs').getParticipantIDFromFromThreadID(ib);c('MercuryParticipants').get(kb,function(lb){c('Bootloader').loadModules(["MessageBlockedDialog"],function(mb){mb.show(ib,jb.can_reply,j.isMessageBlocked(jb),lb.short_name);});});}function va(ib){m.send(l.constructLogMessageObject(c('MercurySourceType').TITAN_WEB,ib,c('MercuryLogMessageType').UNSUBSCRIBE,{removed_participants:[c('MercuryViewer').getID()]}),null,c('MercuryAPIArgsSource').WEBMESSENGER);return true;}function wa(ib,jb){n.archive(jb);gb();ib();}function xa(ib,jb){n.unarchive(jb);gb();ib();}function ya(ib){var jb=[];for(var kb=0;kb<ib.length;kb++){var lb=ib[kb];if(/^fbid:\d+$/.test(lb))jb.push(lb.substr(5));}return jb;}function za(ib){p.getThreadMeta(ib,function(jb){var kb=ya(jb.participants),lb=new (c('URI'))('/ajax/groups/create_get.php').addQueryData({ref:'web_messenger',members:kb,message_thread_fbid:jb.thread_fbid,parent_id:'0'});c('AsyncDialog').send(new (c('AsyncRequest'))(lb));},c('MercuryAPIArgsSource').WEBMESSENGER);}function ab(ib){p.getThreadMeta(ib,function(jb){var kb=ya(jb.participants),lb=c('XEventCreateDialogController').getURIBuilder().setString('acontext',JSON.stringify({})).setIntVector('invite_ids',kb).getURI();c('AsyncDialog').send(new (c('AsyncRequest'))(lb));},c('MercuryAPIArgsSource').WEBMESSENGER);}function bb(ib,jb){n.markUnread(jb);c('Toggler').hide();ib();}function cb(ib,jb){n.markRead(jb);c('Toggler').hide();ib();}function db(){var ib=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{message_action:c('WebMessengerStateConstants').MESSAGE_ACTION.DELETE});c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateManager').getCurrentDetailState(),ib);}function eb(ib){var jb=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{bug_reporting_enabled:true});c('Toggler').hide();c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateManager').getCurrentDetailState(),jb);ib();}function fb(ib){var jb=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{bug_reporting_enabled:false});c('Toggler').hide();c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateManager').getCurrentDetailState(),jb);ib();}function gb(){c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{folder:c('WebMessengerStateManager').getCurrentStateData().folder});}function hb(ib){c('Toggler').hide();c('WebMessengerShortcuts').showOrHideShortcuts(ib);}f.exports=q;},null);
__d('ExpandableDataSource',['DataSource'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('DataSource'));i=h&&h.prototype;function j(k,l,m){'use strict';k=k||{};k.maxResults=l;i.constructor.call(this,k);this._initialLimit=l;this._moreResultsLimit=m;this._states={};}j.prototype.query=function(k,l,m){'use strict';this.setQueryData({offset:0,limit:this._initialLimit});i.query.call(this,k,l,m);};j.prototype.fetchHandler=function(k,l){'use strict';var m=k.getPayload(),n=l.value;this.getState('is_loading_more_per_query')[n]=false;this.getState('total_results_count_per_query')[n]=m.total_count;i.fetchHandler.call(this,k,l);};j.prototype.loadMore=function(){'use strict';if(this.value&&!this.hasLoadedAllResults()){var k=this.getState('max_results_per_query');if(!k[this.value])k[this.value]=this._initialLimit;this.setQueryData({offset:k[this.value],limit:this._moreResultsLimit});k[this.value]+=this._moreResultsLimit;if(k[this.value]>this._maxResults)this._maxResults=k[this.value];this.getState('is_loading_more_per_query')[this.value]=true;this.fetch(this.queryEndpoint,this.getQueryData(this.value,this.buildUids(this.value)),{value:this.value});}};j.prototype.isLoadingMore=function(){'use strict';return this.getState('is_loading_more_per_query')[this.value];};j.prototype.hasLoadedAllResults=function(){'use strict';var k=this.getState('total_results_count_per_query')[this.value],l=(this.buildQueryResults(this.value)||[]).length;return k&&l>=k;};j.prototype.getStates=function(){'use strict';return this._states;};j.prototype.getState=function(k){'use strict';var l=this.getStates();if(!l[k])l[k]={};return l[k];};j.prototype.getQueryCache=function(){'use strict';return this.getState('query_cache');};f.exports=j;},null);
__d('WebMessengerDetailViewAllPeopleResultsControl',['csx','cx','CSS','DataStore','DOM','Event','ExpandableDataSource','MercuryIDs','Parent','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','Token','WebMessengerEvents','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=5,k=5;function l(q){'use strict';this._rootElement=q;c('DOM').empty(this._rootElement);var r=c('WebMessengerTemplates')[':fb:web-messenger:all-people-results'].build();c('DOM').setContent(this._rootElement,r.getRoot());this._loadingSpinner=r.getNode('loadingSpinner');this._peopleResults=r.getNode('results');this._loadMoreButton=r.getNode('loadMoreButton');this._loadMoreLink=r.getNode('loadMoreLink');c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._loadMoreLink,'click',function(){c('CSS').addClass(this._loadMoreButton,'async_saving');this._peopleDataSource&&this._peopleDataSource.loadMore();}.bind(this)));}l.prototype.hideView=function(){'use strict';c('CSS').hide(this._rootElement);};l.prototype.updateView=function(){'use strict';var q=c('WebMessengerStateManager').getCurrentDetailState();if(q==c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS){c('CSS').show(this._rootElement);m(this);c('WebMessengerEvents').detailDOMChanged();}};l.prototype.destroy=function(){'use strict';};function m(q){c('CSS').show(q._loadingSpinner);c('CSS').hide(q._peopleResults);c('CSS').hide(q._loadMoreButton);var r=c('WebMessengerStateManager').getCurrentStateData(),s=r.all_people_query||'';n(q);var t=(r.participants||[]).map(function(u){return c('MercuryIDs').tokenize(u).value;});q._peopleDataSource.setExclusions(t);q._peopleDataSource.query(s);}function n(q){if(!q._peopleDataSource){q._peopleDataSource=new (c('ExpandableDataSource'))({queryEndpoint:'/ajax/mercury/search_people.php'},j,k);q._peopleDataSource.init();c('WebMessengerSubscriptionsHandler').addSubscriptions(q._peopleDataSource.subscribe('respond',o.bind(null,q)),c('Event').listen(q._rootElement,'click',function(event){var r=event.getTarget().parentNode;if(c('CSS').matchesSelector(r,"._4wt"))p(event.getTarget(),q._peopleDataSource);}));}}function o(q,r,s){var t=c('WebMessengerStateManager').getCurrentDetailState(),u=c('WebMessengerStateManager').getCurrentStateData();if(t==c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS&&u.all_people_query==s.value){c('DOM').empty(q._peopleResults);c('CSS').show(q._peopleResults);s.results.forEach(function(v){var w=c('DOM').create('div',{className:'personResult'},v.detail_markup);c('DataStore').set(w,'uid',v.uid);c('DOM').appendContent(q._peopleResults,w);});if(s.results.length){c('CSS').hide(q._loadingSpinner);c('CSS').conditionShow(q._loadMoreButton,!q._peopleDataSource.hasLoadedAllResults());c('CSS').conditionClass(q._loadMoreButton,'async_saving',q._peopleDataSource.isLoadingMore());}}}function p(q,r){var s=c('Parent').byClass(q,'personResult'),t=r.getEntry(c('DataStore').get(s,'uid')),u=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{new_tokens:[new (c('Token'))(t)],start:false});c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN,u);}f.exports=l;},null);
__d('Ellipsizer',['cx','CSS','Style','UserAgent_DEPRECATED','getElementText'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=1;function j(k){this.elements=[];this.descend=true;k.forEach(function(l){c('CSS').addClass(l,"_6qy");this.elements.push({node:l});},this);return this;}j.prototype.setDescend=function(k){this.descend=k;return this;};j.prototype.$Ellipsizer1=function(){var k;this.elements.forEach(function(l){k=l.node;if(this.descend)while(k.children.length===1)k=k.children[0];if(k===l.node)c('Style').set(k,'width','');c('UserAgent_DEPRECATED').ie()&&c('Style').set(k,'position','absolute');l.width=k.offsetWidth;c('UserAgent_DEPRECATED').ie()&&c('Style').set(k,'position','');},this);this.elements.sort(function(l,m){return l.width-m.width;});};j.prototype.confineWithin=function(k,l){l=l||i;this.$Ellipsizer1();var m=k;this.elements.forEach(function(n,o){var p=Math.floor(m/(this.elements.length-o));if(n.width<=p||n.width<=0||p<=0||n.width<=p*l&&m>=p*l){c('CSS').removeClass(n.node,"_6s5");c('Style').set(n.node,'width','');m-=n.width;if(n.titleSet){n.node.setAttribute('title','');n.titleSet=false;}}else{c('CSS').addClass(n.node,"_6s5");c('Style').set(n.node,'width',p+'px');m-=p;if(!n.titleSet&&!n.node.getAttribute('title')){n.node.setAttribute('title',c('getElementText')(n.node));n.titleSet=true;}}},this);};f.exports=j;},null);
__d('MercuryReadOnlyReason',['fbt','MercuryConfig','React'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={getReason:function(j){if(j.has_email_participant){var k=c('MercuryConfig').DYIDeepLink;return h._("Sorry, this conversation isn't active anymore because messages can no longer be sent to email addresses. After May 1st 2015, conversations with email addresses will only be available in a copy of your Facebook data. {download your information}",[h.param('download your information',c('React').createElement('a',{href:k},h._("Learn More")))]);}else return h._("You cannot reply to this conversation.");}};f.exports=i;},null);
__d('MessagesEmoticonView',['csx','cx','DOM','EmoticonsList','Event','Focus','InputSelection','Keys','Parent','SubscriptionsHandler','TextAreaControl','Toggler','UserAgent_DEPRECATED'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('EmoticonsList').symbols;function k(n){return c('Parent').bySelector(n,"._5r8h");}function l(n,o,p,q){var r=c('Parent').byClass(n,'emoticon');if(!r)return;var s='emoticon_',t=null;r.className.split(' ').forEach(function(aa){if(aa.startsWith(s))t=aa.substring(s.length);});if(!j[t])return;if(!q)return true;var u=c('TextAreaControl').getInstance(o),v=u.getValue(),w=j[t],x=v.substring(0,p.start),y=v.substring(p.end);if(p.start>0&&!x.endsWith(' '))w=' '+w;if(!y.startsWith(' '))w+=' ';var z=x+w+y;p.start+=w.length;p.end=p.start;u.setValue(z);c('InputSelection').set(o,p.start,p.end);return true;}function m(n,o){var p={start:0,end:0};function q(){p=c('InputSelection').get(o);}var r=c('DOM').find(n,'.uiToggleFlyout');this._subscriptions=new (c('SubscriptionsHandler'))();this._subscriptions.addSubscriptions(c('Toggler').subscribe('show',function(s,t){if(t.active&&c('DOM').contains(n,t.active)){c('InputSelection').set(o,p.start,p.end);var u=c('DOM').scry(r,'a.emoticon')[0];u&&c('Focus').setWithoutOutline(u);}}),c('Event').listen(r,'click',function(event){l(event.getTarget(),o,p,true);}),c('Event').listen(r,'keyup',function(event){if(event.keyCode===c('Keys').ESC){c('Toggler').hide(n);c('InputSelection').set(o,p.start,p.end);}}),c('Event').listen(o,'keyup',q),c('Event').listen(o,'click',q));if(c('UserAgent_DEPRECATED').chrome()||c('UserAgent_DEPRECATED').ie()||c('UserAgent_DEPRECATED').opera())this._subscriptions.addSubscriptions(c('Event').listen(r,'mousedown',function(event){var s=c('Event').listen(document.documentElement,'click',function(event){var t=event.getTarget(),u=l(t,o,p,false),v=k(t);!u&&!v&&c('Toggler').show(n);s.remove();});}.bind(this)));}Object.assign(m.prototype,{destroy:function(){this._subscriptions&&this._subscriptions.release();this._subscriptions=null;}});Object.assign(m,{create:function(n,o){return new m(n,o);}});f.exports=m;},null);
__d('P2PAbstractSendMoneyButton.react',['cx','fbt','React','TooltipLink.react','joinClasses'],function a(b,c,d,e,f,g,h,i){'use strict';if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k=c('React').createClass({displayName:'P2PAbstractSendMoneyButton',propTypes:{button:j.object,isActive:j.bool.isRequired,isDisabled:j.bool,isMessenger:j.bool.isRequired,onClick:j.func.isRequired,onMouseOver:j.func,recipientName:j.string},_clickGuard:false,render:function(){return (c('React').createElement(c('TooltipLink.react'),{alignH:'center',className:c('joinClasses')(this.props.className,(this.props.isActive?"open":'')+(this.props.isDisabled?' '+"disabled":'')+(this.props.isActive?' '+"_10gz":'')+(this.props.isDisabled?' '+"_10g-":'')+(!this.props.isMessenger&&!this.props.className?' '+"_5uqy":'')+(this.props.isMessenger?' '+"_3ggc":'')),href:'#',onClick:this._handleClick,onMouseDown:this._prepareForClick,onMouseOver:this.props.onMouseOver,position:'above',role:'button',title:this._getLinkTitle()},this.getButton()));},getButton:function(){if(this.props.button)return this.props.button;return c('React').createElement('i',{className:"_5s8l"});},_getLinkTitle:function(){if(this.props.isDisabled)return null;return i._("Send Money");},_prepareForClick:function(){this.props.onMouseDown&&this.props.onMouseDown();this._clickGuard=this.props.isActive;},_handleClick:function(l){l.stopPropagation();if(this._clickGuard){this._clickGuard=false;return;}this.props.onClick();}});f.exports=k;},null);
__d('P2PSendMoneyContainerBootloader.react',['cx','Bootloader','CurrentEnvironment','DeferredComponent.react','MercuryIDs','MessengerContextualDialog.react','P2PAbstractSendMoneyButton.react','P2PActions','P2PLoadingMask.react','P2PLogger','P2PPaymentLoggerEvent','P2PPaymentLoggerEventFlow','P2PSendMoneyDialogStore','React','ReactLayeredComponentMixin','ReactDOM','Run','XUIContextualDialog.react','emptyFunction'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();c('P2PSendMoneyDialogStore');var i=c('React').PropTypes,j=c('CurrentEnvironment').messengerdotcom,k=c('React').createClass({displayName:'P2PSendMoneyContainerBootloader',propTypes:{button:i.node,className:i.string,flyoutAlignment:i.string,onTrigger:i.func,participantIDs:i.array,referrer:i.string,threadID:i.string},getInitialState:function(){return {showPlaceholderDialog:false};},mixins:[c('ReactLayeredComponentMixin')],_clicked:false,log:function(l,m){c('P2PLogger').log(l,babelHelpers['extends']({www_event_referrer:this.props.referrer,www_event_flow:c('P2PPaymentLoggerEventFlow').UI_FLOW_P2P_SEND},m));},onPlaceholderClick:function(){var l=this.props.threadID?c('MercuryIDs').tokenize(this.props.threadID).value:null;this._handleDialogVisibility(!this.state.showPlaceholderDialog);this.log(c('P2PPaymentLoggerEvent').UI_ACTN_SEND_MONEY_BUTTON_PLACEHOLDER_CLICKED,{object_id:l});this._clicked=false;},_handleDialogVisibility:function(l){if(!l){c('P2PActions').chatSendViewClosed({threadID:this.props.threadID});}else c('P2PActions').chatSendViewOpened({referrer:this.props.referrer,threadID:this.props.threadID});this.setState({showPlaceholderDialog:l});},renderLayers:function(){var l={};if(this.state.showPlaceholderDialog){var m=c('CurrentEnvironment').messengerdotcom,n=m?c('MessengerContextualDialog.react'):c('XUIContextualDialog.react'),o=m?282:260;l.placeholderDialog=c('React').createElement(n,{alignment:this.props.flyoutAlignment?this.props.flyoutAlignment:m?'right':'left',context:c('ReactDOM').findDOMNode(this.refs.placeholderButton),onBlur:function(){if(!this._clicked)this._handleDialogVisibility(false);this._clicked=false;}.bind(this),ref:'dialog',shown:true,width:o,position:'above'},c('React').createElement('div',{className:"_c_5"},c('React').createElement(c('P2PLoadingMask.react'),{visible:true})));}return l;},render:function(){return (c('React').createElement(c('DeferredComponent.react'),babelHelpers['extends']({deferredComponent:this._bootloadComponent,deferredPlaceholder:this._renderPlaceholder()},this.props)));},_renderPlaceholder:function(){return (c('React').createElement(c('P2PAbstractSendMoneyButton.react'),{button:this.props.button,className:this.props.className,isActive:false,isDisabled:false,isMessenger:j,onClick:this.onPlaceholderClick,onMouseDown:function(){return this._clicked=true;}.bind(this),onMouseOver:this._bootloadComponentNow,ref:'placeholderButton'}));},_bootloadComponent:function(l){c('Run').onAfterLoad(function(){c('Bootloader').loadModules(["P2PSendMoneyContainer.react"],function(){l.apply(this,arguments);this.setState({showPlaceholderDialog:false});}.bind(this));}.bind(this));},_bootloadComponentNow:function(){c('Bootloader').loadModules(["P2PSendMoneyContainer.react"],c('emptyFunction'));}});f.exports=k;},null);
__d('TabIndexDelegator',['CSS','DOM','Event','Focus','JSXDOM'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j){'use strict';this._placeholder=j||c('JSXDOM').button(null);this._placeholder.setAttribute('aria-hidden',true);c('CSS').addClass(this._placeholder,'accessible_elem');this._listener=c('Event').listen(this._placeholder,'click',function(){i.click();});c('Focus').relocate(this._placeholder,i);this.enable();}h.prototype.enable=function(){'use strict';c('CSS').show(this._placeholder);};h.prototype.disable=function(){'use strict';c('CSS').hide(this._placeholder);};h.prototype.getPlaceholder=function(){'use strict';return this._placeholder;};h.prototype.destroy=function(){'use strict';this._listener.remove();c('DOM').remove(this._placeholder);};f.exports=h;},null);
__d('UnsentMessageDialog',['fbt','Dialog','WebMessengerEvents'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={get:function(){var j=[{label:h._("Don't Send"),name:c('Dialog').OK.name},{label:h._("Stay on Message"),name:c('Dialog').CANCEL.name,className:c('Dialog').CANCEL.className}];return new (c('Dialog'))().setTitle(h._("Don't Send Message?")).setBody(h._("If you leave this page, your message won't be sent.")).setButtons(j).setCloseHandler(c('WebMessengerEvents').inform.bind(c('WebMessengerEvents'),c('WebMessengerEvents').FOCUS_COMPOSER)).setModal(true);}};f.exports=i;},null);
__d('WebMessengerDetailViewBottomShelfControl',['csx','cx','fbt','ARIA','Arbiter','AsyncDialog','AsyncRequest','BanzaiLogger','Bootloader','Button','CSS','DOM','MercuryDraftsController','WebMessengerDeleteThreadDialog','Ellipsizer','Event','Focus','MercuryFolders','Input','Keys','Locale','MercuryAPIArgsSource','MercuryBlockedParticipants','MercuryIDs','MercuryFileUploader','MercuryParticipants','MercuryPhotoUploader','MercuryReadOnlyReason','MercuryThreadIDMap','MercuryShareLinkUploader','MercurySourceType','MercuryThreadInfo','MercuryThreadActions','MercuryMessageObject','MessagesEmoticonView','MercuryMessageActions','MessagingTag','P2PSendMoneyContainerBootloader.react','PUWMethods','PagesEventObserver','PagesEventType','PhotosUploadWaterfall','WebMessengerPreferences','React','ReactComponentRenderer','ReactDOM','MercuryShareAttachmentRenderLocations','Run','Set','SiteData','WebMessengerStateConstants','WebMessengerStateManager','StickerActions','StickersFlyout.react','StickerState','StickerStoreController','Style','TabIndexDelegator','WebMessengerTemplates','TextAreaControl','MercuryThreadInformer','MercuryThreads','Toggler','UnsentMessageDialog','URI','UserAgent_DEPRECATED','VaultBoxURI','Vector','WebMessengerEvents','WebMessengerSubscriptionsHandler','WorkFileUploadsGating','XMessagingSetPreferencesController','arrayContains','isWebMessengerURI'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercuryDraftsController').get(),l=c('MercuryBlockedParticipants').get(),m=c('MercuryThreadIDMap').get(),n=c('MercuryThreadActions').get(),o=c('MercuryMessageObject').get(),p=c('MercuryMessageActions').get(),q=c('MercuryThreadInformer').get(),r=c('MercuryThreads').get(),s="_1rh";function t(za,ab){'use strict';this._manager=za;this._rootElement=ab;this._sendOnEnterDefault=c('WebMessengerPreferences').sendOnEnter;c('DOM').empty(this._rootElement);var bb=c('WebMessengerTemplates')[':fb:web-messenger:read-view:bottom-shelf'].build();c('DOM').setContent(this._rootElement,bb.getRoot());this._bottomShelfToolbar=bb.getNode('toolbar');this._bottomShelfComposer=bb.getNode('composer');this._bottomShelfButtons=bb.getNode('buttons');this._bottomPendingActions=bb.getNode('pendingActions');this._autogrowContainer=bb.getNode('autogrowContainer');this._composerBox=bb.getNode('composerTextarea');this._composerGrid=bb.getNode('composerGrid');this._sendContainer=bb.getNode('sendContainer');this._replyButton=bb.getNode('replyButton');this._uploadingWarning=bb.getNode('uploadingWarning');this._replyButtonLabel=c('DOM').find(this._sendContainer,"._1ri");this._sendOnEnterButton=bb.getNode('sendOnEnterButton');this._loadingIndicator=bb.getNode('loadingIndicator');this._cannotReplyAlert=bb.getNode('noReplyMessage');this._ariaOwns=this._composerBox.getAttribute('aria-owns');c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._autogrowContainer,'click',this.focusComposer.bind(this)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').UPDATE_SELECTION,ya.bind(null,this)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').FOCUS_COMPOSER,this.focusComposer.bind(this)));this._emoteWrapper=bb.getNode('emoteWrapper');this._p2pWrapper=bb.getNode('p2pWrapper');this._stickersFlyoutToggler=bb.getNode('emoticons');this._emoticonsPanel=new (c('MessagesEmoticonView'))(this._stickersFlyoutToggler,this._composerBox);var cb=bb.getNode('stickers');if(cb)c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Toggler').listen('show',this._stickersFlyoutToggler,function(){this._renderStickersFlyout(cb,true);}.bind(this)),c('Toggler').listen('hide',this._stickersFlyoutToggler,function(){this._renderStickersFlyout(cb,false);}.bind(this)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').STICKER_CLICKED,this._onStickerClick.bind(this)));this._messageSent=false;if(c('WorkFileUploadsGating').canUploadFiles)this._fileUploader=new (c('MercuryFileUploader'))(bb.getNode('attachmentShelf'),bb.getNode('attachButtonForm'),bb.getNode('fileInput'),bb.getNode('attachID'));this._shareLinkUploader=new (c('MercuryShareLinkUploader'))(bb.getNode('shareStage'),bb.getNode('shareStageContent'),bb.getNode('shareStageLoadingIndicator'),bb.getNode('shareStageCloseButton'),this._composerBox);c('Focus').relocate(this._replyButton,this._replyButtonLabel);this._delegator=new (c('TabIndexDelegator'))(this._replyButtonLabel);c('DOM').prependContent(this._bottomShelfToolbar,this._delegator.getPlaceholder());e(['TypingDetectorController'],function(gb){this._typingDetector=new gb(null,this._composerBox,'web-messenger',null,null);xa(this);}.bind(this));this._photoUploader=new (c('MercuryPhotoUploader'))(this._composerGrid,bb.getNode('photoButton'),c('WebMessengerSubscriptionsHandler'),bb.getNode('composer'));var db=false;c('WebMessengerSubscriptionsHandler').addSubscriptions(this._photoUploader.subscribe('dom-updated',c('WebMessengerEvents').detailDOMChanged.bind(c('WebMessengerEvents'))),this._photoUploader.subscribe('menu-show',function(gb,hb){if(!db){this.waterfallStep(c('PhotosUploadWaterfall').BEGIN,hb);db=true;}}.bind(this)),this._photoUploader.subscribe('selection-start',function(gb,hb){this.waterfallStep(c('PhotosUploadWaterfall').SELECT_START,hb);}.bind(this)),this._photoUploader.subscribe('upload-started',function(gb,hb){this.waterfallStep(c('PhotosUploadWaterfall').IMAGES_SELECTED,{method:hb.method||this._photoUploader.getCurrentMethod()});this.waterfallStep(c('PhotosUploadWaterfall').UPLOAD_START,{count:hb.imageCount});}.bind(this)),this._photoUploader.subscribe('upload-completed',function(gb,hb){var ib=this._photoUploader.getCurrentMethod();if(ib!==c('PUWMethods').FILE_SELECTOR)this.waterfallStep(c('PhotosUploadWaterfall').IMAGES_SELECTED,{method:ib});for(var jb=0;jb<hb.fbids.length;++jb)this.waterfallStep(c('PhotosUploadWaterfall').ONE_UPLOAD_DONE);this._composerBox.focus();var kb=j._("A photo has been attached to your message.");c('ARIA').notify(kb);}.bind(this)),this._photoUploader.subscribe('all-uploads-completed',function(gb,hb){if(this._blockedOnUpload){pa(this,false);ma(this);}this.waterfallStep(c('PhotosUploadWaterfall').ALL_UPLOADS_DONE,hb);}.bind(this)));var eb=c('DOM').scry(this._bottomShelfToolbar,"._6q-");eb.push(bb.getNode('sendOnEnterButtonLabel'));this._ellipsizer=new (c('Ellipsizer'))(eb);if(this._fileUploader)c('WebMessengerSubscriptionsHandler').addSubscriptions(this._fileUploader.subscribe('all-uploads-completed',function(){if(this._blockedOnUpload){pa(this,false);ma(this);}}.bind(this)),this._fileUploader.subscribe('upload-canceled',pa.bind(null,this,false)),this._fileUploader.subscribe('dom-updated',c('WebMessengerEvents').detailDOMChanged.bind(c('WebMessengerEvents'))));this._confirmationSubscription=c('WebMessengerStateManager').registerConfirmationBeforeStateUpdate(function(gb,hb,ib){if(!k.canSaveDrafts(this._threadID)&&ta(this)&&u(this,hb,ib))return c('UnsentMessageDialog').get();return false;}.bind(this));ua(this);this._prefilledMessages={};c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Arbiter').subscribe('page_transition',function(gb,hb){if(c('isWebMessengerURI')(hb.uri))ua(this);}.bind(this)),this._shareLinkUploader.subscribe('link-detected',c('WebMessengerEvents').detailDOMChanged.bind(c('WebMessengerEvents'))),this._shareLinkUploader.subscribe('closed',this.focusComposer.bind(this)),c('Arbiter').subscribe('chat/prefilled_messages_set',function(gb,hb){if(hb)this._prefilledMessages=hb;}.bind(this)));c('TextAreaControl').getInstance(this._composerBox).subscribe('resize',function(){c('WebMessengerEvents').detailDOMChanged();}.bind(this));c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._replyButtonLabel,'click',ma.bind(null,this)),c('Event').listen(this._replyButton,'keydown',z.bind(null,this)),c('Event').listen(this._composerBox,'keydown',z.bind(null,this)),c('Event').listen(this._composerBox,'paste',aa.bind(null,this)),c('Event').listen(this._sendOnEnterButton,'click',ca.bind(null,this)),c('Event').listen(bb.getNode('cancelButton'),'click',qa),c('Event').listen(bb.getNode('deleteButton'),'click',ra.bind(null,this)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').DETAIL_DOM_CHANGED,ba.bind(null,this)));c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(bb.getNode('deletePendingButton'),'click',function(){n.changeFolder(this._threadID,c('MessagingTag').OTHER);c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,c('WebMessengerStateManager').getCurrentStateData());}.bind(this)),c('Event').listen(bb.getNode('replyPendingButton'),'click',function(){n.changeFolder(this._threadID,c('MessagingTag').INBOX);c('CSS').hide(this._bottomPendingActions);c('CSS').show(this._bottomShelfComposer);c('CSS').removeClass(this._bottomShelfComposer,'invisible_elem');}.bind(this)));c('WebMessengerSubscriptionsHandler').addSubscriptions(q.subscribe('threads-updated',function(gb,hb){hb[this._threadID]&&this.updateView();}.bind(this)));this._replySet=new (c('Set'))();var fb=new (c('URI'))(window.location.href);this._uriData=fb.getQueryData();this._shouldLogMessageSend=!!this._uriData.loggedoutpage;}t.prototype._renderStickersFlyout=function(za,ab){'use strict';this._stickersFlyout=c('ReactDOM').render(c('React').createElement(c('StickersFlyout.react'),{onStickerSelect:function(bb){return la(this,bb);}.bind(this),shown:ab}),za);};t.prototype._logMessageSend=function(){'use strict';c('PagesEventObserver').notify(c('PagesEventType').MESSAGES_SEND_ENTRY_POINT,this._uriData.loggedoutpage,{was_logged_out:true});};t.prototype._onStickerClick=function(za,ab){'use strict';if(!ab||!ab.packID)return;var bb=ab.packID,cb=ab.stickerID;c('BanzaiLogger').log('StickersLoggerConfig',{event:'click_sticker',packid:bb,stickerid:cb});c('StickerState').onTrayDataReady(function(){if(c('arrayContains')(c('StickerState').getPackIDsInTray(),bb)){var db=c('StickerState').getPack(bb);if(db&&db.isPromoted)c('StickerActions').addPack(bb);var eb=this._stickersFlyoutToggler;if(!eb)return;c('Toggler').show(eb);c('StickerActions').selectPack(bb);}else c('StickerStoreController').showStore(bb);}.bind(this));};t.prototype.waterfallStep=function(za,ab){'use strict';var bb=this._photoUploader.getWaterfallID();if(!bb)return;c('PhotosUploadWaterfall').sendSignal(babelHelpers['extends']({qn:bb,step:za,uploader:c('PhotosUploadWaterfall').APP_MESSENGER},ab||{}));};t.prototype.hideView=function(){'use strict';c('CSS').hide(this._rootElement);};t.prototype.updateView=function(){'use strict';var za=c('WebMessengerStateManager').getCurrentDetailState();c('CSS').show(this._rootElement);var ab=c('WebMessengerStateManager').getCurrentStateData();u(this,za,ab)&&oa(this);c('CSS').hide(this._bottomShelfComposer);c('CSS').removeClass(this._bottomShelfComposer,'invisible_elem');c('CSS').hide(this._bottomShelfButtons);c('CSS').show(this._sendOnEnterButton);c('CSS').hide(this._cannotReplyAlert);ea(this,this._sendOnEnterDefault);switch(za){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:this._threadID=ab.thread_id;if(ab.message_action==c('WebMessengerStateConstants').MESSAGE_ACTION.DELETE){c('CSS').hide(this._bottomPendingActions);va(this,ab.message_action);}else if(this._threadID)r.getThreadMeta(this._threadID,function(bb){if(!this._replySet.has(this._threadID)&&bb&&bb.folder===c('MessagingTag').PENDING){wa(this);}else if(c('MercuryThreadInfo').showComposer(bb)){c('CSS').show(this._bottomShelfComposer);k.loadDraft(this._threadID,this._composerBox,this._fileUploader,this._shareLinkUploader,this._photoUploader);this._shareLinkUploader.check();}else{c('ReactDOM').render(c('React').createElement('span',null,c('MercuryReadOnlyReason').getReason(bb)),this._cannotReplyAlert);c('CSS').show(this._cannotReplyAlert);}y(this,bb);w(this,bb);}.bind(this));break;case c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN:this._threadID=null;c('CSS').show(this._bottomShelfComposer);x(this,ab.participants);y(this,null);w(this);break;default:this._threadID=null;break;}v(this,za,ab);xa(this);c('WebMessengerEvents').detailDOMChanged();this._state=za;};t.prototype.focusComposer=function(){'use strict';this._composerBox.focus();};t.prototype.submitReply=function(){'use strict';ma(this);};t.prototype.destroy=function(){'use strict';this._emoticonsPanel&&this._emoticonsPanel.destroy();this._fileUploader&&this._fileUploader.destroy();c('WebMessengerStateManager').unregisterConfirmationBeforeStateUpdate(this._confirmationSubscription);if(this._sendMoneyDialogStoreSub){this._sendMoneyDialogStoreSub.remove();this._sendMoneyDialogStoreSub=null;}if(this._p2pButton)this._p2pButton.unmount();};t.prototype.getStickersFlyoutToggler=function(){'use strict';return this._stickersFlyoutToggler;};function u(za,ab,bb){switch(ab){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:return !bb.reuse_composer&&(za._threadID!=bb.thread_id||za._state!=ab);case c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN:return bb.start;case c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET:case c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET:case c('WebMessengerStateConstants').DETAIL.SHARED_PHOTOS:return true;}return false;}function v(za,ab,bb){var cb=bb.participants&&bb.participants.length>0;c('CSS').conditionClass(za._replyButtonLabel,'uiButtonDisabled',ab==c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN&&!cb);}function w(za,ab){var bb=ab&&ab.thread_id;if(!za._p2pWrapper)return;if(!bb){c('CSS').addClass(za._p2pWrapper,'invisible_elem');if(za._p2pButton)za._p2pButton.setProps({sendMoneyDialogShown:false});return;}c('CSS').removeClass(za._p2pWrapper,'invisible_elem');if(!za._p2pButton){za._p2pButton=new (c('ReactComponentRenderer'))(c('P2PSendMoneyContainerBootloader.react'),za._p2pWrapper);za._p2pButton.setProps({referrer:c('MercuryShareAttachmentRenderLocations').WEB_INBOX});}if(za._p2pButton)za._p2pButton.setProps({threadID:bb});}function x(za,ab){var bb,cb='';if(ab&&ab.length===1){bb=c('MercuryIDs').getUserIDFromParticipantID(ab[0]);cb=za._prefilledMessages[bb];}c('Input').setValue(za._composerBox,cb);}function y(za,ab){var bb,cb;if(!ab){bb=j._("Send");cb=j._("Write a message...");}else if(ab.participants&&ab.participants.length<=2){bb=j._("Reply");cb=j._("Write a reply...");}else{bb=j._("Reply All");cb=j._("Write a reply...");}if(za._composerBox.getAttribute('placeholder')!=cb)c('Input').setPlaceholder(za._composerBox,cb&&cb.toString());c('Button').setLabel(za._replyButton,bb);ha(za);}function z(za,event){var ab=event.getModifiers();if(ab.any&&event.keyCode!==c('Keys').RETURN)return;var bb=false;switch(event.keyCode){case c('Keys').ESC:var cb=za.getStickersFlyoutToggler();c('Toggler').hide(cb);return;case c('Keys').SPACE:bb=event.getTarget()===za._replyButton;break;case c('Keys').RETURN:var db=!c('CSS').hasClass(za._bottomShelfComposer,s),eb=event.getTarget()===za._replyButton,fb=false;if(!db){if(c('UserAgent_DEPRECATED').windows()){fb=ab.control;}else if(c('UserAgent_DEPRECATED').osx()){fb=ab.meta;}else fb=ab.control||ab.meta;}else if(event.getModifiers().any)return;bb=eb||db||fb;break;case c('Keys').UP:case c('Keys').DOWN:var gb=c('WebMessengerStateManager').getCurrentDetailState();if(za._composerBox.value||gb!=c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES)event.stop();break;}if(bb){ma(za);za.focusComposer();return false;}}function aa(za,event){if(c('UserAgent_DEPRECATED').chrome()){var ab=event.clipboardData||event.originalEvent.clipboardData;if(!ab||!ab.items||ab.items.length<1)return;var bb=ab.items[0].type;if(bb!=='image/png')return;if(ab.items[0].getAsFile){var cb=ab.items[0].getAsFile();za._photoUploader.uploadPastedFile(cb);}}}function ba(za){fa(za);}function ca(za){da(za);var ab=!za._sendOnEnterDefault;za.focusComposer();za._sendOnEnterDefault=ab;c('WebMessengerPreferences').sendOnEnter=ab;var bb=c('XMessagingSetPreferencesController').getURIBuilder().setBool('send_on_enter',ab).getURI();new (c('AsyncRequest'))(bb).send();}function da(za){c('CSS').toggleClass(za._bottomShelfComposer,s);if(c('CSS').hasClass(za._bottomShelfComposer,s)){za._sendOnEnterButton.setAttribute('aria-checked','false');}else za._sendOnEnterButton.setAttribute('aria-checked','true');ha(za,true);c('WebMessengerEvents').detailDOMChanged();}function ea(za,ab){if(ab==c('CSS').hasClass(za._bottomShelfComposer,s))da(za);}function fa(za){var ab;if(c('CSS').hasClass(za._bottomShelfComposer,s)){ab=ga(za);}else ab=0;var bb=c('Vector').getElementDimensions(za._bottomShelfToolbar).x;za._ellipsizer.confineWithin(bb-ab-120,1.3);}function ga(za){return c('Vector').getElementDimensions(za._replyButtonLabel).x+20;}function ha(za,ab){var bb='',cb='';if(!c('CSS').hasClass(za._bottomShelfComposer,s)){cb=ga(za)+'px';bb='-1';za._delegator.disable();}else za._delegator.enable();c('CSS').conditionClass(za._sendContainer,'transition',ab);za._replyButton.setAttribute('tabindex',bb);c('Style').set(za._sendContainer,c('Locale').isRTL()?'right':'left',cb);}function ia(){var za=new (c('URI'))(window.location.href).getQueryData();if(za.source===c('MercurySourceType').PAGES_MESSAGE_SHORTLINK)return c('MercurySourceType').PAGES_MESSAGE_SHORTLINK;return c('MercurySourceType').TITAN_WEB;}function ja(za){var ab=c('WebMessengerStateManager').getCurrentStateData(),bb=o.constructUserGeneratedMessageObject(c('Input').getValue(za._composerBox),ia(),ab.thread_id,ab.participants);if(za._fileUploader){var cb=za._fileUploader.getAttachments();if(cb&&cb.length){bb.has_attachment=true;bb.raw_attachments=cb;}}var db=za._photoUploader.getSelectedFBIDs();if(db.length>0){bb.has_attachment=true;bb.photo_fbids=db;}if(za._fileUploader){var eb=za._fileUploader.getImageFiles();if(eb.length>0){bb.has_attachment=true;bb.image_ids=eb;}var fb=za._fileUploader.getAnimatedImageFiles();if(fb.length>0){bb.has_attachment=true;bb.gif_ids=fb;}var gb=za._fileUploader.getVideoFiles();if(gb.length>0){bb.has_attachment=true;bb.video_ids=gb;}var hb=za._fileUploader.getAudioFiles();if(hb.length>0){bb.has_attachment=true;bb.audio_ids=hb;}var ib=za._fileUploader.getFiles();if(ib.length>0){bb.has_attachment=true;bb.file_ids=ib;}}if(za._shareLinkUploader.getAttachData()){bb.has_attachment=true;bb.content_attachment=za._shareLinkUploader.getAttachData();}bb.force_sms=true;bb.ui_push_phase=c('SiteData').push_phase;return bb;}function ka(za,ab,bb){var cb=za._threadID&&r.getThreadMetaNow(za._threadID);if(cb&&cb.is_canonical&&!c('MercuryThreadInfo').canReply(cb)){na(za._threadID,cb);if(c('CSS').hasClass(za._bottomShelfComposer,s)){c('CSS').hide(za._loadingIndicator);c('CSS').show(za._replyButtonLabel);za._composerBox.removeAttribute('disabled');}return;}za.waterfallStep(c('PhotosUploadWaterfall').SESSION_POSTED);if(za._threadID)za._replySet.add(za._threadID);za._sendSubscription=p.send(ab,function(db){za.waterfallStep(c('PhotosUploadWaterfall').POST_PUBLISHED);if(!bb){k.clearDraft(db);oa(za);}za._messageSent=true;if(za._shouldLogMessageSend)za._logMessageSend();var eb=za.getStickersFlyoutToggler(),fb=false;if(eb)fb=c('Toggler').isShown(eb);var gb=c('MercuryFolders').getFromMeta(r.getThreadMetaNow(db));if(gb===c('MessagingTag').PENDING)n.movePendingToInbox(db);var hb=c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES;if(c('WebMessengerStateManager').getCurrentDetailState()!==hb)c('WebMessengerStateManager').updateDetailState(hb,{thread_id:db,folder:gb,reuse_composer:bb});za._messageSent=false;if(eb&&fb)c('Toggler').show(eb);},c('MercuryAPIArgsSource').WEBMESSENGER);za.focusComposer();}function la(za,ab){var bb=c('WebMessengerStateManager').getCurrentStateData(),cb=o.constructUserGeneratedMessageObject('',c('MercurySourceType').TITAN_WEB,bb.thread_id,bb.participants);if(!cb.thread_id&&!cb.specific_to_list.length)return;cb.has_attachment=true;cb.sticker_id=ab;ka(za,cb,true);}function ma(za){if(za._fileUploader&&za._fileUploader.isUploading()||za._photoUploader.isUploading()){pa(za,true);return;}var ab=ja(za),bb=c('Input').isEmpty(za._composerBox);if(bb&&!ab.has_attachment||!ab.thread_id&&!ab.specific_to_list.length)return;if(c('CSS').hasClass(za._bottomShelfComposer,s)){c('CSS').show(za._loadingIndicator);c('CSS').hide(za._replyButtonLabel);za._composerBox.setAttribute('disabled','disabled');}ka(za,ab);}function na(za,ab){var bb=c('MercuryIDs').getParticipantIDFromFromThreadID(za);c('MercuryParticipants').get(bb,function(cb){c('Bootloader').loadModules(["MessageBlockedDialog"],function(db){db.show(ab.thread_id,ab.can_reply,l.isMessageBlocked(ab),cb.short_name);});});}function oa(za){c('Input').reset(za._composerBox);za._typingDetector&&za._typingDetector.resetState();za._fileUploader&&za._fileUploader.removeAttachments();za._shareLinkUploader.clear();if(za._photoUploader.getSelectedFBIDs().length>0)za._photoUploader.clear();c('CSS').hide(za._loadingIndicator);c('CSS').show(za._replyButtonLabel);za._composerBox.removeAttribute('disabled');if(za._sendSubscription)za._sendSubscription=null;pa(za,false);}function pa(za,ab){c('CSS').conditionShow(za._uploadingWarning,ab);za._blockedOnUpload=ab;}function qa(){var za=c('WebMessengerStateManager').getCurrentDetailState(),ab=c('WebMessengerStateManager').getCurrentStateData();delete ab.message_action;c('WebMessengerStateManager').updateDetailState(za,ab);}function ra(za){var ab=za._manager.getSelectedMessageIDs().length;c('AsyncDialog').send(new (c('AsyncRequest'))('/ajax/mercury/delete_messages_dialog.php').setData({count:ab}),function(bb){bb.subscribe('confirm',sa.bind(null,za,bb));});}function sa(za,ab){var bb=za._manager.getSelectedMessageIDs();p['delete'](za._threadID,bb);ab.hide();var cb=c('WebMessengerStateManager').getCurrentStateData();if(cb.message_action){var db=babelHelpers['extends']({},cb);delete db.message_action;c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateManager').getCurrentDetailState(),db);}}function ta(za){if(za._messageSent)return false;if(!c('Input').isEmpty(za._composerBox))return true;if(za._fileUploader){var ab=za._fileUploader.getAttachments();if(ab&&ab.length||za._fileUploader.getImageFiles().length>0||za._fileUploader.getAnimatedImageFiles().length>0||za._fileUploader.getVideoFiles().length>0||za._fileUploader.getAudioFiles().length>0||za._fileUploader.getFiles().length>0||za._shareLinkUploader.getAttachData()||za._photoUploader.getSelectedFBIDs().length>0)return true;}var bb=c('WebMessengerStateManager').getCurrentStateData(),cb=c('WebMessengerStateManager').getCurrentDetailState(),db=cb==c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN||cb==c('WebMessengerStateConstants').DETAIL.COMPOSE_TYPEAHEAD_RESULTS||cb==c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS;if(db&&!bb.start&&(bb.participants||[]).length)return true;return false;}function ua(za){c('Run').onBeforeUnload(function(){var ab=c('URI').getNextURI();if(!ab.getQueryData().hasOwnProperty('theater')&&!c('VaultBoxURI').isVaultBoxURI(ab))k.saveDraft(za._threadID,za._composerBox,za._fileUploader,za._shareLinkUploader,za._photoUploader);if(!c('isWebMessengerURI')(ab)&&!ab.getQueryData().hasOwnProperty('theater')&&!c('VaultBoxURI').isVaultBoxURI(ab)&&ta(za))return j._("You haven't sent your message.");},true);c('Run').onBeforeUnload(function(){if(c('isWebMessengerURI')(c('URI').getNextURI())&&ta(za))return j._("You haven't sent your message.");},false);c('Run').onUnload(function(){k.saveDraft(za._threadID,za._composerBox,za._fileUploader,za._shareLinkUploader,za._photoUploader);});}function va(za,ab){c('CSS').show(za._bottomShelfComposer);c('CSS').addClass(za._bottomShelfComposer,'invisible_elem');c('CSS').conditionClass(za._bottomShelfButtons,'delete',ab==c('WebMessengerStateConstants').MESSAGE_ACTION.DELETE);c('CSS').show(za._bottomShelfButtons);}function wa(za){c('CSS').show(za._bottomShelfComposer);c('CSS').addClass(za._bottomShelfComposer,'invisible_elem');c('CSS').show(za._bottomPendingActions);}function xa(za){if(za._typingDetector){var ab=za._threadID,bb=null;if(ab){bb=c('MercuryIDs').getUserIDFromThreadID(ab);var cb=r.getThreadMetaNow(ab);if((!cb||cb.is_canonical)&&!bb)ab=null;}if(!ab){za._typingDetector.setUserAndThread(bb,ab);return;}m.getServerIDFromClientID(ab,function(db){za._typingDetector.setUserAndThread(bb,db);});}}function ya(za,ab,bb){if(c('DOM').contains(za._ariaOwns,bb))za._composerBox.setAttribute('aria-activedescendant',bb);}f.exports=t;},null);
__d('MercuryThreadMetadataRawRenderer',['cx','fbt','Event','CSS','DOM','MercuryActionStatus','MercuryErrorInfo','MercuryStatusTemplates','TooltipData'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={renderParticipantListWithNoThreadName:function(k,l,m,n,o,p){var q={callback:true,check_length:true,show_unread_count:true};p=p||{};var r={};for(var s in p)if(q[s]){r[s]=p[s];delete p[s];}var t=m.map(function(y){return n[y];}),u=this.renderRawParticipantList(k,t,m.length,p);u=this.renderRawTitleWithUnreadCount(u,r.show_unread_count?l.unread_count:0);var v=p.abbr_mode,w={};for(var x in p)w[x]=p[x];w.abbr_mode=true;o.forEach(function(y){var z=o.length>1?this._cloneIfDOMElement(u):u;c('DOM').setContent(y,z);if(r.check_length&&!v&&y.scrollWidth>y.clientWidth){var aa=this.renderRawParticipantList(k,t,m.length,w),ba=this.renderRawTitleWithUnreadCount(aa,r.show_unread_count?l.unread_count:0);c('DOM').setContent(y,ba);}}.bind(this));r.callback&&r.callback(u);},renderRawParticipantList:function(k,l,m,n){var o={abbr_mode:true,last_separator_uses_and:true,names_renderer:true};n=n||{};var p=null;if(n.names_renderer){p=n.names_renderer(l);}else p=l.map(function(r){return r.name;});var q=null;if(p.length===0){if(!k){q=i._("New Message");}else q=i._("No Participants");}else if(p.length==1){q=p[0];}else if(p.length==2){if(n.last_separator_uses_and){q=i._("{participant1} and {participant2}",[i.param('participant1',p[0]),i.param('participant2',p[1])]);}else q=i._("{participant1}, {participant2}",[i.param('participant1',p[0]),i.param('participant2',p[1])]);}else if(n.last_separator_uses_and){if(n.abbr_mode){q=i._("{participant1} and {others_link}",[i.param('participant1',p[0]),i.param('others_link',this.renderRawParticipantCount({render_subset:true,count:m-1}))]);}else if(p.length==3){q=i._("{participant1}, {participant2} and {participant3}",[i.param('participant1',p[0]),i.param('participant2',p[1]),i.param('participant3',p[2])]);}else q=i._("{participant1}, {participant2} and {others_link}",[i.param('participant1',p[0]),i.param('participant2',p[1]),i.param('others_link',this.renderRawParticipantCount({render_subset:true,count:m-2}))]);}else if(p.length==3){q=i._("{participant1}, {participant2}, {participant3}",[i.param('participant1',p[0]),i.param('participant2',p[1]),i.param('participant3',p[2])]);}else q=i._("{participant1}, {participant2}, {participant3}, {others_link}",[i.param('participant1',p[0]),i.param('participant2',p[1]),i.param('participant3',p[2]),i.param('others_link',this.renderRawParticipantCount({render_subset:true,count:m-3}))]);if(Array.isArray(q))q=c('DOM').create('span',{},q);return q;},renderRawTitleWithUnreadCount:function(k,l){var m=k;if(l&&l>1)m=c('DOM').create('span',{},i._("{conversation_title} ({unread_count})",[i.param('conversation_title',k),i.param('unread_count',l)]));return m;},renderRawParticipantCount:function(k){var l=k.render_subset,m;if(!l){m=k.count>1?i._({"*":"{num} people"},[i.param('num',k.count,[0])]):i._("1 person");}else m=k.count>1?i._({"*":"{others_count} others"},[i.param('others_count',k.count,[0])]):i._("1 other");return m;},renderShortNames:function(k){if(k.length==1)return [k[0].name];return k.map(function(l){return l.short_name;});},renderStatusIndicator:function(k,l,m){var n;if(k==c('MercuryActionStatus').RESENDING){n=this.renderResendIndicator();}else if(k!==undefined&&k!=c('MercuryActionStatus').UNSENT&&k!=c('MercuryActionStatus').UNCONFIRMED&&k!=c('MercuryActionStatus').SUCCESS)n=this.renderErrorIndicator(l,m);return n;},renderResendIndicator:function(){return c('MercuryStatusTemplates')[':fb:mercury:resend-indicator'].render();},renderErrorIndicator:function(k,l){if(!k)return null;var m=c('MercuryStatusTemplates')[':fb:mercury:error-indicator'].render(),n=k.is_transient,o=c('MercuryErrorInfo').getMessage(k);if(n)if(c('MercuryErrorInfo').isConnectionError(k)){o=i._("{message} Check your internet connection and click to try again.",[i.param('message',o)]);}else o=i._("{message} Click to send again.",[i.param('message',o)]);c('TooltipData').set(m,o,'above','center');if(l&&n){c('Event').listen(m,'click',l);m.setAttribute('tabindex','0');c('CSS').addClass(m,"_55q-");}return m;},_cloneIfDOMElement:function(k){if(k&&k.cloneNode){return k.cloneNode();}else return k;}};f.exports=j;},null);
__d('MNAdsLogMessageUtils',['MercuryConfig','MessagingTag','MessengerAdsWebTypedLogger','MNAdsLoggerEventEnum','AdPageMessageTypeEnum'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('MercuryConfig').LOG_INTERVAL_MS||60000;function i(){this.$MNAdsLogMessageUtils1={};}i.prototype.isLoggedWithinInterval=function(j){if(this.$MNAdsLogMessageUtils1[j]&&this.$MNAdsLogMessageUtils1[j]-Date.now()<h)return true;return false;};i.prototype.setLoggingTime=function(j){this.$MNAdsLogMessageUtils1[j]=Date.now();};i.prototype.logAdsThreadListImpression=function(j){switch(j.folder){case c('MessagingTag').INBOX:this.logWithThreadMetaData(j,c('MNAdsLoggerEventEnum').MESSAGE_SEEN_INBOX);break;case c('MessagingTag').PENDING:this.logWithThreadMetaData(j,c('MNAdsLoggerEventEnum').MESSAGE_SEEN_REQUEST);break;default:return;}};i.prototype.logWithThreadMetaData=function(j,event){if(j.last_message_type!==c('AdPageMessageTypeEnum').NON_AD){var k=j.last_message_timestamp+String(event);if(this.isLoggedWithinInterval(k))return;new (c('MessengerAdsWebTypedLogger'))().setEvent(event).setMessageTimestamp(j.last_message_timestamp).setPageID(j.other_user_fbid).log();this.setLoggingTime(k);}};f.exports=new i();},null);
__d('MercurySeenByAll',['CSS','DataStore','MercuryDelayedRoger','DOM','MercuryIDs','MercuryViewer','MercuryThreads'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryThreads').get(),i={},j={updateOnSeenChange:function(l,m,n){i[l.tagName]=true;c('DataStore').set(l,'thread-id',m.thread_id);c('CSS').addClass(l,'seenByListener');k(l,m,n);}};function k(l,m,n){var o=null;if(n){o=c('MercuryIDs').getParticipantIDFromUserID(n);}else o=c('MercuryViewer').getID();var p=m.participants.filter(function(r){return r!==o;}),q=m.participants.length>0&&m.participants[0]===o;c('CSS').conditionClass(l,'repliedLast',q);c('CSS').conditionClass(l,'seenByAll',q&&c('MercuryDelayedRoger').getSeenBy(m.thread_id).length===p.length);}c('MercuryDelayedRoger').subscribe('state-changed',function(l,m){for(var n in i){var o=c('DOM').scry(document.body,n+'.seenByListener');for(var p=0;p<o.length;p++){var q=o[p],r=c('DataStore').get(q,'thread-id');if(m[r])h.getThreadMeta(r,function(s){k(q,s);});}}});f.exports=j;},null);
__d('MercuryThreadMetadataRenderer',['cx','fbt','CSS','DOM','Emoji','HTML','JSLogger','MercuryAttachmentType','MercuryIDs','MercuryMessageSourceTags','MercurySingletonMixin','MercuryThreadImage.react','MercuryThreadIDMap','MercuryThreadMetadataRawRenderer','MercuryThreadTitle.react','MNAdsLogMessageUtils','MNAdsMessageUtils','MercuryParticipants','React','ReactDOM','MercurySeenByAll','MercuryServerRequests','Style','MercuryThreads','Tooltip','URI','WebMessengerThreadPermalinks','arrayContains','createArrayFromMixed','formatDate'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('JSLogger').create('wm_timestamp');function k(p){this._fbid=p;this._serverRequests=c('MercuryServerRequests').getForFBID(p);this._threads=c('MercuryThreads').getForFBID(p);this._threadIDMap=c('MercuryThreadIDMap').getForFBID(p);}Object.assign(k,c('MercurySingletonMixin'));Object.assign(k.prototype,{renderTimestamp:function(p,q,r,s){if(s){if(!q){j.warn('no_title');q=new Date(s).toLocaleDateString();}p.setAttribute('title',q);p.setAttribute('data-utime',s/1000);if(!r){j.warn('no_display');r=c('formatDate')(new Date(s),'g:ia');}c('DOM').setContent(p,r);c('CSS').show(p);}},renderMessageSourceTags:function(p,q,r,s){var t='',u='',v='';if(c('arrayContains')(r,c('MercuryMessageSourceTags').MESSENGER)){t=i._("Sent from Messenger");u=new (c('URI'))('/mobile/messenger');v="_9g";}else if(c('arrayContains')(r,c('MercuryMessageSourceTags').MOBILE)){t=i._("Sent from Mobile");u=new (c('URI'))('/mobile/');v="_9j";}else if(c('arrayContains')(r,c('MercuryMessageSourceTags').CHAT)){t=i._("Sent from chat");v="_9h";}else if(c('arrayContains')(r,c('MercuryMessageSourceTags').EMAIL)){if(s){t=i._("Sent from {email}",[i.param('email',s)]);}else t=i._("Sent from email");v="_9i";}if(v){c('Tooltip').set(p,t);c('CSS').addClass(q,v);if(u){p.setAttribute('href',u);}else p.removeAttribute('href');}else c('CSS').hide(p);},renderSpoofWarning:function(p,q,r){if(q){c('CSS').addClass(p,"_sa");c('Tooltip').set(p,i._("Unable to confirm {name_or_email} as the sender.",[i.param('name_or_email',r.name)]));}},renderChatSpoofWarning:function(p,q,r){if(q)c('DOM').appendContent(p,i._("Unable to confirm {name_or_email} as the sender.",[i.param('name_or_email',r.name)]));},renderAdsMessageRequestStatus:function(p,q){if(q)c('ReactDOM').render(q,p);c('CSS').show(p);},renderCoreThreadlist:function(p,q,r,s,t){s=s||{};this.renderThreadImage(p,q.getNode('image'));var u=q.getNode('accessibleName'),v=[q.getNode('name')];if(u)v.push(u);o(this,p,v,s);if(p.folder&&t)n(q.getNode('folderBadge'),p.folder);var w=q.getNode('timestamp');if(c('MNAdsMessageUtils').isAdsMessageRequest(p)){this.renderAdsMessageRequestStatus(w,c('MNAdsMessageUtils').renderAdsMessageRequestStatus());}else this.renderTimestamp(w,p.timestamp_absolute,p.timestamp_relative,p.timestamp);this.renderSnippet(p,q.getNode('snippet'));m(q,p);r(q,p);},renderAndSeparatedParticipantList:function(p,q,r){r=r||{};r.last_separator_uses_and=true;this._threads.getThreadMeta(p,function(s){o(this,s,q,r);}.bind(this));},renderSnippet:function(p,q){var r=false,s=c('DOM').create('span');c('CSS').addClass(s,"_3jy5");c('DOM').appendContent(q,s);c('MercurySeenByAll').updateOnSeenChange(s,p,this._fbid);c('MNAdsLogMessageUtils').logAdsThreadListImpression(p);var t=p.snippet;if(t){if(p.snippet_has_attachment)c('DOM').appendContent(q,c('DOM').create('span',{className:"_j0r"}));if(t.substr(0,4)=='?OTR'){t=i._("[encrypted message]");}else t=t.replace(/\r\n|[\r\n]/g," ");t=c('HTML')(c('Emoji').htmlEmojiAndEmote(t));}else if(p.snippet_has_attachment&&p.snippet_attachments&&p.snippet_attachments.length){r=true;t=c('DOM').create('span');e(['MercuryAttachmentSnippet.react'],function(w){c('ReactDOM').render(c('React').createElement(w,{thread:p,viewer:this._fbid}),t);}.bind(this));}var u=p.participants.length;if(p.is_subscribed)u--;var v=p.snippet_sender;if(!r&&v&&c('MercuryIDs').getParticipantIDFromUserID(this._fbid)!=v&&u>1){c('MercuryParticipants').get(v,function(w){if(w.short_name){c('DOM').appendContent(q,i._("{name}: {conversation_snippet}",[i.param('name',w.short_name),i.param('conversation_snippet',t)]));}else c('DOM').appendContent(q,t);});}else c('DOM').appendContent(q,t);},renderWebMessengerLink:function(p,q,r,s){c('WebMessengerThreadPermalinks').getThreadURI(p,function(t){q.setAttribute('href',t);r&&r();},s);},renderThreadImage:function(p,q){c('ReactDOM').render(c('React').createElement(c('MercuryThreadImage.react'),{thread:p,viewer:this._fbid}),q);},renderParticipantList:function(p,q,r,s){return c('MercuryThreadMetadataRawRenderer').renderRawParticipantList(this._threadIDMap.getServerIDFromClientIDNow(p),q,r,s);},renderThreadNameAndParticipantList:function(p,q,r,s){var t=c('MercuryThreadMetadataRawRenderer').renderRawParticipantList(this._threadIDMap.getServerIDFromClientIDNow(p),q,r,s),u=this._threads.getThreadMetaNow(p);if(!u.name)return t;return i._("{conversation_name} [with {participant_list}]",[i.param('conversation_name',u.name),i.param('participant_list',t)]);},renderParticipantCount:function(p,q){return c('MercuryThreadMetadataRawRenderer').renderRawParticipantCount(q);}});function l(p){if(!p.snippet_attachments)return [];return p.snippet_attachments.filter(function(q){return q.attach_type===c('MercuryAttachmentType').PHOTO;});}function m(p,q){var r=l(q);if(r.length===0)return;var s=r[0].thumbnail_url;if(!s)return;var t=r.length==1?'snippet-thumbnail-single':'snippet-thumbnail-multiple',u=p.getNode(t);if(!u)return;var v=c('DOM').find(u,'i');c('Style').set(v,'background-image','url('+s+')');c('CSS').show(u);}function n(p,q){c('createArrayFromMixed')(p).forEach(function(r){c('DOM').setContent(r,q);});}function o(p,q,r,s){r=c('createArrayFromMixed')(r);var t=p._fbid;if(q.name){r.forEach(function(v){c('ReactDOM').render(c('React').createElement(c('MercuryThreadTitle.react'),{thread:q,viewer:t,showUnreadCount:!!s.show_unread_count}),v);});return;}var u=q.participants;if(q.participants.length>1)u=q.participants.filter(function(v){return v!=c('MercuryIDs').getParticipantIDFromUserID(t);});c('MercuryParticipants').getMulti(u,function(v){c('MercuryThreadMetadataRawRenderer').renderParticipantListWithNoThreadName(p._threadIDMap.getServerIDFromClientIDNow(q.thread_id),q,u,v,r,s);});}f.exports=k;},null);
__d('MercuryDataSourceHelper',['MercuryPayloadSource','MercuryTypeaheadConstants','MercuryServerPayloadPreprocessor','MercuryThreadMetadataRawRenderer','MercuryThreadMetadataRenderer'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryServerPayloadPreprocessor').get(),i=c('MercuryThreadMetadataRenderer').get(),j={updateMercuryOnFetchComplete:function(k){k.subscribe('fetchComplete',function(l,m){var n={participants:[],threads:[],pages:[],payload_source:c('MercuryPayloadSource').SERVER_SEARCH};m.response.getPayload().entries.forEach(function(o){if(o.type==c('MercuryTypeaheadConstants').THREAD_TYPE){n.threads=n.threads.concat(o.mercury_thread);n.participants=n.participants.concat(o.participants_to_render);}else if(o.type==c('MercuryTypeaheadConstants').PAGE_TYPE)n.pages=n.pages.concat(o);});if(n.threads.length){h.handleUpdate(n);m.response.getPayload().entries.forEach(function(o){if(o.mercury_thread)o.text=i.renderThreadNameAndParticipantList(o.mercury_thread.thread_id,o.participants_to_render,o.mercury_thread.participants.length,{last_separator_uses_and:false,names_renderer:c('MercuryThreadMetadataRawRenderer').renderShortNames});});}});}};f.exports=j;},null);
__d('WebMessengerComposerTypeaheadView',['cx','fbt','BucketedTypeaheadView','CSS','DataStore','MercuryTypeaheadConstants','WebMessengerStateConstants','WebMessengerStateManager'],function a(b,c,d,e,f,g,h,i){var j,k;if(c.__markCompiled)c.__markCompiled();j=babelHelpers.inherits(l,c('BucketedTypeaheadView'));k=j&&j.prototype;function l(p,q){'use strict';k.constructor.call(this,p,q);this.typeObjects={};this.typeObjects[c('MercuryTypeaheadConstants').FRIEND_TYPE]={disabled:true,uid:c('MercuryTypeaheadConstants').FRIEND_TYPE,type:c('MercuryTypeaheadConstants').HEADER_TYPE};this.typeObjects[c('MercuryTypeaheadConstants').THREAD_TYPE]={uid:c('MercuryTypeaheadConstants').THREAD_TYPE,text:i._("Group Conversations"),type:c('MercuryTypeaheadConstants').HEADER_TYPE,linkText:i._("Show More"),getLinkHandler:o.bind(null,this)};this.typeObjects[c('MercuryTypeaheadConstants').PAGE_TYPE]={uid:c('MercuryTypeaheadConstants').PAGE_TYPE,text:i._("Businesses"),type:c('MercuryTypeaheadConstants').HEADER_TYPE};this.typeObjects[c('MercuryTypeaheadConstants').FB4C_TYPE]={uid:c('MercuryTypeaheadConstants').THREAD_TYPE,text:i._("Coworkers"),type:c('MercuryTypeaheadConstants').HEADER_TYPE};this.typeObjects[c('MercuryTypeaheadConstants').NON_FRIEND_TYPE]={uid:c('MercuryTypeaheadConstants').NON_FRIEND_TYPE,text:i._("Other People"),type:c('MercuryTypeaheadConstants').HEADER_TYPE,linkText:i._("Show All"),getLinkHandler:function(){return function(){n(this.value);}.bind(this);}.bind(this)};}l.prototype.setTypeahead=function(p){'use strict';k.setTypeahead.call(this,p);var q=c('DataStore').get(p,'Typeahead');q.subscribe('loading',function(r,s){var t=q.getData();if(this._threadHeader)c('CSS').conditionClass(this._threadHeader,"_355",t.isLoadingMore(this.value));}.bind(this));};l.prototype.setNewHeader=function(p,q){'use strict';if(q.uid===c('MercuryTypeaheadConstants').THREAD_TYPE)this._threadHeader=p;};l.prototype.mouseover=function(event){'use strict';if(!m(this,event))k.mouseover.call(this,event);};l.prototype.mouseup=function(event){'use strict';if(!m(this,event))k.mouseup.call(this,event);};l.prototype.clearSelected=function(){'use strict';this.index=-1;this.highlight(-1);};function m(p,event){var q=p.getIndex(event);return q>=0&&q<p.results.length&&p.results[q].type==c('MercuryTypeaheadConstants').HEADER_TYPE;}function n(p){var q=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{all_people_query:p,start:false});c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS,q);}function o(p){var q=c('DataStore').get(p.typeahead,'Typeahead'),r=q.getData();if(r.hasLoadedInitialResults(p.value)&&!r.hasLoadedAllResults(p.value))return r.loadMore.bind(r);}f.exports=l;},null);
__d('MercuryExpandableDataSource',['MercuryTypeaheadDataSource'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('MercuryTypeaheadDataSource'));i=h&&h.prototype;function j(k,l,m){'use strict';k=k||{};k.maxResults=l;i.constructor.call(this,k);this.$MercuryExpandableDataSource1=l;this.$MercuryExpandableDataSource2=m;this.$MercuryExpandableDataSource3={};}j.prototype.query=function(k,l,m){'use strict';this.setQueryData({offset:0,limit:this.$MercuryExpandableDataSource1});return i.query.call(this,k,l,m);};j.prototype.fetchHandler=function(k,l){'use strict';var m=k.getPayload(),n=l.value;this.getState('is_loading_more_per_query')[n]=false;this.getState('total_results_count_per_query')[n]=m.total_count;i.fetchHandler.call(this,k,l);};j.prototype.loadMore=function(){'use strict';if(this.value&&!this.hasLoadedAllResults()){var k=this.getState('max_results_per_query');if(!k[this.value])k[this.value]=this.$MercuryExpandableDataSource1;this.setQueryData({offset:k[this.value],limit:this.$MercuryExpandableDataSource2});k[this.value]+=this.$MercuryExpandableDataSource2;if(k[this.value]>this.$MercuryExpandableDataSource4)this.$MercuryExpandableDataSource4=k[this.value];this.getState('is_loading_more_per_query')[this.value]=true;this.fetch(this.queryEndpoint,this.getQueryData(this.value,this.buildUids(this.value)),{value:this.value});}};j.prototype.isLoadingMore=function(){'use strict';return this.getState('is_loading_more_per_query')[this.value];};j.prototype.hasLoadedAllResults=function(){'use strict';var k=this.getState('total_results_count_per_query')[this.value],l=(this.buildQueryResults(this.value)||[]).length;return k&&l>=k;};j.prototype.getStates=function(){'use strict';return this.$MercuryExpandableDataSource3;};j.prototype.getState=function(k){'use strict';var l=this.getStates();if(!l[k])l[k]={};return l[k];};f.exports=j;},null);
__d('WebMessengerTypeaheadDataSource',['MercuryExpandableDataSource','MercuryIDs','MercuryParticipants','MercuryTypeaheadConstants','WebMessengerStateManager'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('MercuryExpandableDataSource'));i=h&&h.prototype;function j(m){'use strict';m=m||{};m.kanaNormalization=true;i.constructor.call(this,m,c('MercuryTypeaheadConstants').COMPOSER_THREADS_INITIAL_LIMIT,c('MercuryTypeaheadConstants').COMPOSER_SHOW_MORE_LIMIT);this.setMaxResults(c('MercuryTypeaheadConstants').COMPOSER_WM_MAX);}j.prototype.bootstrap=function(){'use strict';if(!i.bootstrap.call(this))this.fetchEntryBigProfilePic();};j.prototype.updateBootstrapData=function(){'use strict';i.updateBootstrapData.call(this);this.fetchEntryBigProfilePic();};j.prototype.buildData=function(m){'use strict';var n=[],o=[],p=[],q=[],r=[];m.forEach(function(t){var u=i.getEntry.call(this,t);switch(u.render_type){case c('MercuryTypeaheadConstants').FRIEND_TYPE:if(n.length<c('MercuryTypeaheadConstants').COMPOSER_FRIENDS_MAX)n.push(t);break;case c('MercuryTypeaheadConstants').THREAD_TYPE:var v=u.mercury_thread.thread_fbid;u.uid=v;i.setEntry.call(this,v,u);if(k().length===0)o.push(v);break;case c('MercuryTypeaheadConstants').NON_FRIEND_TYPE:if(p.length<c('MercuryTypeaheadConstants').COMPOSER_NON_FRIENDS_MAX)p.push(t);break;case c('MercuryTypeaheadConstants').FB4C_TYPE:if(q.length<c('MercuryTypeaheadConstants').COMPOSER_FB4C_MAX)q.push(t);break;case c('MercuryTypeaheadConstants').PAGE_TYPE:if(r.length<c('MercuryTypeaheadConstants').COMPOSER_PAGES_MAX&&k().length===0)r.push(t);break;}},this);var s=n.concat(q,o,r,p);return i.buildData.call(this,s);};j.prototype.query=function(m,n,o){'use strict';this.value=m;if(!i.query.call(this,m,n,o)){if(this.getState('loaded_all_threads_per_query')[m]==null)this.getState('loaded_all_threads_per_query')[m]=true;this.getState('loaded_initial_per_query')[m]=true;}this.logQuery({event:'query_web_messenger',query:m});};j.prototype.respond=function(m,n,o){'use strict';var p=i.respond.call(this,m,n,o);this.logResponse({event:'query_response_web_messenger',response_query:m,response_uids:n});return p;};j.prototype.getQueryData=function(m,n){'use strict';var o=i.getQueryData.call(this,m,n);o.existing_token_ids=k();return o;};j.prototype.fetchHandler=function(m,n){'use strict';this.getState('loaded_all_threads_per_query')[n.value]=m.getPayload().end_of_threads;this.getState('loaded_initial_per_query')[n.value]=true;i.fetchHandler.call(this,m,n);};j.prototype.hasLoadedInitialResults=function(m){'use strict';if(m===undefined)m=this.value;return this.getState('loaded_initial_per_query')[m]||m&&m.length<=1;};j.prototype.hasLoadedAllResults=function(m){'use strict';if(m===undefined)m=this.value;return this.getState('loaded_all_threads_per_query')[m];};j.prototype.fetchEntryBigProfilePic=function(){'use strict';var m=this.getCachedShortProfileIDs().map(function(n){return c('MercuryIDs').getParticipantIDFromUserID(n);});c('MercuryParticipants').getBigImageMulti(m,l.bind(this));};j.prototype.loadMore=function(){'use strict';this.setMaxResults(this.buildQueryResults(this.value).length+c('MercuryTypeaheadConstants').COMPOSER_SHOW_MORE_LIMIT*2);i.loadMore.call(this);};function k(){var m=c('WebMessengerStateManager').getCurrentStateData();return (m.participants||[]).map(function(n){return c('MercuryIDs').tokenize(n).value;});}function l(m){for(var n in m)if(m.hasOwnProperty(n)){var o=this.getEntry(c('MercuryIDs').getUserIDFromParticipantID(n));if(o)o.photo=m[n];}if(this.value)this.query(this.value);}f.exports=j;},null);
__d('WebMessengerTypeaheadRenderer',['CurrentUser','DOM','ImmutableObject','MercuryAPIArgsSource','MercuryThreadImage.react','MercuryThreadIDMap','MercuryTypeaheadConstants','MercuryTypeaheadRenderer','React','ReactDOM','WebMessengerTemplates','MercuryThreadMetadataRawRenderer','MercuryThreadMetadataRenderer','MercuryThreads'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryThreadIDMap').get(),i=c('MercuryThreadMetadataRenderer').get(),j=c('MercuryThreads').get(),k=50;function l(n,o){var p;switch(n.type){case c('MercuryTypeaheadConstants').HEADER_TYPE:p=c('WebMessengerTemplates')[':fb:web-messenger:typeahead-header'].build();c('MercuryTypeaheadRenderer').renderHeader(p,n);if(this.setNewHeader)this.setNewHeader(p.getRoot(),n);break;case c('MercuryTypeaheadConstants').USER_TYPE:case c('MercuryTypeaheadConstants').PAGE_TYPE:p=c('WebMessengerTemplates')[':fb:web-messenger:threadlist-row'].build();c('MercuryTypeaheadRenderer').renderPersonWithBigPhoto(p,n);break;case c('MercuryTypeaheadConstants').THREAD_TYPE:p=c('WebMessengerTemplates')[':fb:web-messenger:threadlist-row'].build();m(p,n);break;default:return c('DOM').create('div');}return p.getRoot();}function m(n,o){var p=h.getClientIDFromServerIDNow(o.uid),q=c('React').createElement(c('MercuryThreadImage.react'),{size:k,thread:new (c('ImmutableObject'))(o.mercury_thread),viewer:c('CurrentUser').getID()});c('ReactDOM').render(q,n.getNode('image'));var r=i.renderThreadNameAndParticipantList(p,o.participants_to_render,o.mercury_thread.participants.length,{last_separator_uses_and:false,names_renderer:c('MercuryThreadMetadataRawRenderer').renderShortNames});c('DOM').setContent(n.getNode('name'),r);n.getRoot().setAttribute('data-tooltip-content',r);j.getThreadMeta(p,function(s){i.renderSnippet(s,n.getNode('snippet'));i.renderTimestamp(n.getNode('timestamp'),s.timestamp_absolute,s.timestamp_relative,s.timestamp);},c('MercuryAPIArgsSource').WEBMESSENGER);}f.exports=l;},null);
__d('WebMessengerDetailViewComposeTypeaheadControl',['fbt','Event','WebMessengerComposerTypeaheadView','CSS','DOM','MercuryFolders','Keys','MercuryDataSourceHelper','MercuryIDs','MercuryTypeahead','MercuryTypeaheadConstants','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','MercuryThreads','WebMessengerEvents','WebMessengerTypeaheadDataSource','WebMessengerSubscriptionsHandler','WebMessengerTypeaheadRenderer'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercuryThreads').get();function j(n,o){'use strict';this._typeaheadRoot=n;this._resultsRoot=o;c('DOM').empty(this._typeaheadRoot);c('DOM').empty(this._resultsRoot);}j.prototype.hideView=function(){'use strict';c('CSS').hide(this._typeaheadRoot);c('CSS').hide(this._resultsRoot);};j.prototype.updateView=function(){'use strict';var n=c('WebMessengerStateConstants');switch(c('WebMessengerStateManager').getCurrentDetailState()){case n.DETAIL.COMPOSE_MAIN:this.renderComposeTypeahead();c('CSS').hide(this._resultsRoot);break;case n.DETAIL.COMPOSE_TYPEAHEAD_RESULTS:this.renderComposeTypeahead();c('CSS').show(this._resultsRoot);break;}c('WebMessengerEvents').detailDOMChanged();};j.prototype.renderComposeTypeahead=function(){'use strict';var n=c('WebMessengerStateManager').getCurrentStateData();c('CSS').show(this._typeaheadRoot);c('CSS').show(this._resultsRoot);if(!this._initiated){var o=c('WebMessengerTemplates')[':fb:web-messenger:read-view:compose:typeahead'].build();c('DOM').setContent(this._typeaheadRoot,o.getRoot());var p=c('WebMessengerTemplates')[':fb:web-messenger:read-view:compose:typeahead:results'].build();c('DOM').setContent(this._resultsRoot,p.getRoot());this._initialResultsLoadingSpinner=p.getNode('initialResultsLoadingSpinner');this._typeaheadFooter=p.getNode('typeaheadFooter');this._moreResultsLink=p.getNode('moreResultsLink');this._typeaheadCaption=p.getNode('caption');this.buildTypeahead(p.getNode('results'));c('DOM').appendContent(o.getNode('typeahead'),this._typeahead.getElement());this._initiated=true;}if(n.start){if(!n.participants)this._typeahead.reset();this._typeahead.focus();var q=this._typeahead.getTypeahead().getCore();q.getElement().removeAttribute('disabled');}l(this);if(n.start)c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateManager').getCurrentDetailState(),babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{start:false,new_tokens:undefined}));};j.prototype.buildTypeahead=function(n){'use strict';if(this._typeahead)return;var o=new (c('WebMessengerTypeaheadDataSource'))({queryEndpoint:'/ajax/mercury/composer_query.php'});c('MercuryDataSourceHelper').updateMercuryOnFetchComplete(o);var p=new (c('MercuryTypeahead'))(o,c('WebMessengerComposerTypeaheadView'));p.setPlaceholder(h._("Name"));p.setViewNodeID(n);p.setViewOption('renderer',c('WebMessengerTypeaheadRenderer'));c('WebMessengerSubscriptionsHandler').addSubscriptions(p.subscribe('tokens-changed',this.onTokensChanged.bind(this)));p.build();c('WebMessengerSubscriptionsHandler').addSubscriptions(p.getTypeahead().subscribe(['respond','focus'],function(){k(!!p.getTypeahead().getCore().getValue());}),p.getTypeahead().subscribe(['reset','blur'],function(){k(false);}),p.getTypeahead().subscribe('render',function(q,r){m(this,r.length);}.bind(this)),p.getTypeahead().subscribe('reset',function(){m(this,false);}.bind(this)),p.getTypeahead().subscribe('query',function(q,r){c('DOM').setContent(this._moreResultsLink,h._("See more results for {query}",[h.param('query',r.value)]));}.bind(this)),c('Event').listen(p.getElement(),'keydown',function(q){if(q.keyCode===c('Keys').TAB&&!q.getModifiers().any){c('WebMessengerEvents').focusComposer();return false;}}),c('Event').listen(this._typeaheadFooter,'mousedown',function(){return false;}),c('Event').listen(this._moreResultsLink,'click',function(){var q=this._typeahead.getTypeahead().getCore().getValue(),r=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{all_people_query:q,start:false});c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS,r);}.bind(this)),c('Event').listen(this._typeaheadFooter,'mouseover',function(){this._typeahead.getTypeahead().getView().clearSelected();}.bind(this)));this._typeahead=p;};j.prototype.onTokensChanged=function(){'use strict';var n=c('WebMessengerStateManager').getCurrentDetailState();if(n==c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN||n==c('WebMessengerStateConstants').DETAIL.COMPOSE_TYPEAHEAD_RESULTS||n==c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS){var o=this._typeahead,p=o.getTokens(),q=p[p.length-1];if(q&&q.getInfo().mercury_thread){var r=q.getInfo().mercury_thread.thread_id,s=c('MercuryFolders').getFromMeta(i.getThreadMetaNow(r));c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{thread_id:r,folder:s,reuse_composer:true});}else{var t=p.map(function(v){if(v.getInfo().type===c('MercuryTypeaheadConstants').PAGE_TYPE){var w=o.getTypeahead().getCore();w.getElement().setAttribute('disabled','disabled');}return c('MercuryIDs').getParticipantIDFromUserID(v.getValue());}),u=c('WebMessengerStateManager').getCurrentStateData();if(!u.start||(t||[]).length)c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN,babelHelpers['extends']({},u,{participants:t}));}}};j.prototype.destroy=function(){'use strict';};function k(n){var o=c('WebMessengerStateManager').getCurrentDetailState(),p=c('WebMessengerStateConstants');if(o!=p.DETAIL.COMPOSE_MAIN&&o!=p.DETAIL.COMPOSE_TYPEAHEAD_RESULTS)return;var q;if(n){q=p.DETAIL.COMPOSE_TYPEAHEAD_RESULTS;}else if(o==p.DETAIL.COMPOSE_TYPEAHEAD_RESULTS){q=p.DETAIL.COMPOSE_MAIN;}else q=o;if(q!=o){var r=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{start:false,new_tokens:undefined});c('WebMessengerStateManager').updateDetailState(q,r);}}function l(n){var o=c('WebMessengerStateManager').getCurrentStateData();if(o.new_tokens){var p=n._typeahead.getTypeahead().getCore();p.reset();o.new_tokens.forEach(function(q){n._typeahead.getTokenizer().addToken(q);});}}function m(n,o){var p=n._typeahead.getTypeahead(),q=p.getCore().getValue(),r=p.getData().hasLoadedInitialResults(q);c('CSS').conditionShow(n._initialResultsLoadingSpinner,!r);c('CSS').conditionShow(n._moreResultsLink,r&&o);if(!o&&r){c('DOM').setContent(n._typeaheadCaption,h._("No results found"));}else c('DOM').setContent(n._typeaheadCaption,h._("Displaying top results"));}f.exports=j;},null);
__d('MercuryPresence',['fbt','Arbiter','AvailableListConstants','DOM','CSS','requireWeak'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={},j={},k={updateOnPresenceChanges:function(q,r){j[r.tagName]=true;i[q]=true;c('CSS').addClass(r,'presenceListener_'+q);var s=l(q);m(r,s.classes);n(r,s.label);}};function l(q){var r=p(q),s={presenceActive:false,presenceMobile:false},t=null;switch(r){case c('AvailableListConstants').ACTIVE:s.presenceActive=true;t=h._("Active");break;case c('AvailableListConstants').MOBILE:s.presenceMobile=true;t=h._("Mobile");break;default:break;}return {classes:s,label:t};}function m(q,r){for(var s in r)c('CSS').conditionClass(q,s,r[s]);}function n(q,r){if(q&&r){var s=c('DOM').create('span',{className:'accessible_elem'},r);c('DOM').setContent(q,s);}}function o(){for(var q in i){var r=l(q);for(var s in j){var t=c('DOM').scry(document,s+'.presenceListener_'+q);for(var u=0;u<t.length;u++){m(t[u],r.classes);n(t[u],r.label);}}}}var p=function(q){return c('AvailableListConstants').OFFLINE;};c('requireWeak')('AvailableList',function(q){p=q.get;o();});c('Arbiter').subscribe(c('AvailableListConstants').ON_AVAILABILITY_CHANGED,o);f.exports=k;},null);
__d('WebMessengerDetailViewHeaderControl',['csx','cx','fbt','WebMessengerAddPeopleToConversationDialog','Autosize','AvailableListConstants','Bootloader','ContextualDialog','CSS','DOM','WebMessengerEditThreadDialog','Event','HovercardLink','HoverFlyout','JSXDOM','LastActiveTimes','LayerFadeOnHide','LayerFadeOnShow','LayerHideOnTransition','MercuryAPIArgsSource','MercuryConfig','MercuryIDs','MercuryThreadInfo','MercuryViewer','MNCommerceDialogStateActions','MNCommercePromotionBlockDataManager','MNCommercePromotionManageBlockDialogContainer.react','MercuryParticipants','MercuryPresence','ScrollableArea','WebMessengerStateConstants','WebMessengerStateManager','Style','WebMessengerTemplates','MercuryThreadInformer','MercuryThreadMetadataRenderer','MercuryThreads','Tooltip','WebMessengerConstants','WebMessengerEvents','WebMessengerSubscriptionsHandler','curry','isNode'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercuryThreadInformer').get(),l=c('MercuryThreadMetadataRenderer').get(),m=c('MercuryThreads').get(),n=null;function o(w){'use strict';this._rootElement=w;c('DOM').empty(this._rootElement);this._renderHeaderBar();}o.prototype.hideView=function(){'use strict';c('CSS').hide(this._rootElement);};o.prototype.updateView=function(){'use strict';c('CSS').removeClass(this._rootElement,'hasMultiChatThreadActions');c('CSS').show(this._rootElement);if(this._listener){k.unsubscribe(this._listener);this._listener=null;}var w=c('WebMessengerStateConstants');switch(c('WebMessengerStateManager').getCurrentDetailState()){case w.DETAIL.RECENT_MESSAGES:case w.DETAIL.SEARCH_CONTEXT:case w.DETAIL.SEARCH_THREAD_SNIPPET:case w.DETAIL.SHARED_PHOTOS:this.setThreadID(c('WebMessengerStateManager').getCurrentStateData().thread_id);break;default:this.setThreadID(null);break;}c('WebMessengerEvents').detailDOMChanged();};o.prototype.setThreadID=function(w){'use strict';this._threadID=w;if(this._threadID){this._listener=k.listen(this._threadID,this.updateView.bind(this));c('WebMessengerSubscriptionsHandler').addSubscriptions(this._listener);}w&&m.getThreadMeta(w,function(x){if(this._threadID==w)c('CSS').conditionClass(this._rootElement,'hasMultiChatThreadActions',!x.is_canonical&&c('MercuryThreadInfo').canReply(x));}.bind(this));};o.prototype._renderHeaderBar=function(){'use strict';this._headerBar=c('WebMessengerTemplates')[':fb:web-messenger:read-view:header'].build();c('DOM').appendContent(this._rootElement,this._headerBar.getRoot());var w=this._headerBar.getNode('editThreadName'),x=this._headerBar.getNode('addPeopleToThread'),y=new (c('WebMessengerEditThreadDialog'))(),z=this._headerBar.getNode('webMessengerManageButton'),aa=function(ba,ca){return c('MNCommercePromotionBlockDataManager').block(ba,ca);};this._title_node_wrapper=this._headerBar.getNode('headerName');this._relationship_status=this._headerBar.getNode('relationshipStatus');c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._headerBar.getNode('closeButton'),'click',function(){var ba=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData(),{all_people_query:undefined});c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN,ba);}),c('Event').listen(w,'click',function(event){this._threadID&&y.toggleShown(this._headerBar.getNode('headerName'),this._threadID);return true;}.bind(this)),c('Event').listen(x,'click',function(event){this._threadID&&c('WebMessengerAddPeopleToConversationDialog').show(this._threadID);return true;}.bind(this)),c('Event').listen(z,'click',function(event){this._threadID&&c('MNCommerceDialogStateActions').showDialog(c('MNCommercePromotionManageBlockDialogContainer.react'),{pageID:c('MercuryIDs').getUserIDFromThreadID(this._threadID),onConfirmButtonClick:aa});return true;}.bind(this)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').DETAIL_DOM_CHANGED,this.updateHeaderBar.bind(this)));};o.prototype.updateHeaderBar=function(){'use strict';var w=this._headerBar.getNode('headerButtons');this._title_node_wrapper.style.fontSize='';var x=c('JSXDOM').span(null);c('DOM').setContent(this._title_node_wrapper,x);var y=this._headerBar.getNode('webMessengerRecIndicator');y&&c('CSS').hide(y);var z=this._headerBar.getNode('webMessengerManageButton');z&&c('CSS').hide(z);var aa=c('WebMessengerStateManager').getCurrentDetailState(),ba=aa==c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS;c('CSS').conditionShow(this._headerBar.getNode('closeButton'),ba);c('CSS').conditionClass(this._title_node_wrapper,'allPeopleResults',ba);c('CSS').hide(this._relationship_status);c('CSS').removeClass(this._title_node_wrapper,"_50jz");var ca,da;switch(aa){case c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:da=c('WebMessengerStateManager').getCurrentStateData().all_people_query;ca=j._("People matching {query}",[j.param('query',c('DOM').create('strong',{},da))]);break;case c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN:case c('WebMessengerStateConstants').DETAIL.COMPOSE_TYPEAHEAD_RESULTS:ca=j._("New Message");break;case c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET:da=c('WebMessengerStateManager').getCurrentStateData().message_query;if(da)ca=j._("Messages with word: {query}",[j.param('query',da)]);break;}var ea=!ca&&!this._threadID;if(ea)ca=j._("No Selection");c('CSS').conditionClass(this._title_node_wrapper,"_3jd",ea);if(ca){c('DOM').setContent(x,ca);v(this._title_node_wrapper,this._threadID,w,y);return;}l.renderAndSeparatedParticipantList(this._threadID,x,{check_length:false,names_renderer:function(fa){var ga=m.getThreadMetaNow(this._threadID),ha=fa.map(function(ja){var ka=fa.length===1?ja.name:ja.short_name;if(ga&&ga.custom_nickname){var la=c('MercuryIDs').getUserIDFromParticipantID(ja.id);if(ga.custom_nickname[la])ka=ga.custom_nickname[la];}var ma=ja.id?c('MercuryIDs').getUserIDFromParticipantID(ja.id):null;if(ma&&ja.href){var na=c('JSXDOM').a({href:ja.href},ka);if(fa.length===1)na.setAttribute('data-hovercard',c('HovercardLink').constructEndpoint({id:ma}));if(c('WebMessengerStateManager').getStandaloneMode())na.setAttribute('target','_blank');return na;}else return ka;}.bind(this));if(fa.length===1&&fa[0].fbid!==null){var ia=c('JSXDOM').span(null);c('DOM').setContent(ia,ha[0]);q(fa[0],ia);ha[0]=ia;}return ha;}.bind(this)});if(y)m.getThreadMeta(this._threadID,function(fa){r(fa,y);});if(z)m.getThreadMeta(this._threadID,function(fa){s(fa,z);});this.renderParticipantListFlyout(x);this.renderNamedThreadParticipantCount(x);v(this._title_node_wrapper,this._threadID,w,y);new (c('Autosize'))(this._title_node_wrapper,{min:11,max:16,height:100,width:this._title_node_wrapper.offsetWidth,wrap:false});};o.prototype.renderNamedThreadParticipantCount=function(w){'use strict';m.getThreadMeta(this._threadID,function(x){if(x.name){var y=l.renderParticipantCount(x.thread_id,{count:x.participants.length}),z=c('DOM').create('span',{className:"_1us"},j._("({participants})",[j.param('participants',y)]));c('DOM').appendContent(w,z);}},c('MercuryAPIArgsSource').WEBMESSENGER);};o.prototype.renderParticipantListFlyout=function(w){'use strict';this._dialog&&this._dialog.destroy();delete this._dialog;this._flyout&&this._flyout.destroy();delete this._flyout;var x=this._threadID;m.getThreadMeta(this._threadID,function(y){var z=y.participants;if(!y.name){z=z.filter(function(aa){return aa!==c('MercuryViewer').getID();});if(z.length<=1)return;}c('MercuryParticipants').getMulti(z,function(aa){if(this._threadID!=x)return;var ba=0,ca=c('WebMessengerTemplates')[':fb:web-messenger:flyoutlist'].build();for(var da in aa){if(!aa.hasOwnProperty(da))continue;var ea=aa[da],fa=c('WebMessengerTemplates')[':fb:web-messenger:flyoutlist-profile-item'].build();fa.getNode('profilePhoto').setAttribute('src',ea.image_src);var ga=fa.getNode('title');if(ea.href){var ha=c('JSXDOM').a({href:ea.href});c('DOM').setContent(ga,ha);ga=ha;var ia=fa.getNode('profilePhoto'),ja=c('JSXDOM').a({href:ea.href});c('DOM').replace(ia,ja);c('DOM').setContent(ja,ia);if(c('WebMessengerStateManager').getStandaloneMode()){ha.setAttribute('target','_blank');ja.setAttribute('target','_blank');}}c('DOM').setContent(ga,ea.name);q(ea,fa.getNode('title'));c('DOM').setContent(fa.getNode('infoLine'),u(ea));ba++;c('DOM').appendContent(ca.getNode('list'),fa.getRoot());}var ka=ca.getRoot();this._dialog=new (c('ContextualDialog'))({context:w,position:'below',addedBehaviors:[c('LayerFadeOnHide'),c('LayerFadeOnShow'),c('LayerHideOnTransition')]},ka);this._flyout=new (c('HoverFlyout'))();this._flyout.init(this._dialog);this._flyout.initNode(w);t(this._flyout,ka,ba);}.bind(this));}.bind(this),c('MercuryAPIArgsSource').WEBMESSENGER);};o.prototype.destroy=function(){'use strict';};function p(w,x,y){var z=c('LastActiveTimes').getShortDisplay(y);if(!z||w.get(y)!==c('AvailableListConstants').MOBILE){c('Tooltip').remove(x);return;}c('Tooltip').set(x,j._("Last active {time} ago",[j.param('time',z)]),'right');}function q(w,x){var y=c('MercuryIDs').getUserIDFromParticipantID(w.id);if(!y)return;var z=c('JSXDOM').span(null);c('MercuryPresence').updateOnPresenceChanges(y,z);if(c('isNode')(x)){c('Bootloader').loadModules(["PresenceStatus","ChatOpenTab"],function(aa,ba){c('Event').listen(z,'mouseenter',c('curry')(p,aa,z,y));c('Event').listen(z,'click',ba.openUserTab.bind(null,y,'web messenger header'));});c('DOM').appendContent(x,z);}}function r(w,x){if(x)c('MercuryParticipants').getMulti(w.participants,function(y){var z=true;for(var aa in y)if(y.hasOwnProperty(aa))z=z&&y[aa].employee;c('CSS').conditionShow(x,z);});}function s(w,x){if(c('MercuryConfig').WWWMessengerManageButtonGK&&x&&w.thread_fbid)c('MercuryParticipants').get(c('MercuryIDs').getParticipantIDFromUserID(w.thread_fbid),function(y){var z=y.is_business_enabled;c('CSS').conditionShow(x,z);});}function t(w,x,y){if(y<=c('WebMessengerConstants').MAX_VISIBLE_IN_FLYOUT)return;var z=c('ScrollableArea').fromNative(x,{fade:true});x.style.height=c('WebMessengerConstants').PARTICIPANTS_FLYOUT_HEIGHT+'px';w.subscribe('show',function(){z.showScrollbar(false);});}function u(w){var x=w.social_snippets||{},y=Object.keys(x);if(y.length>0){var z=y.slice(0,1).map(function(aa){return x[aa];});return z;}return '';}function v(w,x,y,z){var aa=y.offsetWidth;if(z){n=n||z.offsetWidth;aa+=n;}var ba=c('DOM').scry(document.body,"div._2nd");if(ba.length)aa+=ba[0].offsetWidth;var ca=w.parentNode.offsetWidth;if(ca>aa)c('Style').set(w,'max-width',ca-aa+'px');}f.exports=o;},null);
__d('MercuryListUpdateRenderer',['DOM','ge'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={updateList:function(i,j,k,l,m){var n=[];for(var o=0;o<j.length;o++){if(m){var p=m(o);p&&n.push(p);}var q=c('ge')(j[o]);if(q&&k(o)){n.push(q);}else n.push(l(o));}c('DOM').setContent(i,n);}};f.exports=h;},null);
__d('WebMessengerUnseenMessageNoticeRenderer',['cx','fbt','JSXDOM','ContextualLayer','LayerFadeOnHide','Event'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={renderNoticeTooltip:function(l,m){var n=c('JSXDOM').div({className:"_40p"},k(l),c('JSXDOM').i({className:"_40q"})),o=new (c('ContextualLayer'))(m||{},n).enableBehavior(c('LayerFadeOnHide'));return o;}};function k(l){var m=c('JSXDOM').div({className:"_40r"},i._("You have new messages"));c('Event').listen(m,'click',l);return m;}f.exports=j;},null);
__d('WebMessengerMessagesNotice',['LayerDestroyOnHide','MercuryViewer','WebMessengerUnseenMessageNoticeRenderer'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(){'use strict';this._notice=null;this._noticeContextNode=null;this._active=false;}h.prototype.getActive=function(){'use strict';return this._active;};h.prototype.showMessageNotice=function(i,j){'use strict';if(!this._active)return;if(!this._notice)this._notice=c('WebMessengerUnseenMessageNoticeRenderer').renderNoticeTooltip(i,{context:this._noticeContextNode,offsetY:2,position:j,alignment:'center'});this._notice.show();};h.prototype.hideMessageNotice=function(){'use strict';this._notice&&this._notice.hide();};h.prototype.removeMessageNotice=function(){'use strict';if(this._notice){this._notice.enableBehavior(c('LayerDestroyOnHide')).hide();this._notice=null;}};h.prototype.setNoticeContextNode=function(i){'use strict';this._noticeContextNode=i;};h.prototype.hideView=function(){'use strict';this._active=false;this.hideMessageNotice();};h.prototype.updateView=function(){'use strict';this._active=true;};h.prototype.destroy=function(){'use strict';this._active=false;this.removeMessageNotice();};h.prototype.onlyReceivedFromSelf=function(i){'use strict';for(var j in i){if(!i.hasOwnProperty(j))continue;for(var k=0,l=i[j].length;k<l;k++)if(i[j][k].author!==c('MercuryViewer').getID())return false;}return true;};f.exports=h;},null);
__d('WebMessengerDetailViewUnreadMessagesNotice',['MercuryThreadlistConstants','WebMessengerStateManager','throttle','MercuryThreadInformer','MercuryThreadActions','UserActivity','WebMessengerMessagesNotice','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();var j=c('MercuryThreadInformer').get(),k=c('MercuryThreadActions').get(),l=c('MercuryThreadlistConstants').MESSAGE_NOTICE_INACTIVITY_THRESHOLD;h=babelHelpers.inherits(m,c('WebMessengerMessagesNotice'));i=h&&h.prototype;function m(n){'use strict';i.constructor.call(this);this._manager=n;c('WebMessengerSubscriptionsHandler').addSubscriptions(j.subscribe('thread-read-changed',this._updateReadStatus.bind(this)));this._manager.addScrollCallback(c('throttle').withBlocking(function(o){if(this._shouldMarkAsRead(o)){this.removeMessageNotice();if(c('UserActivity').isActive(5000)){var p=c('WebMessengerStateManager').getCurrentStateData().thread_id;k.markRead(p);}else c('UserActivity').subscribeOnce(function(){if(this._shouldMarkAsRead(o)){var q=c('WebMessengerStateManager').getCurrentStateData().thread_id;k.markRead(q);}}.bind(this));}}.bind(this),100,null));}m.prototype.updateOnMessagesReceived=function(n,o,p,q){'use strict';var r=!c('UserActivity').isActive(l);if(!i.getActive.call(this))return;if(r||i.onlyReceivedFromSelf.call(this,q)){this.removeMessageNotice();this._manager.scrollToBottom(true);}else if(!this._manager.isScrolledToBottom()){var s=p-(o-n);this._manager.setScrollTop(s,false);this.showMessageNotice();}};m.prototype.showMessageNotice=function(){'use strict';var n=function(){this._manager.scrollToBottom();}.bind(this);i.showMessageNotice.call(this,n,'above');};m.prototype._shouldMarkAsRead=function(n){'use strict';var o=c('WebMessengerStateManager').getCurrentStateData().thread_id;return o&&i.getActive.call(this)&&n.isScrolledToBottom();};m.prototype._updateReadStatus=function(n,o){'use strict';var p=c('WebMessengerStateManager').getCurrentStateData().thread_id;if(p&&o[p]&&o[p].mark_as_read)this.removeMessageNotice();};f.exports=m;},null);
__d('WebMessengerInfoBoxRenderer',['cx','Event','DOM','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={render:function(j,k){var l=c('DOM').create('div',{className:"_4rk"},j),m=c('DOM').create('div',{}),n=true;k.forEach(function(o){if(!n){var p=c('DOM').create('span',{className:"_4rl"},'\u00b7');c('DOM').appendContent(m,p);}n=false;var q=c('DOM').create('a',{},o.text);if(o.handler)c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(q,'click',o.handler));c('DOM').appendContent(m,q);});return c('DOM').create('div',{className:"_4rh"},[l,m]);}};f.exports=i;},null);
__d('WebMessengerMessageIDFinder',['csx','DataStore','DOM'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={find:function(j,k){var l=k?c('DOM').find(j,k):j,m=c('DataStore').get(l,'MessageRenderer:messageID');return m;},findAll:function(j){var k=c('DOM').scry(j,"._53"),l=[];if(k.length){var m=k[0];for(var n=0;n<m.childNodes.length;n++)l.push(c('DataStore').get(m.childNodes[n],'MessageRenderer:messageID'));}return l;}};f.exports=i;},null);
__d('WebMessengerMessagesSelection',['csx','CSS','DOM','getObjectValues','WebMessengerMessageIDFinder'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={};function j(m,n){var o=m,p=n;if(o==p)return 0;while(true){o=o.nextSibling;p=p.nextSibling;if(!o||p==m){return 1;}else if(!p||o==n)return -1;}}function k(m,n){var o=m.id,p=c('DOM').scry(m,"._yh input")[0];if(n){i[o]=m;c('CSS').addClass(m,'selected');p.checked=true;}else{delete i[o];c('CSS').removeClass(m,'selected');p.checked=false;}}var l={clear:function(){for(var m in i)k(i[m],false);},selectClick:function(m){k(m,!(m.id in i));},getSelectedMessageIDs:function(){var m=c('getObjectValues')(i);m.sort(j);var n=[];m.forEach(function(o){n=n.concat(c('WebMessengerMessageIDFinder').findAll(o));});return n;}};f.exports=l;},null);
__d('UntrustedLink',['DOM','Event','URI','UserAgent_DEPRECATED'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j,k,l){this.dom=i;this.url=i.href;this.hash=j;this.func_get_params=l||function(){return {};};c('Event').listen(this.dom,'click',this.onclick.bind(this));c('Event').listen(this.dom,'mousedown',this.onmousedown.bind(this));c('Event').listen(this.dom,'mouseup',this.onmouseup.bind(this));c('Event').listen(this.dom,'mouseout',this.onmouseout.bind(this));this.onmousedown(c('Event').$E(k));}h.bootstrap=function(i,j,k,l){if(i.__untrusted)return;i.__untrusted=true;new h(i,j,k,l);};h.prototype.getRewrittenURI=function(){var i=babelHelpers['extends']({u:this.url,h:this.hash},this.func_get_params(this.dom)),j=new (c('URI'))('/l.php').setSubdomain('www');if(new (c('URI'))(this.url).getProtocol()=='https'){return j.setQueryData(i).setProtocol('https');}else return j.setQueryData(i).setProtocol('http');};h.prototype.onclick=function(){setTimeout(function(){this.setHref(this.url);}.bind(this),100);this.setHref(this.getRewrittenURI());};h.prototype.onmousedown=function(i){if(i.button==2)this.setHref(this.getRewrittenURI());};h.prototype.onmouseup=function(){this.setHref(this.getRewrittenURI());};h.prototype.onmouseout=function(){this.setHref(this.url);};h.prototype.setHref=function(i){if(c('UserAgent_DEPRECATED').ie()<9){var j=c('DOM').create('span');c('DOM').appendContent(this.dom,j);this.dom.href=i;c('DOM').remove(j);}else this.dom.href=i;};f.exports=h;},null);
__d('DOMHyperlink',['cx','Env','JSXDOM','TransformTextToDOMMixin','UntrustedLink','URI','URLScraper','isFacebookURI'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={MAX_ITEMS:40,match:function(j,k){var l=c('URLScraper').match(j);if(!l)return false;var m=j.indexOf(l),n=m+l.length;return {startIndex:m,endIndex:n,element:this._element(l,k)};},_element:function(j,k){var l=j,m=l.replace(/"/g,'%22');if(!/^[a-z][a-z0-9\-+.]+:\/\//i.test(j))m='http://'+m;if(!c('URI').isValidURI(m))return l;var n=c('JSXDOM').a({className:"_553k",href:m,target:"_blank",rel:"nofollow"},l);if(k&&!c('isFacebookURI')(new (c('URI'))(m)))n.onmousedown=function(o){c('UntrustedLink').bootstrap(this,c('Env').lhsh,o);};return n;}};f.exports=Object.assign(i,c('TransformTextToDOMMixin'));},null);
__d('MercuryMessageRenderer',['DOM','DOMEmoji','DOMEmote','DOMHyperlink','JSXDOM','URI','shouldAddMRefParam','transformTextToDOM'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={formatMessageBody:function(l,m,n){var o=(l||'').replace(/\s+$/,'');if(!m)return k(o,false,n);var p=Object.keys(m).map(function(s){return window.parseInt(s);}).sort(function(s,t){return s-t;}),q=[],r=0;p.forEach(function(s){var t=o.slice(r,s);if(t)q.push(k(t,false,n));r=s+m[s].length;var u=o.slice(s,r);if(u)q.push(k(u,true,n));});if(r<o.length)q.push(k(o.slice(r),false,n));return q.length===0?null:q.length===1?q[0]:c('DOM').create('span',{},q);}};function i(l,m){var n=m(l);if(Array.isArray(n))n.forEach(function(o){if(o.href){var p=new (c('URI'))(o.href);if(c('shouldAddMRefParam')(p))o.href=p.addQueryData({__mref:'message'}).toString();}});return n;}function j(l,m){var n=l.replace(/\r\n?/g,'\n').split(/\n{2,}/);return n.filter(function(o){return o.length;}).map(function(o){return c('JSXDOM').p(null,i(o,m));});}function k(l,m,n){if(l.length===0&&!m)return null;var o=function(p){return c('transformTextToDOM')(p,[c('DOMHyperlink').params(true),c('DOMEmoji'),c('DOMEmote')]);};return (c('JSXDOM').span({className:m?'highlight':null},n?j(l,o):i(l,o)));}f.exports=h;},null);
__d('WebMessengerThreadMessagesRenderer',['csx','cx','fbt','AsyncRequest','MercuryAttachment','CSS','DataStore','DOM','Event','MercuryDisplayTimeFilterMessageRenderer','HovercardLink','Image.react','ImmutableObject','LinkController','MercuryLogMessageRenderer','MercuryActionType','MercuryAttachments.react','MercuryAttachmentType','MercuryErrorInfo','MercuryIDs','MercuryLogMessageType','MercuryMessageError.react','MercuryMessageGroup','MercuryTimePassed','MercuryViewer','MercuryMessageRenderer','WebMessengerMessagesSelection','MercuryMessages','Parent','MercuryParticipants','MercuryParticipantsConstants','React','ReactDOM','WebMessengerStateManager','Style','WebMessengerTemplates','MercuryThreadMetadataRenderer','Vector','WebMessengerConstants','WebMessengerEvents','WebMessengerSubscriptionsHandler','formatDate','ge','isRTL'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('MercuryMessages').get(),l=c('MercuryThreadMetadataRenderer').get(),m={updateSelection:function(o){var p=c('WebMessengerStateManager').getCurrentStateData().message_action;c('CSS').conditionClass(o,'selectionEnabled',p);},setupSelectionListener:function(o){c('LinkController').registerHandler(function(p){var q=c('WebMessengerStateManager').getCurrentStateData().message_action;if(q&&c('Parent').byClass(p,'webMessengerMessageGroup'))return false;});c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(o,'click',function(event){var p=c('WebMessengerStateManager').getCurrentStateData().message_action;if(p){var q=null;for(var r=event.getTarget();r;r=r.parentNode)if(c('CSS').hasClass(r,'webMessengerMessageGroup'))q=r;q&&c('WebMessengerMessagesSelection').selectClick(q);}}));},renderForwardedMessages:function(o,p){var q=c('MercuryMessageGroup').calculateMessageGroups(p),r=null;q.forEach(function(s){var t=m.renderMessageGroup(s,true);c('DOM').appendContent(o,t.getRoot());r=s[s.length-1];});},renderMessageGroup:function(o,p,q){var r=o[0],s=r.action_type===c('MercuryActionType').LOG_MESSAGE,t=s&&(r.log_message_type===c('MercuryLogMessageType').VIDEO_CALL||r.log_message_type===c('MercuryLogMessageType').PHONE_CALL),u=!t&&s?c('WebMessengerTemplates')[':fb:web-messenger:read-view:log-message'].build():c('WebMessengerTemplates')[':fb:web-messenger:read-view:message-group'].build();u.getRoot().setAttribute('id',(q||'wm:')+r.message_id);if(t){var v={attach_type:'share',share:{style_list:['rtc_call_log','fallback'],log_message_body:r.log_message_body,log_message_data:r.log_message_data,log_message_type:r.log_message_type,timestamp:r.timestamp}},w=c('ImmutableObject').setProperty(r,'attachments',[v]);w=c('ImmutableObject').setProperty(w,'has_attachment',true);w=c('ImmutableObject').setProperty(w,'body','');c('MercuryParticipants').get(r.author,function(x){return m.renderSingleMessage(u,w,x,p);});}else if(s){m.renderSingleLogMessage(u,r);}else c('MercuryParticipants').get(r.author,function(x){m.renderSingleMessage(u,r,x,p);for(var y=1;y<o.length;y++)m.appendMessageToGroup(u,o[y]);});return u;},appendMessageToGroup:function(o,p){var q=c('WebMessengerTemplates')[':fb:web-messenger:read-view:message'].build();if(p.is_filtered_content_bh||p.is_filtered_content_account||p.is_filtered_content_quasar||p.is_filtered_content_invalid_app||p.is_filtered_content){c('ReactDOM').render(c('React').createElement('div',{className:"uiBoxYellow _2ph- _3-95"},c('MercuryDisplayTimeFilterMessageRenderer').renderFilteredContent(p)),q.getNode('message'));}else q.setNodeContent('message',c('MercuryMessageRenderer').formatMessageBody(p.body,null,true));c('ReactDOM').render(c('React').createElement(c('MercuryMessageError.react'),{message:new (c('ImmutableObject'))(p)}),q.getNode('status'));var r=q.getRoot();c('DataStore').set(r,'MessageRenderer:messageID',p.message_id);c('CSS').addClass(q.getNode('message'),c('isRTL')(p.body)?'direction_rtl':'direction_ltr');c('DOM').appendContent(o.getNode('bodyDiv'),r);c('MercuryParticipants').get(c('MercuryViewer').getID(),function(s){if(s.employee){var t=c('WebMessengerTemplates')[':fb:web-messenger:bug-reporting'].build();t.getNode('fbtrace').setAttribute('data-timestamp',p.timestamp);t.getNode('brokenheart').setAttribute('data-timestamp',p.timestamp);c('DOM').setContent(q.getNode('bugReporting'),t.getRoot());}});},renderSingleLogMessage:function(o,p){var q=o.getNode('attachment');c('MercuryLogMessageRenderer').renderLegacy(o.getNode('icon'),o.getNode('message'),q,p);m.renderStatus(o,p);l.renderTimestamp(o.getNode('timestamp'),p.timestamp_absolute,p.timestamp_relative,p.timestamp);},renderMessageSeparator:function(o){var p=c('WebMessengerTemplates')[':fb:mercury:timestamp'].render();p.removeAttribute('title');var q=o.timestamp_absolute;if(!q)q=c('formatDate')(new Date(o.timestamp),{withinWeek:'l',withinYear:'F jS',older:'F jS, Y'});if(k.isFirstMessage(o))if(o.timestamp_time_passed===c('MercuryTimePassed').TODAY){q=j._("Conversation started today");}else q=j._("Conversation started {timestamp}",[j.param('timestamp',q)]);c('DOM').setContent(p,q);c('CSS').show(p);return c('DOM').create('li',{className:"_2n3"},p);},renderMessageSeparatorForIndex:function(o,p){var q=o[p][0];if(p){var r=q.timestamp,s=o[p-1],t=s[s.length-1].timestamp,u=c('WebMessengerConstants').READ_VIEW_SEPARATOR_TIME_LIMIT;if(r-t<u)return false;}return m.renderMessageSeparator(q);},renderRawAttachments:function(o,p){var q=c('MercuryAttachment').convertRaw(p.raw_attachments||[]),r=(p.photo_fbids?p.photo_fbids.length:0)+(p.image_ids?p.image_ids.length:0);for(var s=0;s<r;s++)q.push({attach_type:c('MercuryAttachmentType').PHOTO,preview_width:206,preview_height:206});if(p.sticker_id)q.push({attach_type:c('MercuryAttachmentType').STICKER});m.renderAttachments(o,q,p);},renderAttachments:function(o,p,q){c('ReactDOM').render(c('React').createElement(c('MercuryAttachments.react'),{attachments:p,maxWidth:450,message:q,isChat:false,onStickerClick:c('WebMessengerEvents').stickerClicked.bind(c('WebMessengerEvents'))}),o);},renderStatus:function(o,p){if(c('MercuryErrorInfo').hasErrorStatus(p)){var q=c('React').createElement(c('MercuryMessageError.react'),{message:new (c('ImmutableObject'))(p)}),r=o.getNode('statusContainer');if(r&&q){c('ReactDOM').render(q,r);c('CSS').show(r);}}},renderSingleMessage:function(o,p,q,r){m.appendMessageToGroup(o,p);var s;if(q.href){s=c('DOM').create('a',{href:q.href},q.name);if(c('WebMessengerStateManager').getStandaloneMode())s.setAttribute('target','_blank');var t=c('MercuryIDs').getUserIDFromParticipantID(q.id);if(t)s.setAttribute('data-hovercard',c('HovercardLink').constructEndpoint({id:t}));}else s=q.name;o.setNodeContent('authorName',s);var u=o.getNode('image');c('CSS').removeClass(u,'MercuryThreadImage');var v=c('React').createElement(c('Image.react'),{alt:q.name,width:c('MercuryParticipantsConstants').IMAGE_SIZE,height:c('MercuryParticipantsConstants').IMAGE_SIZE,src:q.image_src,className:"_50dv"});if(q.href)v=c('React').createElement('a',{href:q.href},v);v=c('ReactDOM').render(v,u);var w;if(p.timestamp_time_passed===c('MercuryTimePassed').TODAY){w='g:ia';}else w='n/j, g:ia';var x=c('formatDate')(new Date(p.timestamp),w);l.renderTimestamp(o.getNode('timestamp'),p.timestamp_absolute,x,p.timestamp);l.renderMessageSourceTags(o.getNode('tooltipForSource'),o.getNode('sourceIcon'),p.source_tags||[],p.author_email);l.renderSpoofWarning(o.getNode('spoofWarning'),p.is_spoof_warning,q);if(p.subject)o.setNodeContent('subject',p.subject);if(p.has_attachment){var y=o.getNode('attachments');if(p.attachments&&p.attachments.length===0){m.renderRawAttachments(y,p);}else if(p.attachments!==null&&p.attachments.length>0){m.renderAttachments(y,p.attachments,p);}else if(p.raw_attachments!=null&&p.raw_attachments.length>0)m.renderRawAttachments(y,p.raw_attachments);}var z=o.getNode('forwards'),aa=p.forward_count&&k.getMessagesFromIDs(p.forward_message_ids);if(aa)m.renderForwardedMessages(z,aa);c('CSS').conditionShow(z,aa);}};function n(o,p,q){var r=c('ge')(o),s=c('DOM').find(r,'iframe'),t=c('DOM').find(s,"^._5xm"),u=t.firstChild;c('Style').set(s,'width',p+'px');c('Style').set(s,'height',q+1+'px');s.setAttribute('scrolling','no');var v=r&&c('Vector').getElementDimensions(r).x/p;if(v&&v<1){c('Style').set(t,'height',Math.round(v*(q+1))+'px');var w=s.style,x=['transform','WebkitTransform','msTransform','MozTransform','OTransform'],y;while(y=x.shift())if(typeof w[y]!=='undefined'){c('Style').set(s,y,'scale('+v+','+v+')');return;}c('Style').set(u,'zoom',v);}}f.exports=m;},null);
__d('WebMessengerDetailViewRecentMessagesControl',['cx','fbt','Event','Animation','CSS','WebMessengerDetailViewUnreadMessagesNotice','DOM','Arbiter','GroupChatMessageBlockAlert','MercuryLastMessageIndicator.react','MercuryListUpdateRenderer','MercuryAPIArgsSource','MercuryBlockedParticipants','MercuryConfig','MercuryLogMessageType','MercurySourceType','MercuryThreadlistConstants','MercuryViewer','MercuryMessageGroup','MercuryMessageActions','MercuryMessageObject','MercuryMessages','WebMessengerMessagesSelection','MessagingTag','MessengerContextBannerBootloader','ReactDOM','ReactComponentRenderer','MercuryShareAttachmentRenderLocations','WebMessengerStateConstants','WebMessengerStateManager','Style','WebMessengerTemplates','MercuryThreadInformer','WebMessengerThreadMessagesRenderer','MercuryThreadActions','MercuryThreads','UserActivity','WebMessengerConstants','WebMessengerInfoBoxRenderer','WebMessengerMessageIDFinder','WebMessengerSubscriptionsHandler','debounce','formatDate','ge'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('MercuryBlockedParticipants').get(),k=c('MercuryMessageActions').get(),l=c('MercuryMessageObject').get(),m=c('MercuryMessages').get(),n=c('MercuryThreadInformer').get(),o=c('MercuryThreadActions').get(),p=c('MercuryThreads').get();function q(ka,la,ma,na,oa,pa,qa,ra){'use strict';this._manager=ka;this._rootElement=la;this._loadingSpinner=ma;this._noSelectedConversation=na;this._newMessageLink=oa;this._showUnreadLink=pa;this.contextBanner=qa;c('DOM').empty(this._rootElement);this._pagerExponent=-1;var sa=c('WebMessengerTemplates')[':fb:web-messenger:read-view:recent-messages'].build();c('DOM').setContent(this._rootElement,sa.getRoot());this._selectedConversationView=sa.getRoot();this._messageList=sa.getNode('messagelist');this._loadMoreButton=sa.getNode('loadMoreButton');this._loadMoreLink=sa.getNode('loadMoreLink');this._loadMoreCount=sa.getNode('loadMoreCount');this._loadingMoreCount=sa.getNode('loadingMoreCount');this._indicatorNode=sa.getNode('lastMessageIndicator');this._unseenMessagesNotice=new (c('WebMessengerDetailViewUnreadMessagesNotice'))(this._manager);this._unseenMessagesNotice.setNoticeContextNode(ra);this._active=false;this._state=null;this._threadID=null;this._bugReportingEnabled=false;this._currentCountMap={};this._olderMessageID={};this._loadMessagesInFlight={};c('WebMessengerThreadMessagesRenderer').setupSelectionListener(this._messageList);this._manager.addScrollCallback(c('debounce')(ja.bind(null,this),500));c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._loadMoreLink,'click',ba.bind(null,this)),n.subscribe('messages-reordered',function(ta,ua){var va=this._threadID&&ua[this._threadID];if(va)x(this);}.bind(this)),n.subscribe('messages-updated',function(ta,ua){var va=this._threadID&&ua[this._threadID];if(va)var wa=Object.keys(va),xa=wa.length&&va[wa[0]];if(va&&xa)x(this,ua[this._threadID]);}.bind(this)),n.subscribe('messages-updated',ja.bind(null,this)),n.subscribe('messages-received',function(ta,ua){if(this._threadID&&ua[this._threadID])aa(this,ua);}.bind(this)),n.subscribe('thread-read-changed',function(ta,ua){if(ua[this._threadID])ga(this,ua[this._threadID]);}.bind(this)),this._manager.subscribe('scrolledNearTop',function(){this._active&&ba(this);}.bind(this)));}q.prototype.hideView=function(){'use strict';this._active=false;c('CSS').hide(this._rootElement);c('CSS').hide(this._loadingSpinner);c('CSS').hide(this._noSelectedConversation);c('CSS').hide(this.contextBanner);this._unseenMessagesNotice.hideView();this._manager._flexArea.setBottomAligned(false);};q.prototype.updateView=function(){'use strict';this._unseenMessagesNotice.updateView();this._active=true;this._manager._flexArea.setBottomAligned(true);c('CSS').show(this._rootElement);if(this.contextBanner)c('CSS').show(this.contextBanner);var ka=s(this);t(this);c('WebMessengerMessagesSelection').clear();if(ka){u(this);}else ea(this);};q.prototype.renderContextBanner=function(ka,la){'use strict';if(this.contextBanner&&!this.contextBannerElem)c('MessengerContextBannerBootloader').bootload(ka,c('MercuryShareAttachmentRenderLocations').WEB_INBOX,function(ma){this.contextBannerElem=ma;c('Style').set(this._rootElement,'padding-top','80px');c('DOM').prependContent(this.contextBanner,this.contextBannerElem);c('CSS').show(this.contextBanner);}.bind(this),la);};q.prototype.unmountContextBanner=function(){'use strict';if(this.contextBannerElem){c('ReactDOM').unmountComponentAtNode(this.contextBannerElem);this.contextBannerElem=null;c('DOM').empty(this.contextBanner);}};q.prototype.destroy=function(){'use strict';r(this);this._unseenMessagesNotice.destroy();c('ReactDOM').unmountComponentAtNode(this._indicatorNode);this.unmountContextBanner();};function r(ka){ka._messagesSubscription&&m.unsubscribe(ka._messagesSubscription.subscriber_id,ka._messagesSubscription.thread_id);ka._messagesSubscription=null;}function s(ka){var la=c('WebMessengerStateManager').getCurrentStateData();if(!ka._threadID||ka._threadID!=la.thread_id)return true;return false;}function t(ka){var la=c('WebMessengerStateManager').getCurrentStateData();ka._state=c('WebMessengerStateManager').getCurrentDetailState();ka._threadID=la.thread_id;ka._selectionEnabled=!!la.message_action;ka._bugReportingEnabled=la.bug_reporting_enabled;c('WebMessengerThreadMessagesRenderer').updateSelection(ka._messageList);c('CSS').conditionClass(ka._messageList,'bugReportingEnabled',ka._bugReportingEnabled);}function u(ka){c('DOM').scry(ka._rootElement,'.stickerContainer').forEach(function(ma){return c('ReactDOM').unmountComponentAtNode(ma);});c('DOM').empty(ka._messageList);ka.unmountContextBanner();var la=null;if(ka._threadID)la=p.getThreadMetaNow(ka._threadID);if(la&&j.isPresentInGroupThread(la)){c('GroupChatMessageBlockAlert').show(j.inGroupThread(la),function(){return v(ka);},function(){k.send(l.constructLogMessageObject(c('MercurySourceType').TITAN_WEB,ka._threadID,c('MercuryLogMessageType').UNSUBSCRIBE,{removed_participants:[c('MercuryViewer').getID()]}),null,c('MercuryAPIArgsSource').WEBMESSENGER);v(ka);});}else v(ka);}function v(ka){c('CSS').show(ka._loadingSpinner);c('CSS').hide(ka._loadMoreButton);r(ka);ka._pagerExponent=-1;c('ReactDOM').unmountComponentAtNode(ka._indicatorNode);if(ka._lastMessageIndicator){ka._lastMessageIndicator.unmount();delete ka._lastMessageIndicator;}if(ka._threadID){c('CSS').show(ka._selectedConversationView);c('CSS').hide(ka._noSelectedConversation);ka._manager._flexArea.showAtTop(false);if(!ka._olderMessageID[ka._threadID]){w(ka);}else x(ka);ka._manager.scrollToBottom(false);}else{ia(ka);c('CSS').hide(ka._selectedConversationView);c('CSS').show(ka._noSelectedConversation);c('CSS').hide(ka._loadingSpinner);ka._manager._flexArea.showAtTop(true);}}function w(ka){ka._loadMessagesInFlight[ka._threadID]=true;ka._currentCountMap[ka._threadID]=c('WebMessengerConstants').INITIAL_MESSAGES_LIMIT;c('CSS').hide(ka._loadMoreButton);var la=m.getThreadMessagesRange(ka._threadID,0,ka._currentCountMap[ka._threadID],y.bind(null,ka),null,c('MercuryAPIArgsSource').WEBMESSENGER);if(la){ka._messagesSubscription={subscriber_id:la,thread_id:ka._threadID};}else x(ka);}function x(ka,la){if(!ka._threadID||!ka._olderMessageID[ka._threadID])return;var ma=m.getThreadMessagesSinceTimestamp(ka._threadID,ha(ka._olderMessageID[ka._threadID]));if(ma.length>ka._currentCountMap[ka._threadID])ka._currentCountMap[ka._threadID]=ma.length;z(ka,ma,la);}function y(ka,la){ka._loadMessagesInFlight[ka._threadID]=false;if(la&&la.length){var ma=la[0].timestamp,na=ka._olderMessageID[ka._threadID]?ha(ka._olderMessageID[ka._threadID]):null;if(!na||ma<na)ka._olderMessageID[ka._threadID]=la[0].message_id;}}function z(ka,la,ma){c('CSS').hide(ka._loadingSpinner);c('CSS').conditionShow(ka._loadMoreButton,!m.hasLoadedAllMessages(ka._threadID));var na=p.getThreadMetaNow(ka._threadID);if(na){var oa=na.message_count-la.length;oa=oa<0?0:oa;c('DOM').setContent(ka._loadMoreCount,oa);c('DOM').setContent(ka._loadingMoreCount,oa);}if(na&&na.is_canonical&&c('MercuryConfig').ShowContextBanner&&m.hasLoadedAllMessages(ka._threadID))ka.renderContextBanner(ka._threadID);var pa=function(xa){var ya,za=c('ge')('wm:'+xa);if(za)ya=c('WebMessengerMessageIDFinder').findAll(za);return ya||[];},qa=[],ra=c('MercuryMessageGroup').calculateMessageGroups(la),sa={},ta=[];ra.forEach(function(xa){var ya=xa[0].message_id,za=false;if(ma){za=xa.some(function(bb){return bb.message_id in ma;});if(!za){qa=pa(ya);za=qa.some(function(bb){return bb in ma;});}}if(!za){qa=pa(ya);if(xa.length==qa.length){for(var ab=0;ab<xa.length;ab++)if(xa[ab].message_id!=qa[ab]){za=true;break;}}else za=true;}if(za)sa[ya]=1;ta.push('wm:'+ya);});var ua=function(xa){return !sa[ra[xa][0].message_id];},va=function(xa){var ya=ra[xa],za=c('WebMessengerThreadMessagesRenderer').renderMessageGroup(ya);if(xa==ta.length-1)ka._messageGroup=za;return za.getRoot();},wa=function(xa){return c('WebMessengerThreadMessagesRenderer').renderMessageSeparatorForIndex(ra,xa);};c('MercuryListUpdateRenderer').updateList(ka._messageList,ta,ua,va,wa);ka._lastMessage=la[la.length-1];da(ka);ea(ka);ka._manager.poke();}function aa(ka,la){var ma=la[ka._threadID],na=ka._manager._flexArea.getScrollableArea(),oa=na.getScrollHeight();ma.forEach(function(ra){ra.timestamp_relative=c('formatDate')(new Date(ra.timestamp),'g:ia');var sa=c('MercuryMessageGroup').canAppendMessageToLastGroup(ka._lastMessage,ra);if(!sa){ka._messageGroup=c('WebMessengerThreadMessagesRenderer').renderMessageGroup([ra]);var ta=ra.timestamp,ua=ka._lastMessage?ka._lastMessage.timestamp:0,va=c('WebMessengerConstants').READ_VIEW_SEPARATOR_TIME_LIMIT;if(!ua||ta-ua>=va){var wa=c('WebMessengerThreadMessagesRenderer').renderMessageSeparator(ra);c('DOM').appendContent(ka._messageList,wa);}c('DOM').appendContent(ka._messageList,ka._messageGroup.getRoot());}else c('WebMessengerThreadMessagesRenderer').appendMessageToGroup(ka._messageGroup,ra);if(ra.author!=c('MercuryViewer').getID())c('CSS').addClass(ka._messageGroup.getRoot(),'unreadHighlight');ka._lastMessage=ra;});ka._manager._flexArea.poke();var pa=na.getScrollHeight(),qa=na.getScrollTop();ka._unseenMessagesNotice.updateOnMessagesReceived(oa,pa,qa,la);da(ka);if(ka._manager.isScrolledToBottom())ea(ka);}function ba(ka){c('CSS').addClass(ka._loadMoreButton,'async_saving');if(ka._loadMessagesInFlight[ka._threadID])return;ka._loadMessagesInFlight[ka._threadID]=true;ka._pagerExponent=Math.min(ka._pagerExponent+1,c('WebMessengerConstants').EXPONENTIAL_PAGER_MAX_CYCLES);var la=Math.pow(2,ka._pagerExponent),ma=ka._currentCountMap[ka._threadID]+la*c('MercuryThreadlistConstants').WEBMESSENGER_MORE_MESSAGES_COUNT;r(ka);var na=m.getThreadMessagesRange(ka._threadID,0,ma,function(oa){c('CSS').removeClass(ka._loadMoreButton,'async_saving');ka._currentCountMap[ka._threadID]=ma;y(ka,oa);ka._loadMessagesInFlight[ka._threadID]=false;},null,c('MercuryAPIArgsSource').WEBMESSENGER);if(na){ka._messagesSubscription={subscriber_id:na,thread_id:ka._threadID};}else x(ka);}function ca(ka){if(!ka._lastMessageIndicator){var la;ka._lastMessageIndicator=new (c('ReactComponentRenderer'))(c('MercuryLastMessageIndicator.react'),ka._indicatorNode);ka._lastMessageIndicator.setProps({threadID:ka._threadID,className:"_510o",indicatorWillShow:function(){return (la=ka._manager.isScrolledToBottom());},indicatorDidShow:function(){return (la&&ka._manager.scrollToBottom(true));}});}return ka._lastMessageIndicator;}function da(ka,la){ca(ka).setProps({lastMessage:ka._lastMessage});}function ea(ka){if(c('UserActivity').isActive(5000)){fa(ka);}else c('UserActivity').subscribeOnce(fa.bind(null,ka));}function fa(ka){if(!ka._threadID||!ka._active)return;o.markRead(ka._threadID);var la=c('DOM').scry(ka._messageList,'.unreadHighlight');la.forEach(function(ma){c('CSS').removeClass(ma,'unreadHighlight');c('CSS').addClass(ma,'unreadFading');new (c('Animation'))(ma).from('background','#eceff5').to('background','#fff').from('borderColor','#d6d6d6').to('borderColor','#fff').ease(c('Animation').ease.both).duration(1500).ondone(function(){c('CSS').removeClass(ma,'unreadFading');c('Style').set(ma,'background','');c('Style').set(ma,'borderColor','');}).go();});}function ga(ka,la){if(!la.mark_as_read)return;var ma=c('DOM').scry(ka._messageList,'.unreadHighlight');for(var na=0;na<ma.length;na++){var oa=ma[na],pa=c('WebMessengerMessageIDFinder').findAll(oa),qa=m.getMessagesFromIDs(pa);if(qa[qa.length-1].timestamp<la.timestamp)c('CSS').removeClass(oa,'unreadHighlight');}}function ha(ka){var la=m.getMessagesFromIDs([ka])[0];return la?la.timestamp:0;}function ia(ka){if(ka._builtNoSelectionBox)return;var la=function(){var na=c('WebMessengerStateManager').getCurrentStateData(),oa=babelHelpers['extends']({},na);c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN,Object.assign(oa,{start:true,thread_id:undefined}));},ma=function(){var na=c('WebMessengerStateManager').getCurrentStateData(),oa=babelHelpers['extends']({},na);c('WebMessengerStateManager').updateMasterState(c('WebMessengerStateConstants').MASTER.RECENT_THREADS,Object.assign(oa,{folder:c('MessagingTag').INBOX,filter:c('MessagingTag').UNREAD}));};c('DOM').setContent(ka._noSelectedConversation,c('WebMessengerInfoBoxRenderer').render(i._("No Conversation Selected"),[{text:i._("New Message"),handler:la},{text:i._("Show Unread"),handler:ma}]));ka._builtNoSelectionBox=true;}function ja(ka){var la=ka._manager._flexArea.getScrollableArea(),ma=ka._manager.getFlexAreaBoundingClientRect();c('Arbiter').inform('messengerScrolled/'+ka._threadID,{scrollTop:la.getScrollTop(),top:ma.y,viewHeight:ma.height});}f.exports=q;},null);
__d('MercurySearchContextResults',['KeyedCallbackManager','MercuryAPIArgsSource','MercuryIDs','MercuryThreadlistConstants','MercuryThreadIDMap','RangedCallbackManager','MercuryServerDispatcher','MercuryServerPayloadPreprocessor','WebMessengerConstants'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryThreadIDMap').get(),i=c('MercuryServerPayloadPreprocessor').get(),j=new (c('KeyedCallbackManager'))(),k=c('MercuryThreadlistConstants').WEBMESSENGER_SEARCH_SNIPPET_COUNT,l=c('WebMessengerConstants').MORE_SEARCH_CONTEXT_COUNT,m={getSearchContext:function(q,r,s){if(q){var t=j.executeOrEnqueue(q,function(y){var z=o(y,q);s(z);}),u=j.getUnavailableResources(t);if(u.length){var v={message_id:q,limit:k+1},w=h.getServerIDFromClientIDNow(r),x=c('MercuryIDs').tokenize(r);if(x.type=='user'){v.other_user_fbid=w;}else v.thread_fbid=w;p(v);}return t;}},getMoreSearchContext:function(q,r,s,t){if(q){var u=j.getResource(q);if(u){var v=s==c('WebMessengerConstants').MORE_SEARCH_CONTEXT_UP?u.up_message_ids:u.down_message_ids,w=v.getCurrentArraySize()+l,x=v.executeOrEnqueue(0,w,function(){var ca=o(u,q);t(ca);}),y=v.getUnavailableResources(x);if(y.length){var z={message_id:q,limit:w,direction:s},aa=h.getServerIDFromClientIDNow(r),ba=c('MercuryIDs').tokenize(r);if(ba.type=='user'){z.other_user_fbid=aa;}else z.thread_fbid=aa;p(z);}return x;}}},handleUpdate:function(q){if(q.mercury_payload)i.handleUpdate(q.mercury_payload);var r=q.search_context||{};for(var s in r){var t=r[s],u=t.other_user_fbid||t.thread_fbid,v=h.getClientIDFromServerIDNow(u),w=!j.getResource(s),x=w?{thread_id:v,up_message_ids:new (c('RangedCallbackManager'))(),down_message_ids:new (c('RangedCallbackManager'))()}:j.getResource(s),y=w?k+1:l;if(t.up_message_ids&&(x.up_message_ids.getCurrentArraySize()===0||t.up_message_ids.length>=x.up_message_ids.getCurrentArraySize()))n(x.up_message_ids,t.up_message_ids,y);if(t.down_message_ids&&(x.down_message_ids.getCurrentArraySize()===0||t.down_message_ids.length>=x.down_message_ids.getCurrentArraySize()))n(x.down_message_ids,t.down_message_ids,y);if(w)j.setResource(s,x);}},unsubscribe:function(q,r,s){if(r){var t=j.getResource(r);if(t){if(s==c('WebMessengerConstants').MORE_SEARCH_CONTEXT_UP){t.up_message_ids.unsubscribe(q);}else t.down_message_ids.unsubscribe(q);}else j.unsubscribe(q);}}};function n(q,r,s){var t=q.getCurrentArraySize(),u=r.length<t+s;if(r.length){q.removeAllResources();q.addResourcesWithoutSorting(r,0);}if(u)q.setReachedEndOfArray();}function o(q,r){var s=q.up_message_ids.hasReachedEndOfArray(),t=q.up_message_ids.getAllResources();if(!s)t.shift();var u=q.down_message_ids.hasReachedEndOfArray(),v=q.down_message_ids.getAllResources();if(!u)v.pop();return {thread_id:q.thread_id,message_id:r,up_message_ids:t,up_exhausted:s,down_message_ids:v,down_exhausted:u};}function p(q){q.client=c('MercuryAPIArgsSource').WEBMESSENGER;c('MercuryServerDispatcher').trySend('/ajax/mercury/search_context.php',q);}c('MercuryServerDispatcher').registerEndpoints({'/ajax/mercury/search_context.php':{mode:c('MercuryServerDispatcher').IMMEDIATE,handler:m.handleUpdate}});f.exports=m;},null);
__d('MercurySearchSnippetResults',['MercuryAPIArgsSource','MercuryIDs','MercurySingletonMixin','MercuryThreadlistConstants','MercuryThreadIDMap','RangedCallbackManager','MercuryServerDispatcher','MercuryServerPayloadPreprocessor'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={},i={},j=null,k=c('MercuryThreadlistConstants').WEBMESSENGER_SEARCH_SNIPPET_COUNT,l=c('MercuryThreadlistConstants').WEBMESSENGER_SEARCH_SNIPPET_LIMIT,m=c('MercuryThreadlistConstants').WEBMESSENGER_SEARCH_SNIPPET_MORE;function n(x){'use strict';this.$MercurySearchSnippetResults1=x;this.$MercurySearchSnippetResults2=c('MercuryServerPayloadPreprocessor').getForFBID(x);c('MercuryServerDispatcher').registerEndpoints({'/ajax/mercury/search_snippets.php':{request_user_id:x,mode:c('MercuryServerDispatcher').IMMEDIATE,handler:function(y){this.handleUpdate(y);}.bind(this)}});this.$MercurySearchSnippetResults3=c('MercuryThreadIDMap').getForFBID(x);}n.prototype.getFBID=function(){'use strict';return this.$MercurySearchSnippetResults1;};n.prototype.getThreadIDMap=function(){'use strict';return this.$MercurySearchSnippetResults3;};n.prototype.getAllThreadSearchResults=function(x,y){'use strict';if(x)o(this.$MercurySearchSnippetResults1,x,l,0,y);};n.prototype.getAllThreadSearchMoreResults=function(x,y){'use strict';if(x){var z=h[x];if(z){var aa=z.getCurrentArraySize();o(this.$MercurySearchSnippetResults1,x,m,aa,y);}}};n.prototype.getSingleThreadSearchResults=function(x,y,z){'use strict';if(!x||!y)return;p.call(this,x,y,k,0,z);};n.prototype.getSingleThreadSearchMoreResults=function(x,y,z){'use strict';if(!x||!y)return;if(!i[y])return;var aa=i[y][x];if(aa){var ba=aa.num_total_snippets,ca=aa.snippets_cbm.getCurrentArraySize(),da=ba-ca;if(da>0){var ea=da>m?m:da;p.call(this,x,y,ea,ca,z);}}};n.prototype.countSnippetsMatchingQueryInThread=function(x,y){'use strict';var z=i[y][x];if(z)return z.num_total_snippets;};n.prototype.findIndexOfSnippet=function(x,y,z,aa){'use strict';var ba=v(x,y),ca=ba.getAllResources();for(var da=0;da<ca.length;da++)if(z===ca[da].message_id)return da;};n.prototype.findSnippetAtIndex=function(x,y,z,aa){'use strict';s(x,y,z);t.call(this,x,y,z,aa);};n.prototype.handleUpdate=function(x){'use strict';if(x.mercury_payload)this.$MercurySearchSnippetResults2.handleUpdate(x.mercury_payload);var y=x.search_snippets||{};Object.keys(y).filter(function(na){return !!y[na];}).forEach(function(na){Object.keys(y[na]).forEach(function(oa){y[na][oa].snippets.forEach(function(pa){pa.matched_keywords=q(pa.matched_keywords);});});});var z=x.offset,aa=[];for(var ba in y){var ca=y[ba];for(var da in ca){var ea=ca[da],fa=x.other_user_fbid||x.thread_fbid,ga=this.$MercurySearchSnippetResults3.getClientIDFromServerIDNow(da),ha=ea.snippets,ia=v(ba,ga),ja=ia.getCurrentArraySize();if(!fa){aa.push(ga);if(ja)continue;}else if(z!=ja)continue;var ka=i[ga][ba];ka.num_total_snippets=ea.num_total_snippets;ia.addResourcesWithoutSorting(ha,ja);if(!fa||x.limit>ha.length)if(ia.getCurrentArraySize()==ka.num_total_snippets)ia.setReachedEndOfArray();}if(!fa){var la=u(ba),ma=la.getCurrentArraySize();if(z==ma){la.addResourcesWithoutSorting(aa,ma);if(x.limit>aa.length)la.setReachedEndOfArray();}}}};function o(x,y,z,aa,ba){r();var ca=u(y),da=aa+z,ea=ca.executeOrEnqueue(0,da,function(ha){var ia={};for(var ja=0;ja<ha.length;ja++){var ka=ha[ja],la=i[ka][y];ia[ka]={num_total_snippets:la.num_total_snippets,snippets:la.snippets_cbm.getAllResources()};}var ma=ca.hasReachedEndOfArray();ba(ia,ma);}),fa=ca.getUnavailableResources(ea);if(fa.length){j={query:y,thread_id:null,subscriber_id:ea};var ga={query:y,offset:aa,limit:z+1,snippetLimit:k};ga.identifier='thread_fbid';w(ga,x);}}function p(x,y,z,aa,ba){r();var ca=v(x,y),da=aa+z,ea=ca.executeOrEnqueue(0,da,function(){var ka=ca.getAllResources(),la=i[y][x].num_total_snippets;ba(ka,la);}),fa=ca.getUnavailableResources(ea);if(fa.length){j={query:x,thread_id:y,subscriber_id:ea};var ga={query:x,snippetOffset:aa,snippetLimit:z},ha=this.getThreadIDMap().getServerIDFromClientIDNow(y),ia=c('MercuryIDs').tokenize(y),ja=ia.type;if(ja=='user'){ga.other_user_fbid=ha;}else ga.thread_fbid=ha;ga.identifier='thread_fbid';w(ga,this.getFBID());}}function q(x){if(x instanceof Array){var y={};for(var z=0;z<x.length;z++)y[z.toString()]=x[z];return y;}else return x;}function r(){if(j){if(j.thread_id){var x=v(j.query,j.thread_id);x.unsubscribe(j.subscriber_id);}else{var y=u(j.query);y.unsubscribe(j.subscriber_id);}j=null;}}function s(x,y,z){}function t(x,y,z,aa){var ba=i[y][x],ca=ba.snippets_cbm.getAllResources(),da=ba.num_total_snippets,ea=ca.length;if(z<ea){aa(ca[z].message_id);return;}var fa=da-ea,ga=fa>m?m:fa;p.call(this,x,y,ga,ea,function(ha,ia){t.call(this,x,y,z,aa);});}function u(x){if(!h[x])h[x]=new (c('RangedCallbackManager'))();return h[x];}function v(x,y){if(!i[y])i[y]={};var z=i[y][x];if(!z){z={num_total_snippets:-1,snippets_cbm:new (c('RangedCallbackManager'))()};i[y][x]=z;}return z.snippets_cbm;}function w(x,y){x.client=c('MercuryAPIArgsSource').WEBMESSENGER;c('MercuryServerDispatcher').trySend('/ajax/mercury/search_snippets.php',x,null,y);}Object.assign(n,c('MercurySingletonMixin'));f.exports=n;},null);
__d('WebMessengerDetailViewSearchContextControl',['fbt','Event','CSS','DOM','MercuryMessageGroup','MercuryMessages','WebMessengerMessagesSelection','MercurySearchContextResults','MercurySearchSnippetResults','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerThreadMessagesRenderer','WebMessengerConstants','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercuryMessages').get(),j=c('MercurySearchSnippetResults').get();function k(u,v,w){'use strict';this._manager=u;this._rootElement=v;this._paginationBox=w;c('DOM').empty(this._rootElement);var x=c('WebMessengerTemplates')[':fb:web-messenger:read-view:search-context'].build(),y=c('WebMessengerTemplates')[':fb:web-messenger:read-view:search-pagination-box'].build();c('DOM').setContent(this._rootElement,x.getRoot());c('DOM').setContent(this._paginationBox,y.getRoot());this._messagelistRoot=x.getRoot();this._loadingSpinner=x.getNode('loadingSpinner');this._messageList=x.getNode('messagelist');this._loadMoreButton=x.getNode('loadMoreButton');this._loadMoreLink=x.getNode('loadMoreLink');this._downMoreButton=x.getNode('downMoreButton');this._downMoreLink=x.getNode('downMoreLink');this._nextSnippet=y.getNode('nextSnippet');this._previousSnippet=y.getNode('previousSnippet');this._backToSnippetsButton=y.getNode('backToSnippetsButton');this._snippetCountDescription=y.getNode('snippetCountDescription');this._paginationBoxCloseButton=y.getNode('paginationBoxCloseButton');this._state=null;this._threadID=null;this._messageID=null;c('WebMessengerThreadMessagesRenderer').setupSelectionListener(this._messageList);c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._loadMoreLink,'click',function(){c('CSS').addClass(this._loadMoreButton,'async_saving');s(this,c('WebMessengerConstants').MORE_SEARCH_CONTEXT_UP);}.bind(this)),c('Event').listen(this._downMoreLink,'click',function(){c('CSS').addClass(this._downMoreButton,'async_saving');s(this,c('WebMessengerConstants').MORE_SEARCH_CONTEXT_DOWN);}.bind(this)),c('Event').listen(this._nextSnippet,'click',l.bind(null,this,1)),c('Event').listen(this._previousSnippet,'click',l.bind(null,this,-1)),c('Event').listen(this._backToSnippetsButton,'click',function(){var z=c('WebMessengerStateManager').getCurrentStateData(),aa=z.single_thread_search?c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET:c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET,ba={folder:z.folder,message_query:z.message_query,query:z.query};if(z.single_thread_search)ba.thread_id=z.thread_id;c('WebMessengerStateManager').updateDetailState(aa,ba);}),c('Event').listen(this._paginationBoxCloseButton,'click',function(){c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{thread_id:c('WebMessengerStateManager').getCurrentStateData().thread_id});}.bind(this)));}k.prototype.hideView=function(){'use strict';c('CSS').hide(this._rootElement);c('CSS').hide(this._paginationBox);};k.prototype.updateView=function(){'use strict';c('CSS').show(this._rootElement);c('CSS').show(this._paginationBox);var u=o(this);p(this);c('WebMessengerMessagesSelection').clear();if(u)r(this);};k.prototype.destroy=function(){'use strict';n(this);};function l(u,v){var w=c('WebMessengerStateManager').getCurrentStateData(),x=j.findIndexOfSnippet(u._messageQuery,w.thread_id,w.message_id),y=x+v;c('CSS').hide(u._messageList);c('CSS').hide(u._loadMoreButton);c('CSS').hide(u._downMoreButton);c('CSS').show(u._loadingSpinner);j.findSnippetAtIndex(u._messageQuery,w.thread_id,y,function(z){c('CSS').show(u._messageList);m(w,z);});}function m(u,v){var w={folder:u.folder,message_id:v,message_query:u.message_query,query:u.query,single_thread_search:u.single_thread_search,thread_id:u.thread_id};c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateManager').getCurrentDetailState(),w);}function n(u){u._searchContextSubscription&&c('MercurySearchContextResults').unsubscribe(u._searchContextSubscription.subscriber_id,u._searchContextSubscription.message_id,u._searchContextSubscription.direction);u._searchThreadsSubscription=null;}function o(u){var v=c('WebMessengerStateManager').getCurrentStateData();if(u._threadID!=v.thread_id)return true;if(u._messageQuery!=v.message_query)return true;if(u._messageID!=v.message_id)return true;return false;}function p(u){var v=c('WebMessengerStateManager').getCurrentStateData();u._state=c('WebMessengerStateManager').getCurrentDetailState();u._threadID=v.thread_id;u._messageQuery=v.message_query;u._messageID=v.message_id;u._selectionEnabled=!!v.message_action;c('WebMessengerThreadMessagesRenderer').updateSelection(u._messageList);c('CSS').conditionClass(u._messageList,'bugReportingEnabled',v.bug_reporting_enabled);}function q(u,v){c('DOM').setAttributes(u,{disabled:v});var w=c('DOM').find(u,'^label');c('CSS').conditionClass(w,'uiButtonDisabled',v);}function r(u){var v=c('DOM').create('strong',{},u._messageQuery),w=j.countSnippetsMatchingQueryInThread(u._messageQuery,u._threadID),x=j.findIndexOfSnippet(u._messageQuery,u._threadID,u._messageID),y=x+1,z=h._({"*":"{index} of {count} results for {query}"},[h.param('index',y),h.param('count',w,[0]),h.param('query',v)]);c('DOM').setContent(u._snippetCountDescription,z);q(u._previousSnippet,x===0);q(u._nextSnippet,x===w-1);c('DOM').empty(u._messageList);c('CSS').show(u._loadingSpinner);c('CSS').hide(u._loadMoreButton);c('CSS').hide(u._downMoreButton);n(u);if(u._threadID&&u._messageID){var aa=c('MercurySearchContextResults').getSearchContext(u._messageID,u._threadID,function(ba){c('CSS').hide(u._loadingSpinner);t(u,ba);});if(aa)u._searchContextSubscription={subscriber_id:aa,message_id:u._messageID};}}function s(u,v){n(u);if(u._threadID&&u._messageID){var w=c('MercurySearchContextResults').getMoreSearchContext(u._messageID,u._threadID,v,function(x){if(v==c('WebMessengerConstants').MORE_SEARCH_CONTEXT_UP){c('CSS').removeClass(u._loadMoreButton,'async_saving');}else c('CSS').removeClass(u._downMoreButton,'async_saving');t(u,x);});if(w)u._searchContextSubscription={subscriber_id:w,message_id:u._messageID,direction:v};}}function t(u,v){c('CSS').conditionShow(u._loadMoreButton,!v.up_exhausted);c('CSS').conditionShow(u._downMoreButton,!v.down_exhausted);var w=v.up_message_ids.concat([v.message_id],v.down_message_ids),x=i.getMessagesFromIDs(w);c('DOM').empty(u._messageList);var y=c('MercuryMessageGroup').calculateMessageGroups(x);y.forEach(function(z,aa){var ba=c('WebMessengerThreadMessagesRenderer').renderMessageSeparatorForIndex(y,aa);if(ba)c('DOM').appendContent(u._messageList,ba);var ca=c('WebMessengerThreadMessagesRenderer').renderMessageGroup(z,false,'context:').getRoot(),da=z.some(function(ea){return ea.message_id==v.message_id;});if(da)c('CSS').addClass(ca,'selectedHighlight');c('DOM').appendContent(u._messageList,ca);});}f.exports=k;},null);
__d('WebMessengerSearchSnippetsRenderer',['cx','fbt','Event','CSS','DOM','Image.react','MercuryMessageRenderer','MercuryParticipants','MercuryParticipantsConstants','React','ReactDOM','MercurySearchSnippetResults','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','MercuryThreadMetadataRenderer'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('MercurySearchSnippetResults').get(),k=c('MercuryThreadMetadataRenderer').get(),l={renderMultipleSnippetBlocks:function(r,s,t){t=t||{};var u=true;for(var v in t){u=false;var w=c('WebMessengerTemplates')[':fb:web-messenger:read-view:search-snippets-block'].build();c('DOM').appendContent(r,w.getRoot());l.renderSingleSnippetBlock(w,s,v,t[v]);}if(u)q(r);},renderThreadSnippetBlock:function(r,s,t,u,v){if(!u||!u.length){q(r);return;}var w=c('WebMessengerTemplates')[':fb:web-messenger:read-view:search-snippets-block'].build();c('DOM').appendContent(r,w.getRoot());c('CSS').hide(w.getNode('searchThreadName'));m(w,s,t,u,v);},renderSingleSnippetBlock:function(r,s,t,u){var v=r.getNode('searchThreadName'),w=c('DOM').create('h3');c('DOM').setContent(v,w);k.renderAndSeparatedParticipantList(t,w);m(r,s,t,u.snippets,u.num_total_snippets);},renderMultipleSnippets:function(r,s,t,u){(u||[]).forEach(function(v){var w=c('WebMessengerTemplates')[':fb:web-messenger:read-view:search-snippet'].build();c('DOM').appendContent(r,w.getRoot());c('MercuryParticipants').get(v.author,function(x){l.renderSingleSnippet(w,s,t,v,x);});});},renderSingleSnippet:function(r,s,t,u,v){r.setNodeProperty('bodyDiv','id','snippet:'+u.message_id);var w=u.matched_keywords||undefined,x=c('MercuryMessageRenderer').formatMessageBody(u.body,w);r.setNodeContent('body',x);var y=r.getNode('image');c('CSS').removeClass(y,'MercuryThreadImage');c('CSS').addClass(y,'MercuryMediumThreadImage');var z=c('React').createElement(c('Image.react'),{width:c('MercuryParticipantsConstants').IMAGE_SIZE,height:c('MercuryParticipantsConstants').IMAGE_SIZE,src:v.image_src});if(v.href)z=c('React').createElement('a',{href:v.href},z);c('ReactDOM').render(z,y);var aa=v.short_name;r.setNodeContent('shortName',i._("{name}:",[i.param('name',aa)])+' ');k.renderTimestamp(r.getNode('timestamp'),u.timestamp_absolute,u.timestamp_relative,u.timestamp);var ba=r.getNode('seeContext');c('Event').listen(ba,'click',function(){var ca=c('WebMessengerStateManager').getCurrentStateData(),da={message_query:s,query:ca.query,thread_id:t,message_id:u.message_id},ea=c('WebMessengerStateManager').getCurrentDetailState();if(ea===c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET)da.single_thread_search=true;c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT,da);return false;});}};function m(r,s,t,u,v){var w=r.getNode('snippetList');l.renderMultipleSnippets(w,s,t,u);var x=v-u.length;n(r,s,t,v,x);}function n(r,s,t,u,v){var w=r.getNode('totalSnippetsCount'),x=r.getNode('moreSnippetsLink');c('CSS').conditionShow(x,v>0);if(v>0){var y=p(v);c('DOM').setContent(x,y);}c('DOM').setContent(w,o(u));if(v>0)c('Event').listen(x,'click',function(){j.getSingleThreadSearchMoreResults(s,t,function(z){c('DOM').empty(r.getNode('snippetList'));m(r,s,t,z,u);});});}function o(r){if(r==1){return i._("1 result in total");}else return i._({"*":"{count} results in total"},[i.param('count',r,[0])]);}function p(r){if(r==1){return i._("Show 1 more result");}else return i._({"*":"Show {count} more results"},[i.param('count',r,[0])]);}function q(r){var s=i._("No results"),t=c('DOM').create('div',{className:"_2n4"},s);c('DOM').setContent(r,t);}f.exports=l;},null);
__d('WebMessengerDetailViewSearchSnippetsControl',['cx','fbt','JSXDOM','Event','CSS','DOM','MercurySearchSnippetResults','WebMessengerSearchSnippetsRenderer','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerPermalinks','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('MercurySearchSnippetResults').get();function k(p,q){'use strict';this._manager=p;this._rootElement=q;c('DOM').empty(this._rootElement);var r=c('WebMessengerTemplates')[':fb:web-messenger:read-view:search-snippets'].build();c('DOM').setContent(this._rootElement,r.getRoot());this._loadingSpinner=r.getNode('loadingSpinner');this._messageList=r.getNode('messagelist');this._downMoreButton=r.getNode('downMoreButton');this._downMoreLink=r.getNode('downMoreLink');this._state=null;this._messageQuery=null;this._threadID=null;c('CSS').hide(this._downMoreButton);c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._downMoreLink,'click',function(){c('CSS').addClass(this._downMoreButton,'async_saving');o(this);}.bind(this)));}k.prototype.hideView=function(){'use strict';c('CSS').hide(this._rootElement);};k.prototype.updateView=function(){'use strict';c('CSS').show(this._rootElement);var p=l(this);m(this);if(p)n(this);};k.prototype.destroy=function(){'use strict';};function l(p){var q=c('WebMessengerStateManager').getCurrentDetailState();if(p._state!=q)return true;var r=c('WebMessengerStateManager').getCurrentStateData();if(p._messageQuery!=r.message_query)return true;if(q==c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET)if(p._threadID!=r.thread_id)return true;return false;}function m(p){p._state=c('WebMessengerStateManager').getCurrentDetailState();var q=c('WebMessengerStateManager').getCurrentStateData();p._threadID=q.thread_id;p._messageQuery=q.message_query;}function n(p){c('CSS').hide(p._downMoreButton);c('DOM').empty(p._messageList);if(p._messageQuery){c('CSS').show(p._loadingSpinner);if(p._state===c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET&&p._threadID){j.getSingleThreadSearchResults(p._messageQuery,p._threadID,function(q,r){c('CSS').hide(p._loadingSpinner);c('WebMessengerSearchSnippetsRenderer').renderThreadSnippetBlock(p._messageList,p._messageQuery,p._threadID,q,r);var s=c('JSXDOM').a({className:"_4-ii"},i._("Search all conversations for \"{query}\"",[i.param('query',p._messageQuery)])),t=c('WebMessengerPermalinks').getURI(c('WebMessengerStateConstants').MASTER.SEARCH,c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET,{query:p._messageQuery,message_query:p._messageQuery});s.setAttribute('href',t);c('DOM').prependContent(p._messageList,c('JSXDOM').div({className:"_4-ij"},s));});}else j.getAllThreadSearchResults(p._messageQuery,function(q,r){c('CSS').hide(p._loadingSpinner);c('WebMessengerSearchSnippetsRenderer').renderMultipleSnippetBlocks(p._messageList,p._messageQuery,q);c('CSS').conditionShow(p._downMoreButton,!r);});}}function o(p){if(p._messageQuery)j.getAllThreadSearchMoreResults(p._messageQuery,function(q,r){c('CSS').removeClass(p._downMoreButton,'async_saving');c('DOM').empty(p._messageList);c('WebMessengerSearchSnippetsRenderer').renderMultipleSnippetBlocks(p._messageList,p._messageQuery,q);c('CSS').conditionShow(p._downMoreButton,!r);});}f.exports=k;},null);
__d('WebMessengerSharedPhotos.react',['cx','fbt','glyph','AsyncRequest','Grid.react','Image.react','immutable','LoadingIndicator.react','MessagesViewer','MessagesViewerSetID','Pixelz.react','React','WebMessengerStateConstants','WebMessengerStateManager','URI','XUIButton.react'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('Grid.react').GridItem,m=i._("Return to Conversation"),n=42,o=c('React').createClass({displayName:'WebMessengerSharedPhotos',propTypes:{threadID:k.string.isRequired,totalWidth:k.number.isRequired},getInitialState:function(){return {isLoadingMore:true,moreImages:true,imagesData:c('immutable').List()};},componentDidMount:function(){this.requestImages();c('MessagesViewer').preload();},componentDidUpdate:function(){if(!this.isVisible())this.requestImages();},componentWillReceiveProps:function(p){if(p.threadID&&p.threadID!==this.props.threadID)this.setState({isLoadingMore:true,moreImages:true,imagesData:c('immutable').List()});},isVisible:function(){return !(this.state.isLoadingMore&&this.state.moreImages&&this.state.imagesData.isEmpty());},loadMoreImages:function(){if(this.state.moreImages&&!this.state.isLoadingMore){this.setState({isLoadingMore:true});this.requestImages();}},renderImages:function(){var p=Math.floor((this.props.totalWidth-n)/3),q=this.state.imagesData,r=q.map(function(s){return (c('React').createElement(l,{key:s.fbid},c('React').createElement('div',{className:"_5dq3",onClick:this.viewFullImage.bind(null,s)},c('React').createElement(c('Pixelz.react'),{upscale:true,width:p,height:p,resizeMode:'cover',src:s.uri,borderRadius:1,insetBorderColor:'rgba(0, 0, 0, 0.1)'}))));}.bind(this));return r;},viewFullImage:function(p){var q=new (c('URI'))('/ajax/messaging/attachments/sharedphotos.php').setQueryData({thread_id:this.props.threadID,image_id:p.fbid});c('MessagesViewer').bootstrapWithConfig({fbid:p.fbid,dimensions:p.dim,src:p.uri,disablePaging:this.state.imagesData.size===1,endpoint:q,setID:c('MessagesViewerSetID').MESSAGES_VIEW_ALL_IN_THREAD});},requestImages:function(){new (c('AsyncRequest'))().setURI('/ajax/messaging/attachments/sharedphotos.php').setMethod('POST').setData({thread_id:this.props.threadID,offset:this.state.imagesData.size,limit:30}).setHandler(function(p){var q=p.getPayload();this.setState({isLoadingMore:false,moreImages:q.moreImagesToLoad,imagesData:this.state.imagesData.concat(q.imagesData)});}.bind(this)).send();},returnToThread:function(){var p=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData());c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,p);},render:function(){var p=c('React').createElement('div',{className:(this.isVisible()?"_5dq2":'')+(!this.isVisible()?' '+"_5dq1":'')+(!this.isVisible()?' '+"_5dpz":'')},c('React').createElement(c('LoadingIndicator.react'),{color:'white',size:'large'}));if(!this.isVisible()){return p;}else if(!this.state.isLoadingMore)p=null;return (c('React').createElement('div',{className:"_5dpz"},c('React').createElement('div',{className:"_5dp-"},c('React').createElement(c('XUIButton.react'),{image:c('React').createElement(c('Image.react'),{src:j('back')}),label:m,size:'medium',onClick:this.returnToThread})),c('React').createElement('div',{className:"_5dq0"},c('React').createElement(c('Grid.react'),{cols:3,fixed:false},this.renderImages()),p)));}});f.exports=o;},null);
__d('WebMessengerDetailViewSharedPhotosControl',['CSS','DOM','ReactComponentRenderer','MercuryThreadIDMap','WebMessengerSharedPhotos.react','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerEvents','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryThreadIDMap').get();function i(j,k){'use strict';this.manager=j;this.rootElement=k;this.renderer=null;this.serverID=null;this.state=null;this.threadID=null;c('DOM').empty(this.rootElement);c('WebMessengerSubscriptionsHandler').addSubscriptions(this.manager.subscribe('scrolledNearBottom',this.notifyImageRequest.bind(this)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').DETAIL_DOM_CHANGED,this.render.bind(this)));}i.prototype.hideView=function(){'use strict';c('CSS').hide(this.rootElement);};i.prototype.updateView=function(){'use strict';c('CSS').show(this.rootElement);this.updateStateAndData();this.render();};i.prototype.destroy=function(){'use strict';c('WebMessengerSubscriptionsHandler').release();};i.prototype.updateStateAndData=function(){'use strict';this.state=c('WebMessengerStateManager').getCurrentDetailState();var j=c('WebMessengerStateManager').getCurrentStateData();this.threadID=j.thread_id;};i.prototype.render=function(){'use strict';this.serverID=h.getServerIDFromClientIDNow(this.threadID);if(!this.serverID)return;if(!this.renderer){this.renderer=new (c('ReactComponentRenderer'))(c('WebMessengerSharedPhotos.react'),this.rootElement);this.renderer.setProps({threadID:this.serverID,totalWidth:this.rootElement.clientWidth});}else this.renderer.setProps({threadID:this.serverID,totalWidth:this.rootElement.clientWidth});};i.prototype.notifyImageRequest=function(){'use strict';var j=c('WebMessengerStateManager').getCurrentDetailState();if(j===c('WebMessengerStateConstants').DETAIL.SHARED_PHOTOS&&this.renderer)this.renderer.component.loadMoreImages();};f.exports=i;},null);
__d('MercurySheetPolicy',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={canReplaceOpenSheet:function(i,j){if(i.isSheetWithInput&&i.isSheetWithInput())return j.getType()!=i.getType()&&j.isSheetWithInput&&j.isSheetWithInput();if(i.getType()==j.getType())return false;if(i.isPermanent()&&!j.isPermanent())return false;if(i.getType()==='message-blocked')return false;return true;}};f.exports=h;},null);
__d('MercurySheetView',['cx','Animation','ArbiterMixin','MercurySheetPolicy','CSS','DOM','Style','Vector','setTimeoutAcrossTransitions'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=5000,j=function(k,l,m){this._threadID=k;this._rootElement=l;this._tabMainElement=m;this._openSheet=null;};Object.assign(j.prototype,c('ArbiterMixin'),{destroy:function(){c('DOM').empty(this._rootElement);},_openCommon:function(k,l){if(this._openSheet&&!c('MercurySheetPolicy').canReplaceOpenSheet(this._openSheet,k)){if(k.couldNotReplace)k.couldNotReplace();return;}this.clear(function(){this._openSheet=k;c('CSS').show(this._rootElement);k.render();if(l){c('CSS').addClass(this._tabMainElement,'sheetSlide');c('CSS').addClass(this._tabMainElement,"_1sk4");var m=c('Vector').getElementDimensions(this._rootElement).y;c('Style').set(this._rootElement,'bottom',m+'px');this.resize();this._animation=new (c('Animation'))(this._rootElement).to('bottom',0).duration(150).ease(c('Animation').ease.both).ondone(function(){c('CSS').removeClass(this._tabMainElement,'sheetSlide');c('CSS').removeClass(this._tabMainElement,"_1sk4");this.resize();}.bind(this)).go();}else this.resize();if(!k.isPermanent()){var n=i;if(k.getCloseTimeout)n=k.getCloseTimeout();var o=this.getAutoCloseCallback(k);this._sheetCloseHandler=c('setTimeoutAcrossTransitions')(this.close.bind(this,k,o),n);if(k.timeoutCanBeReset)k.setResetTimeoutCallback(this.resetTimeout.bind(this));}}.bind(this));},getAutoCloseCallback:function(k){if(!k.autoCloseCallback)return null;return k.autoCloseCallback.bind(k);},resetTimeout:function(k,l){clearTimeout(this._sheetCloseHandler);var m=this.getAutoCloseCallback(k);this._sheetCloseHandler=c('setTimeoutAcrossTransitions')(this.close.bind(this,k,m),l);},set:function(k){return this._openCommon(k,false);},open:function(k){return this._openCommon(k,true);},close:function(k,l){if(this._openSheet!=k)return;if(!this._openSheet){l&&l();return;}if(this._animation)this._animation.stop();if(this._sheetCloseHandler){clearTimeout(this._sheetCloseHandler);this._sheetCloseHandler=null;}c('CSS').addClass(this._tabMainElement,'sheetSlide');c('CSS').addClass(this._tabMainElement,"_1sk4");var m=c('Vector').getElementDimensions(this._rootElement).y;this.resize();this._animation=new (c('Animation'))(this._rootElement).to('bottom',m+'px').duration(100).ease(c('Animation').ease.begin).ondone(function(){c('DOM').empty(this._rootElement);c('CSS').hide(this._rootElement);c('CSS').removeClass(this._tabMainElement,'sheetSlide');c('CSS').removeClass(this._tabMainElement,"_1sk4");this._openSheet=null;this.resize();l&&l();}.bind(this)).go();},clear:function(k){this.close(this._openSheet,k);},resize:function(){this.inform('resize');}});f.exports=j;},null);
__d('WebMessengerIsMessageBlockedSheet',['fbt','ArbiterMixin','DOM','Event','WebMessengerTemplates','mixin'],function a(b,c,d,e,f,g,h){var i,j;if(c.__markCompiled)c.__markCompiled();i=babelHelpers.inherits(k,c('mixin')(c('ArbiterMixin')));j=i&&i.prototype;function k(l,m,n){'use strict';j.constructor.call(this);this.$WebMessengerIsMessageBlockedSheet1=l;this.$WebMessengerIsMessageBlockedSheet2=m;this.$WebMessengerIsMessageBlockedSheet3=n;}k.prototype.render=function(){'use strict';var l=c('WebMessengerTemplates')[':fb:mercury:messages-blocked-sheet'].build(),m=h._("Messages from this recipient are blocked.");c('DOM').setContent(this.$WebMessengerIsMessageBlockedSheet2,l.getRoot());c('DOM').setContent(l.getNode('text'),m+' ');c('Event').listen(l.getNode('unblockButton'),'click',function(){this.inform('clicked',this.$WebMessengerIsMessageBlockedSheet1);}.bind(this));};k.prototype.isPermanent=function(){'use strict';return true;};k.prototype.getType=function(){'use strict';return 'message-blocked';};k.prototype.open=function(){'use strict';this.$WebMessengerIsMessageBlockedSheet3.open(this);};k.prototype.close=function(){'use strict';this.$WebMessengerIsMessageBlockedSheet3.close(this);};f.exports=k;},null);
__d('WebMessengerThreadIsMutedTabSheet',['fbt','Event','ArbiterMixin','DOM','WebMessengerTemplates','mixin'],function a(b,c,d,e,f,g,h){var i,j;if(c.__markCompiled)c.__markCompiled();i=babelHelpers.inherits(k,c('mixin')(c('ArbiterMixin')));j=i&&i.prototype;function k(l,m){'use strict';j.constructor.call(this);this._rootElement=l;this._sheetView=m;}k.prototype.render=function(){'use strict';var l=c('WebMessengerTemplates')[':fb:web-messenger:read-view:message-mute-sheet'].build();c('DOM').setContent(l.getNode('text'),h._("This conversation is muted. Chat tabs will not pop up for it and push notifications are off."));c('DOM').setContent(this._rootElement,l.getRoot());c('Event').listen(l.getNode('unmuteButton'),'click',function(){this.inform('clicked',null);}.bind(this));};k.prototype.isPermanent=function(){'use strict';return false;};k.prototype.getType=function(){'use strict';return 'wb-thread-is-muted';};k.prototype.open=function(){'use strict';this._sheetView.open(this);};k.prototype.close=function(){'use strict';this._sheetView.close(this);};f.exports=k;},null);
__d('WebMessengerDetailViewSheetControl',['DOM','ArbiterMixin','WebMessengerStateManager','MercuryBlockedParticipants','MercurySheetView','MercuryThreadInfo','WebMessengerTemplates','MercuryThreadInformer','MercuryThreadActions','MercuryThreads','WebMessengerEmployeeAwaySheet','ChatEmployeeAwayWarning','WebMessengerIsMessageBlockedSheet','WebMessengerThreadIsMutedTabSheet','WebMessengerSubscriptionsHandler','mixin'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();var j=c('MercuryBlockedParticipants').get(),k=c('MercuryThreadInformer').get(),l=c('MercuryThreadActions').get(),m=c('MercuryThreads').get();h=babelHelpers.inherits(n,c('mixin')(c('ArbiterMixin')));i=h&&h.prototype;function n(o){'use strict';i.constructor.call(this);this._template=c('WebMessengerTemplates')[':fb:web-messenger:tab-sheet-container'].build();this._rootElement=this._template.getNode('sheet');this._threadID=c('WebMessengerStateManager').getCurrentStateData().thread_id;this._sheetView=new (c('MercurySheetView'))(this._threadID,this._rootElement,o);this._threadIsMessageBlockedSheet=new (c('WebMessengerIsMessageBlockedSheet'))(this._threadID,this._rootElement,this._sheetView);this._employeeAwaySheet=new (c('WebMessengerEmployeeAwaySheet'))(this._threadID,this._rootElement,this._sheetView);this._threadIsMutedTabSheet=new (c('WebMessengerThreadIsMutedTabSheet'))(this._rootElement,this._sheetView);this._muteSetting=undefined;c('DOM').setContent(o,this._template.getRoot());this._threadMessageBlockedSub=this._threadIsMessageBlockedSheet.subscribe('clicked',function(){l.unblockMessages(this._threadID);}.bind(this));this._threadIsMutedClickSub=this._threadIsMutedTabSheet.subscribe('clicked',function(){l.unmute(this._threadID);}.bind(this));c('WebMessengerSubscriptionsHandler').addSubscriptions(this._sheetView.subscribe('resize',this.inform.bind(this,'resize')),k.subscribe('threads-updated',function(p,q){if(this._threadID&&q[this._threadID])this.updateTabSheet(false);}.bind(this)));this.updateTabSheet(true);}n.prototype.updateView=function(){'use strict';var o=c('WebMessengerStateManager').getCurrentStateData().thread_id;if(this._threadID!=o){this._threadID=o;this.updateTabSheet(true);}};n.prototype.updateTabSheet=function(o){'use strict';if(!this._threadID)return;m.getThreadMeta(this._threadID,function(p){var q=c('MercuryThreadInfo').getMuteSetting(p);if(q!=this._muteSetting||o){if(q){this._threadIsMutedTabSheet.open();}else this._threadIsMutedTabSheet.close();this._muteSetting=q;}if(j.isMessageBlocked(p)){this._threadIsMessageBlockedSheet.open();}else this._threadIsMessageBlockedSheet.close();c('ChatEmployeeAwayWarning').updateEmployeeAwayWarning(p,function(){this._employeeAwaySheet.open();}.bind(this),function(){this._employeeAwaySheet.close();}.bind(this));}.bind(this));};n.prototype.destroy=function(){'use strict';this._threadIsMutedClickSub&&this._threadIsMutedClickSub.unsubscribe();this._employeeAwaySheet&&this._employeeAwaySheet.close();};f.exports=n;},null);
__d('WebMessengerFlexibleArea',['cx','ArbiterMixin','CSS','DOM','Event','Style','Vector','mixin','throttle'],function a(b,c,d,e,f,g,h){var i,j;if(c.__markCompiled)c.__markCompiled();var k=[];function l(){k.forEach(function(n){n.draw();});}c('Event').listen(window,'resize',c('throttle')(l,50));i=babelHelpers.inherits(m,c('mixin')(c('ArbiterMixin')));j=i&&i.prototype;function m(n){'use strict';j.constructor.call(this);this.minFlexAreaHeight=0;this.flexArea=n;this.container=null;this.padding=0;this.sizeToFit=false;k.push(this);}m.prototype.setContainer=function(n){'use strict';this.container=n;return this;};m.prototype.setPadding=function(n){'use strict';this.padding=n;return this;};m.prototype.setMinFlexAreaHeight=function(n){'use strict';this.minFlexAreaHeight=n;return this;};m.prototype.setSizeToFit=function(n){'use strict';this.sizeToFit=n;return this;};m.prototype.draw=function(){'use strict';if(this.flexArea){var n=this._flexHeight;this.inform('predraw',{old_height:n});var o=c('Vector').getViewportDimensions().y-this.padding;o-=c('Vector').getElementPosition(this.container||this.flexArea).y;if(this.container){Array.from(this.container.childNodes).forEach(function(p){o-=c('Vector').getElementDimensions(p).y;});o+=c('Vector').getElementDimensions(this.flexArea).y;}if(this.sizeToFit)o=Math.min(o,this._getNaturalHeight());if(o<this.minFlexAreaHeight)o=this.minFlexAreaHeight;if(isNaN(o)||o<0)o=0;if(o!==n){c('Style').set(this.flexArea,'height',o+'px');this._flexHeight=o;this.inform('height_changed',{height:o,old_height:n});}}return this;};m.prototype.destroy=function(){'use strict';var n=k.indexOf(this);n>=0&&k.splice(n,1);l();};m.prototype._getNaturalHeight=function(){'use strict';var n=this.flexArea.cloneNode(true);c('CSS').addClass(n,"_2ys");c('Style').set(n,'height','auto');c('DOM').insertAfter(this.flexArea,n);var o=c('Vector').getElementDimensions(n).y;c('DOM').remove(n);return o;};m.prototype._getFlexHeight=function(){'use strict';if(isNaN(this._flexHeight))this._flexHeight=c('Vector').getElementDimensions(this.flexArea).y;return this._flexHeight;};f.exports=m;},null);
__d('WebMessengerDetailViewControlManager',['Event','ArbiterMixin','CSS','WebMessengerDetailViewHeaderControl','DOM','WebMessengerFlexibleScrollArea','WebMessengerDetailViewActionsMenuControl','WebMessengerDetailViewAllPeopleResultsControl','WebMessengerDetailViewComposeTypeaheadControl','WebMessengerDetailViewRecentMessagesControl','WebMessengerDetailViewSearchContextControl','WebMessengerDetailViewSearchSnippetsControl','WebMessengerDetailViewBottomShelfControl','WebMessengerDetailViewSharedPhotosControl','MercuryConfig','MercuryIDs','WebMessengerMessagesSelection','Parent','WebMessengerDetailViewSheetControl','WebMessengerStateManager','WebMessengerStateConstants','Style','UserAgent_DEPRECATED','WebMessengerEvents','WebMessengerSubscriptionsHandler','WebMessengerTemplates','mixin','getElementPosition'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('mixin')(c('ArbiterMixin')));i=h&&h.prototype;function j(k){'use strict';i.constructor.call(this);this._rootElement=k;c('DOM').empty(this._rootElement);var l=c('WebMessengerTemplates')[':fb:web-messenger:read-view'].build();c('DOM').setContent(this._rootElement,l.getRoot());this._readContainer=l.getNode('readContainer');this._headerControl=new (c('WebMessengerDetailViewHeaderControl'))(l.getNode('detailViewHeader'));this._actionsMenuControl=new (c('WebMessengerDetailViewActionsMenuControl'))(l.getNode('detailViewActionsMenu'),this._headerControl);this._allPeopleResultsControl=new (c('WebMessengerDetailViewAllPeopleResultsControl'))(l.getNode('detailViewAllPeopleResults'));this._composeTypeaheadControl=new (c('WebMessengerDetailViewComposeTypeaheadControl'))(l.getNode('detailViewComposeTypeahead'),l.getNode('detailViewComposeTypeaheadResults'));this._searchContextControl=new (c('WebMessengerDetailViewSearchContextControl'))(this,l.getNode('detailViewSearchContext'),l.getNode('snippetPaginationControlBox'));this._searchSnippetsControl=new (c('WebMessengerDetailViewSearchSnippetsControl'))(this,l.getNode('detailViewSearchSnippets'));this._sharedPhotosControl=new (c('WebMessengerDetailViewSharedPhotosControl'))(this,l.getNode('detailViewSharedPhotos'));this._sheetControl=new (c('WebMessengerDetailViewSheetControl'))(l.getNode('detailViewSheetTab'));var m=l.getNode('detailViewBottomShelf');this._bottomShelfControl=new (c('WebMessengerDetailViewBottomShelfControl'))(this,m);this._detailViewScroller=l.getNode('readMessagesScroller');c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Event').listen(this._detailViewScroller,'click',function(o){if(c('Parent').byTag(o.getTarget(),'a')||c('DOM').getSelection())return;this._bottomShelfControl.focusComposer();}.bind(this)));var n={fade:!!c('UserAgent_DEPRECATED').osx(),persistent:true};this._flexArea=new (c('WebMessengerFlexibleScrollArea'))(this._detailViewScroller,n).setBottomAligned(false).setInfiniteScrollHandler(this.inform.bind(this,'scrolledNearTop'),true).setInfiniteScrollHandler(this.inform.bind(this,'scrolledNearBottom')).setContainer(this._rootElement).setMinFlexAreaHeight(200).draw();c('WebMessengerSubscriptionsHandler').addSubscriptions(c('WebMessengerEvents').subscribe(c('WebMessengerEvents').DETAIL_DOM_CHANGED,this._flexArea.draw.bind(this._flexArea)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').SUBMIT_REPLY,this._bottomShelfControl.submitReply.bind(this._bottomShelfControl)),c('WebMessengerStateManager').subscribe(c('WebMessengerStateConstants').STATE_CHANGE_EVENT,this.updateOnStateChange.bind(this)));c('WebMessengerSubscriptionsHandler').addSubscriptions(this._sheetControl.subscribe('resize',this._flexArea.draw.bind(this._flexArea)));this._recentMessagesControl=new (c('WebMessengerDetailViewRecentMessagesControl'))(this,l.getNode('detailViewRecentMessages'),l.getNode('loadingSpinner'),l.getNode('noSelectedConversation'),l.getNode('newMessageLink'),l.getNode('showUnreadLink'),l.getNode('contextBanner'),m);this._stateData={};this._resizeNodes=[this._rootElement,this._detailViewScroller,c('DOM').find(this._detailViewScroller,'div.uiScrollableAreaBody')];}j.prototype.updateOnStateChange=function(){'use strict';var k=c('WebMessengerStateManager').getCurrentDetailState(),l=this._stateData;this._stateData=c('WebMessengerStateManager').getCurrentStateData();this._flexArea.setTabbable(k!==c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN);this._allPeopleResultsControl.hideView();this._composeTypeaheadControl.hideView();this._recentMessagesControl.hideView();this._searchContextControl.hideView();this._searchSnippetsControl.hideView();this._sharedPhotosControl.hideView();c('CSS').removeClass(this._readContainer,'blankComposeState');c('CSS').conditionClass(this._readContainer,'blankComposeState',k===c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN);this._bottomShelfControl.updateView();this._actionsMenuControl.updateView();this._headerControl.updateView();switch(k){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:this._recentMessagesControl.updateView();this._sheetControl.updateView();break;case c('WebMessengerStateConstants').DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:this._allPeopleResultsControl.updateView();this._composeTypeaheadControl.updateView();break;case c('WebMessengerStateConstants').DETAIL.COMPOSE_MAIN:this._composeTypeaheadControl.updateView();break;case c('WebMessengerStateConstants').DETAIL.COMPOSE_TYPEAHEAD_RESULTS:this._composeTypeaheadControl.updateView();break;case c('WebMessengerStateConstants').DETAIL.SHARED_PHOTOS:this._sharedPhotosControl.updateView();break;case c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET:case c('WebMessengerStateConstants').DETAIL.SEARCH_THREAD_SNIPPET:this._searchSnippetsControl.updateView();break;case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:this._searchContextControl.updateView();break;}switch(k){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:if(l.thread_id!=this._stateData.thread_id)this._bottomShelfControl.focusComposer();break;}};j.prototype.hideAll=function(){'use strict';this._headerControl.hideView();this._actionsMenuControl.hideView();this._allPeopleResultsControl.hideView();this._composeTypeaheadControl.hideView();this._recentMessagesControl.hideView();this._searchContextControl.hideView();this._searchSnippetsControl.hideView();this._sharedPhotosControl.hideView();this._bottomShelfControl.hideView();};j.prototype.getSelectedMessageIDs=function(){'use strict';var k=c('WebMessengerStateManager').getCurrentDetailState();switch(k){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:return c('WebMessengerMessagesSelection').getSelectedMessageIDs();}return [];};j.prototype.scrollIntoView=function(k){'use strict';this._flexArea&&this._flexArea.scrollIntoView(k);};j.prototype.setScrollTop=function(k,l){'use strict';this._flexArea&&this._flexArea.setScrollTop(k,l);};j.prototype.isScrolledToBottom=function(){'use strict';return this._flexArea&&this._flexArea.isScrolledToBottom();};j.prototype.scrollToBottom=function(k){'use strict';this._flexArea&&this._flexArea.scrollToBottom(k);};j.prototype.draw=function(){'use strict';this._flexArea&&this._flexArea.draw();};j.prototype.poke=function(){'use strict';this._flexArea&&this._flexArea.poke();};j.prototype.addScrollCallback=function(k){'use strict';this._flexArea&&this._flexArea.addScrollCallback(k);};j.prototype.getFlexAreaBoundingClientRect=function(){'use strict';return c('getElementPosition')(this._flexArea.flexArea);};j.prototype.resizeTo=function(k){'use strict';if(k!==null){k=k.toString();if(!k.endsWith('%')||k.endsWith('px'))k=k+'px';}this._resizeNodes.forEach(function(l){c('Style').set(l,'width',k);});c('WebMessengerEvents').detailDOMChanged();};j.prototype.destroy=function(){'use strict';this._headerControl.destroy();this._actionsMenuControl.destroy();this._allPeopleResultsControl.destroy();this._composeTypeaheadControl.destroy();this._recentMessagesControl.destroy();this._searchContextControl.destroy();this._searchSnippetsControl.destroy();this._bottomShelfControl.destroy();this._sharedPhotosControl.destroy();this._flexArea.destroy();this._sheetControl.destroy();};f.exports=j;},null);
__d('MercuryLogger',['JSLogger','MercuryThreadIDMap','MercuryThreads'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryThreadIDMap').get(),i=c('MercuryThreads').get(),j=c('JSLogger').create('messaging_impressions');function k(event,o){j.log(event,o);}function l(o,p){var q=i.getThreadMetaNow(o);if(q){var r=h.getServerIDFromClientIDNow(o);if(r){var event=p?'thread_search':'thread',s={is_single_thread:q.is_canonical_user,is_subscribed:q.is_subscribed,query:p||null};s.thread_fbid=r;k(event,s);}j.bump('opened_thread_'+q.folder);}}function m(o,p){var q={};p.forEach(function(r){var s=h.getServerIDFromClientIDNow(r),t=i.getThreadMetaNow(r);if(t&&s){var u={is_single_thread:t.is_canonical_user,folder:t.folder,participants:t.participants,other_user_fbid:t.other_user_fbid};u.thread_fbid=s;q[s]=u;}});k('threadlist',{folder:o,threads:q});j.bump('opened_threadlist_'+o);}var n={logThread:function(o){l(o);},logThreadlist:function(o,p){m(o,p);},logThreadFromSearch:function(o,p){l(p,o);},logThreadlistFromSearch:function(o,p){k('threadlist_search',{folder:p,query:o});}};f.exports=n;},null);
__d('WebMessengerMercury',['MercuryMessages','MercuryOrderedThreadlist','MercuryServerRequests','WebMessengerStateManager','MercuryThreadInformer','MercuryThreadActions','MercuryThreads','MercuryUnreadState','MercuryUnseenState'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={getMessages:function(){return c('MercuryMessages').getForFBID(i());},getOrderedThreadlist:function(){return c('MercuryOrderedThreadlist').getForFBID(i());},getServerRequests:function(){return c('MercuryServerRequests').getForFBID(i());},getThreadInformer:function(){return c('MercuryThreadInformer').getForFBID(i());},getThreadActions:function(){return c('MercuryThreadActions').getForFBID(i());},getThreads:function(){return c('MercuryThreads').getForFBID(i());},getUnreadState:function(){return c('MercuryUnreadState').getForFBID(i());},getUnseenState:function(){return c('MercuryUnseenState').getForFBID(i());}};function i(){return c('WebMessengerStateManager').getCurrentUserID();}f.exports=h;},null);
__d('WebMessengerMasterViewUnseenMessagesNotice',['MercuryThreadlistConstants','MessagingTag','WebMessengerStateManager','UserActivity','WebMessengerSubscriptionsHandler','WebMessengerMessagesNotice','WebMessengerConstants','WebMessengerMercury','throttle'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();var j=c('WebMessengerConstants').THREADLIST_SCROLLTOP_OFFSET,k=c('MercuryThreadlistConstants').MESSAGE_NOTICE_INACTIVITY_THRESHOLD;h=babelHelpers.inherits(l,c('WebMessengerMessagesNotice'));i=h&&h.prototype;function l(q){'use strict';i.constructor.call(this);this._manager=q;this._threadInformer=c('WebMessengerMercury').getThreadInformer();this._unseenState=c('WebMessengerMercury').getUnseenState();c('WebMessengerSubscriptionsHandler').addSubscriptions(this._threadInformer.subscribe('messages-received',function(r,s){var t=!c('UserActivity').isActive(k),u=!this.isScrolledWithinTopThreshold();if(!i.getActive.call(this)||o(s)||!n(s))return;if(i.onlyReceivedFromSelf.call(this,s))return;if(t){this.removeMessageNotice();this._manager.scrollToTop();}else if(u)this.showMessageNotice();}.bind(this)),this._threadInformer.subscribe('unseen-updated',m.bind(null,this)));this._manager.addScrollCallback(c('throttle').withBlocking(function(r){if(i.getActive.call(this)&&r.getScrollTop()<=c('WebMessengerConstants').THREADLIST_TOP_OFFSET&&c('UserActivity').isActive(k)&&p()){this.removeMessageNotice();this._unseenState.markAsSeen();}}.bind(this),100,null));}l.prototype.isScrolledWithinTopThreshold=function(){'use strict';return this._manager.getScrollTop()<=j;};l.prototype.showMessageNotice=function(){'use strict';if(!p())return;var q=function(){this._manager.scrollToTop();}.bind(this);i.showMessageNotice.call(this,q,'below');};function m(q){if(q._unseenState.getUnseenCount()===0)q.removeMessageNotice();}function n(q){for(var r in q)for(var s=0;s<q[r].length;s++)if(q[r][s].folder==c('MessagingTag').INBOX)return true;return false;}function o(q){var r=c('WebMessengerStateManager').getCurrentStateData().thread_id,s=true;for(var t in q)if(q.hasOwnProperty(t))if(t!==r){s=false;break;}return p()&&s;}function p(){var q=c('WebMessengerStateManager').getCurrentStateData().folder;return q===c('MessagingTag').INBOX;}f.exports=l;},null);
__d('WebMessengerThreadlistRenderer',['csx','cx','fbt','CSS','WebMessengerDeleteThreadDialog','DOM','Event','Focus','MercuryListUpdateRenderer','MercuryAPIArgsSource','MessagingTag','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','MercuryThreadMetadataRawRenderer','MercuryThreadMetadataRenderer','Tooltip','WebMessengerMercury','WebMessengerPermalinks'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k={renderThreadsFromIDs:function(m,n,o,p,q,r){p=p||function(s){return s;};q=q||{};c('MercuryListUpdateRenderer').updateList(m,n.map(p),function(s){return !q[n[s]]&&n[s]!=o;},function(s){var t=n[s],u=c('WebMessengerTemplates')[':fb:web-messenger:threadlist-row'].build();u.getRoot().setAttribute('id',p(t));var v=u.getNode('threadLink');c('Focus').listen(v,function(w){c('CSS').conditionClass(u.getRoot(),"_5fes",w);});c('Event').listen(v,'click',function(w){if(w.getModifiers().any)return true;var x=c('WebMessengerStateManager').getCurrentMasterState(),y={thread_id:t};if(x===c('WebMessengerStateConstants').MASTER.SEARCH)y.query=c('WebMessengerStateManager').getCurrentStateData().query;c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,y);return false;});if(t==o)c('CSS').addClass(u.getRoot(),"_kv");c('WebMessengerMercury').getThreads().getThreadMeta(t,function(w){var x=c('MercuryThreadMetadataRenderer').getForFBID(c('WebMessengerStateManager').getCurrentUserID());x.renderCoreThreadlist(w,u,l.bind(null,r),{names_renderer:c('MercuryThreadMetadataRawRenderer').renderShortNames,show_unread_count:false},true);},c('MercuryAPIArgsSource').WEBMESSENGER);return u.getRoot();});}};function l(m,n,o){var p=n.getNode('readToggler'),q=n.getNode('archiveButton'),r=n.getNode('deleteButton');n.getNode('threadLink').setAttribute('href',c('WebMessengerPermalinks').getURI(m,c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{thread_id:o.thread_id}).toString());if(o.unread_count>0){c('CSS').addClass(n.getRoot(),"_kx");c('DOM').setContent(n.getNode('newCount'),j._("{num} new",[j.param('num',o.unread_count)]));c('CSS').addClass(p,"_ky");c('Tooltip').set(p,j._("Mark as Read"),'above','right');}else{c('CSS').addClass(p,"_kz");c('Tooltip').set(p,j._("Mark as Unread"),'above','right');}c('Event').listen(p,'click',function(event){var u=c('WebMessengerMercury').getThreadActions();c('CSS').matchesSelector(p,"._ky")?u.markRead(o.thread_id):u.markUnread(o.thread_id);return false;});var s=c('WebMessengerStateManager').getCurrentStateData().folder;if(s==c('MessagingTag').SPAM){c('Tooltip').set(r,j._("Delete Conversation"),'above','right');c('CSS').addClass(r,"_4_3q");c('Event').listen(r,'click',function(event){c('WebMessengerDeleteThreadDialog').show(o.thread_id);});c('CSS').hide(q);}else{c('CSS').hide(r);var t=true;if(s==c('MessagingTag').ACTION_ARCHIVED){t=false;c('Tooltip').set(q,j._("Unarchive"),'above','right');c('CSS').addClass(q,"_2s2");}else{c('Tooltip').set(q,j._("Archive"),'above','right');c('CSS').addClass(q,"_l9");}c('Event').listen(q,'click',function(event){var u=c('WebMessengerMercury').getThreadActions();t?u.archive(o.thread_id):u.unarchive(o.thread_id);var v=c('WebMessengerStateManager').getCurrentStateData();if(v.thread_id==o.thread_id)c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{folder:v.folder});return false;});}}f.exports=k;},null);
__d('WebMessengerMasterViewRecentThreadsControl',['cx','fbt','UserActivity','CSS','DOM','Event','MercuryLogger','MercuryAPIArgsSource','MercuryFilters','MercuryFolders','MercuryThreadlistConstants','MessagingTag','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerThreadlistRenderer','WebMessengerConstants','WebMessengerEvents','WebMessengerInfoBoxRenderer','WebMessengerSubscriptionsHandler','WebMessengerMasterViewUnseenMessagesNotice','WebMessengerMercury','createObjectFrom','ge'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();c('UserActivity');var j='recent:';function k(ca,da,ea,fa){'use strict';this._manager=ca;this._rootElement=da;this._infoBox=ea;this._orderedThreadlist=c('WebMessengerMercury').getOrderedThreadlist();this._serverRequests=c('WebMessengerMercury').getServerRequests();this._threadInformer=c('WebMessengerMercury').getThreadInformer();this._threads=c('WebMessengerMercury').getThreads();this._unseenState=c('WebMessengerMercury').getUnseenState();c('DOM').empty(this._rootElement);this._pagerExponent=-1;var ga=c('WebMessengerTemplates')[':fb:web-messenger:threadlist'].build();c('DOM').setContent(this._rootElement,ga.getRoot());this._loadingSpinner=ga.getNode('loadingSpinner');this._threadlistRows=ga.getNode('threadlistRows');this._loadMoreButton=ga.getNode('loadMoreButton');this._loadMoreLink=ga.getNode('loadMoreLink');this._active=false;this._state=null;this._folder=null;this._filter=null;this._selection=null;this._threadIDs=[];this._unreadThreadIDs=[];this._folders=c('MercuryFolders').getSupportedFolders();this._filters=c('MercuryFilters').getSupportedFilters();this._olderTimestamp={};this._currentCountMap={};this._folders.forEach(function(ha){this._currentCountMap[ha]={};this._filters.concat([c('MercuryFilters').ALL]).forEach(function(ia){this._currentCountMap[ha][ia]=c('MercuryThreadlistConstants').WEBMESSENGER_THREAD_COUNT+1;}.bind(this));}.bind(this));this._unseenMessagesNotice=new (c('WebMessengerMasterViewUnseenMessagesNotice'))(this._manager);this._unseenMessagesNotice.setNoticeContextNode(fa);c('WebMessengerSubscriptionsHandler').addSubscriptions(this._threadInformer.subscribe('threadlist-updated',function(ha,ia){x(this,c('createObjectFrom')(ia));}.bind(this)),c('Event').listen(this._loadMoreLink,'click',function(){w(this);}.bind(this)),this._manager.subscribe('scrolledNearBottom',function(){this._active&&w(this);}.bind(this)));}k.prototype.updateView=function(){'use strict';this._active=true;this._unseenMessagesNotice.updateView();c('CSS').show(this._rootElement);var ca=m(this),da=n(this),ea=this._folder,fa=this._selection;o(this);if(da)p(this,fa);if(ca){v(this);}else q(this);if(ea!=this._folder)c('MercuryLogger').logThreadlist(this._folder,this._threadIDs);if(this._selection&&fa!=this._selection)c('MercuryLogger').logThread(this._selection);};k.prototype.hideView=function(){'use strict';this._active=false;this._unseenMessagesNotice.hideView();c('CSS').hide(this._rootElement);};k.prototype.destroy=function(){'use strict';l(this);this._unseenMessagesNotice.destroy();};function l(ca){ca._threadlistSubscription&&ca._orderedThreadlist.unsubscribe(ca._threadlistSubscription.subscriber_id,ca._threadlistSubscription.folder,ca._threadlistSubscription.filter);ca._threadlistSubscription=null;}function m(ca){var da=c('WebMessengerStateManager').getCurrentStateData();if(ca._folder!=da.folder||ca._filter!=da.filter)return true;return false;}function n(ca){var da=c('WebMessengerStateManager').getCurrentStateData();if(ca._selection!=da.thread_id)return true;return false;}function o(ca){var da=c('WebMessengerStateManager').getCurrentStateData();ca._state=c('WebMessengerStateManager').getCurrentMasterState();if(ca._folder!=da.folder||ca._filter!=da.filter)ca._pageExponent=-1;ca._folder=da.folder;ca._filter=da.filter;ca._selection=da.thread_id;}function p(ca,da){var ea=c('ge')(ba(da));if(ea){c('CSS').removeClass(ea,"_kv");ea.removeAttribute('aria-selected');}var fa=c('ge')(ba(ca._selection));if(fa){c('CSS').addClass(fa,"_kv");fa.setAttribute('aria-selected','true');}c('WebMessengerEvents').updateSelection(fa&&fa.id);}function q(ca){if(ca._active)c('WebMessengerShortcuts').updateThreadlistIndex(ca,ca._threadIDs.map(ba),ba(ca._selection));}function r(ca){c('CSS').addClass(ca._manager.getFlexAreaElement(),"_3j6");c('CSS').addClass(ca._manager.getFlexAreaElement(),"_3j7");}function s(ca){c('CSS').removeClass(ca._manager.getFlexAreaElement(),"_3j6");c('CSS').removeClass(ca._manager.getFlexAreaElement(),"_3j7");}function t(ca){c('CSS').hide(ca._threadlistRows);s(ca);}function u(ca){if(ca._threadIDs.length){c('CSS').show(ca._threadlistRows);s(ca);}else{c('CSS').hide(ca._threadlistRows);r(ca);}}function v(ca){c('CSS').show(ca._loadingSpinner);c('CSS').hide(ca._infoBox);t(ca);c('CSS').hide(ca._loadMoreButton);l(ca);var da=ca._orderedThreadlist.getFilteredThreadlist(c('MercuryThreadlistConstants').RECENT_THREAD_OFFSET,ca._currentCountMap[ca._folder][ca._filter],ca._folder,ca._filter,function(ea,fa){c('CSS').hide(ca._loadingSpinner);y(ca,ea,fa);u(ca);q(ca);ca._manager.poke();ca._manager.forceFireScrollCallbacks();},null,c('MercuryAPIArgsSource').WEBMESSENGER);if(da)ca._threadlistSubscription={subscriber_id:da,folder:ca._folder,filter:ca._filter};}function w(ca){if(ca._requestInFlight||c('CSS').hasClass(ca._loadMoreButton,'hidden_elem'))return;ca._requestInFlight=true;c('CSS').addClass(ca._loadMoreButton,'async_saving');ca._pagerExponent=Math.min(ca._pagerExponent+1,c('WebMessengerConstants').EXPONENTIAL_PAGER_MAX_CYCLES);var da=Math.pow(2,ca._pagerExponent),ea=ca._currentCountMap[ca._folder][ca._filter]+da*c('MercuryThreadlistConstants').WEBMESSENGER_MORE_COUNT;l(ca);var fa=ca._orderedThreadlist.getFilteredThreadlist(c('MercuryThreadlistConstants').RECENT_THREAD_OFFSET,ea,ca._folder,ca._filter,function(ga,ha){c('CSS').removeClass(ca._loadMoreButton,'async_saving');ca._currentCountMap[ca._folder][ca._filter]=ea;y(ca,ga,ha);q(ca);ca._manager.poke();ca._requestInFlight=false;},null,c('MercuryAPIArgsSource').WEBMESSENGER);if(fa)ca._threadlistSubscription={subscriber_id:fa,folder:ca._folder,filter:ca._filter};}function x(ca,da){if(!ca._folder||!ca._olderTimestamp[ca._folder])return;var ea=ca._orderedThreadlist.getThreadlistUntilTimestamp(ca._olderTimestamp[ca._folder],ca._folder,ca._filter);if(ca._filter==c('MessagingTag').UNREAD){ea=aa(ca,ea);}else ca._unreadThreadIDs=[];if(ea.length>ca._currentCountMap[ca._folder][ca._filter])ca._currentCountMap[ca._folder][ca._filter]=ea.length;ca._threadIDs=ea;u(ca);c('WebMessengerThreadlistRenderer').renderThreadsFromIDs(ca._threadlistRows,ea,ca._selection,ba,da,c('WebMessengerStateConstants').MASTER.RECENT_THREADS);q(ca);ca._manager.poke();}function y(ca,da,ea){var fa=da.length==ca._currentCountMap[ca._folder][ca._filter];if(fa)da.pop();if(da.length){var ga=da[da.length-1];ca._threads.getThreadMeta(ga,function(ha){ca._olderTimestamp[ca._folder]=ha.timestamp;},c('MercuryAPIArgsSource').WEBMESSENGER);}if(ca._filter==c('MessagingTag').UNREAD){ca._unreadThreadIDs=da;}else ca.unreadThreadIDs=[];c('CSS').conditionShow(ca._loadMoreButton,fa);ca._threadIDs=da;c('WebMessengerThreadlistRenderer').renderThreadsFromIDs(ca._threadlistRows,da,ca._selection,ba,null,c('WebMessengerStateConstants').MASTER.RECENT_THREADS);ea=ea&&da.length===0;ea&&z(ca);c('CSS').conditionShow(ca._infoBox,ea);}function z(ca){if(ca._builtErrorMessage)return;c('DOM').setContent(ca._infoBox,c('WebMessengerInfoBoxRenderer').render(i._("Could Not Load Conversations"),[{text:i._("Try Again"),handler:v.bind(null,ca)}]));ca._builtErrorMessage=true;}function aa(ca,da){da.forEach(function(ea){if(ca._unreadThreadIDs.indexOf(ea)<0)ca._unreadThreadIDs.push(ea);});ca._unreadThreadIDs.sort(function(ea,fa){var ga=ca._threads.getThreadMetaNow(ea).timestamp,ha=ca._threads.getThreadMetaNow(fa).timestamp;return ha-ga;});ca._unreadThreadIDs=ca._unreadThreadIDs.filter(function(ea){var fa=ca._threads.getThreadMetaNow(ea);return c('MercuryFolders').getFromMeta(fa)==ca._folder;});return ca._unreadThreadIDs;}function ba(ca){if(ca)return j+ca;return null;}f.exports=k;},null);
__d('MercuryThreadSearchUtils',['escapeRegex','TokenizeUtil'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={wordsInString:function(i){return (i||'').split(/\s+/).filter(function(j){return j.trim().length>0;});},anyMatchPredicate:function(i,j){for(var k=0;k<i.length;k++)if(j(i[k]))return true;return false;},allMatchPredicate:function(i,j){for(var k=0;k<i.length;k++)if(!j(i[k]))return false;return true;},queryWordMatchesAnyNameWord:function(i,j){var k=new RegExp('^'+c('escapeRegex')(i),'i');return this.anyMatchPredicate(j,function(l){var m=c('TokenizeUtil').parse(l).flatValue;return k.test(m);});},queryMatchesName:function(i,j){var k=this.wordsInString(i),l=this.wordsInString(j);return this.allMatchPredicate(k,function(m){return this.queryWordMatchesAnyNameWord(m,l);}.bind(this));}};f.exports=h;},null);
__d('MercuryLocalThreadResults',['MercuryFolders','MercuryIDs','MercurySingletonMixin','MercuryOrderedThreadlist','MercuryParticipants','MercuryThreadSearchUtils','MercuryThreads'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this.$MercuryLocalThreadResults1=i;this.$MercuryLocalThreadResults2=c('MercuryOrderedThreadlist').getForFBID(this.$MercuryLocalThreadResults1);this.$MercuryLocalThreadResults3=c('MercuryThreads').getForFBID(this.$MercuryLocalThreadResults1);}h.prototype.findMatchingThreadsFromIds=function(i,j){'use strict';return j.filter(function(k){var l=this.$MercuryLocalThreadResults3.getThreadMetaNow(k);return this.$MercuryLocalThreadResults4(l,i);}.bind(this));};h.prototype.findMatchingThreads=function(i){'use strict';var j=[];c('MercuryFolders').getSupportedFolders().forEach(function(k){j=j.concat(this.$MercuryLocalThreadResults2.getThreadlistUntilTimestamp(0,k));}.bind(this));return this.findMatchingThreadsFromIds(i,j);};h.prototype.$MercuryLocalThreadResults4=function(i,j){'use strict';var k=this.$MercuryLocalThreadResults5(i.participants),l=c('MercuryThreadSearchUtils').wordsInString(j),m=null;c('MercuryParticipants').getMulti(k,function(n){m=k.map(function(o){return n[o];});});if(!m)return false;return c('MercuryThreadSearchUtils').allMatchPredicate(l,function(n){var o=c('MercuryThreadSearchUtils').anyMatchPredicate(m,function(q){return q&&q.name&&c('MercuryThreadSearchUtils').queryWordMatchesAnyNameWord(n,c('MercuryThreadSearchUtils').wordsInString(q.name));}),p=i.name&&c('MercuryThreadSearchUtils').queryWordMatchesAnyNameWord(n,c('MercuryThreadSearchUtils').wordsInString(i.name));return o||p;});};h.prototype.$MercuryLocalThreadResults5=function(i){'use strict';if(i.length===1&&c('MercuryIDs').tokenize(i[0]).value===this.$MercuryLocalThreadResults1)return i;return i.filter(function(j){var k=c('MercuryIDs').tokenize(j).value;return k!==this.$MercuryLocalThreadResults1;}.bind(this));};Object.assign(h,c('MercurySingletonMixin'));f.exports=h;},null);
__d('MercurySearchThreadResults',['KeyedCallbackManager','MercuryAPIArgsSource','MercurySingletonMixin','MercuryThreadlistConstants','MercuryThreadIDMap','RangedCallbackManager','MercuryServerDispatcher','MercuryServerPayloadPreprocessor'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=new (c('KeyedCallbackManager'))(),i=c('MercuryThreadlistConstants').WEBMESSENGER_THREAD_COUNT,j=c('MercuryThreadlistConstants').WEBMESSENGER_MORE_COUNT;function k(l){'use strict';this.$MercurySearchThreadResults1=l;this.$MercurySearchThreadResults2=c('MercuryServerPayloadPreprocessor').getForFBID(this.$MercurySearchThreadResults1);this.$MercurySearchThreadResults3=c('MercuryThreadIDMap').getForFBID(this.$MercurySearchThreadResults1);c('MercuryServerDispatcher').registerEndpoints({'/ajax/mercury/search_threads.php':{request_user_id:l,mode:c('MercuryServerDispatcher').IMMEDIATE,handler:function(m){this.handleUpdate(m);}.bind(this)}});}k.prototype.getThreadlist=function(l,m){'use strict';if(l){var n=h.executeOrEnqueue(l,function(q){var r=q.getAllResources(),s=q.hasReachedEndOfArray();m(r,s);}),o=h.getUnavailableResources(n),p=c('MercuryAPIArgsSource').WEBMESSENGER;if(o.length)this.$MercurySearchThreadResults4({client:p,query:l,offset:0,limit:i+1});return n;}};k.prototype.isExhausted=function(l){'use strict';var m=h.getResource(l);return m?m.hasReachedEndOfArray():false;};k.prototype.getCachedThreadlist=function(l){'use strict';var m=h.getResource(l);return m?m.getAllResources():null;};k.prototype.cacheThreadlist=function(l,m){'use strict';h.getResource(l);var n=new (c('RangedCallbackManager'))();n.addResourcesWithoutSorting(m,0);n.setReachedEndOfArray();h.setResource(l,n);};k.prototype.getMoreThreadlist=function(l,m){'use strict';if(l){var n=h.getResource(l);if(n){var o=n.getCurrentArraySize(),p=j,q=n.executeOrEnqueue(0,o+p,function(){var s=n.getAllResources(),t=n.hasReachedEndOfArray();m(s,t);}),r=n.getUnavailableResources(q);if(r.length)this.$MercurySearchThreadResults4({query:l,offset:o,limit:p+1});return q;}}};k.prototype.handleUpdate=function(l){'use strict';if(l.mercury_payload)this.$MercurySearchThreadResults2.handleUpdate(l.mercury_payload);var m=l.search_threads||{};for(var n in m){var o=m[n]||[],p=o.map(function(r){return this.$MercurySearchThreadResults3.getClientIDFromServerIDNow(r);}.bind(this)),q=h.getResource(n);if(q){this.$MercurySearchThreadResults5(q,p,j+1);}else{q=new (c('RangedCallbackManager'))();this.$MercurySearchThreadResults5(q,p,i+1);h.setResource(n,q);}}};k.prototype.unsubscribe=function(l,m){'use strict';if(m){var n=h.getResource(m);if(n){n.unsubscribe(l);}else h.unsubscribe(l);}};k.prototype.setInitialCount=function(l){'use strict';i=l;};k.prototype.$MercurySearchThreadResults5=function(l,m,n){'use strict';var o=l.getCurrentArraySize(),p=m.length<n;if(!p)m.pop();l.addResourcesWithoutSorting(m,o);if(p)l.setReachedEndOfArray();};k.prototype.$MercurySearchThreadResults4=function(l){'use strict';l.client=c('MercuryAPIArgsSource').WEBMESSENGER;l.index='fbid';c('MercuryServerDispatcher').trySend('/ajax/mercury/search_threads.php',l,null,this.$MercurySearchThreadResults1);};Object.assign(k,c('MercurySingletonMixin'));f.exports=k;},null);
__d('MercurySearchThreadsStrategy',['WebMessengerConstants','MercuryLocalThreadResults','MercurySingletonMixin','MercurySearchThreadResults','createObjectFrom'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=null,i=null,j=c('WebMessengerConstants').SEARCH_THREAD_DELAY;function k(l){'use strict';this.$MercurySearchThreadsStrategy1=l;this.$MercurySearchThreadsStrategy2=c('MercuryLocalThreadResults').getForFBID(this.$MercurySearchThreadsStrategy1);this.$MercurySearchThreadsStrategy3=c('MercurySearchThreadResults').getForFBID(this.$MercurySearchThreadsStrategy1);}k.prototype.clearTimer=function(){'use strict';h=null;clearTimeout(i);i=null;};k.prototype.search=function(l,m,n,o){'use strict';if(l!=h){h=l;clearTimeout(i);i=null;}var p=this.$MercurySearchThreadsStrategy2.findMatchingThreads(l),q=this.$MercurySearchThreadsStrategy3.getCachedThreadlist(l);if(q){var r=this.$MercurySearchThreadsStrategy4(p,q);m(r);n([],this.$MercurySearchThreadsStrategy3.isExhausted(l));o(null,l);return;}var s=this.$MercurySearchThreadsStrategy5(l),t=this.$MercurySearchThreadsStrategy4(p,s.thread_ids);if(s.from_exhausted_remote_results){this.$MercurySearchThreadsStrategy3.cacheThreadlist(l,t);m(t);n([],true);o(null,l);return;}m(t);i=setTimeout(function(){var u=this.$MercurySearchThreadsStrategy3.getThreadlist(l,n);o(u,l);}.bind(this),j);};k.prototype.$MercurySearchThreadsStrategy5=function(l){'use strict';var m='',n=[];for(var o=l.length-1;o>0;o--){var p=l.slice(0,o),q=this.$MercurySearchThreadsStrategy3.getCachedThreadlist(p);if(!q)continue;if(this.$MercurySearchThreadsStrategy3.isExhausted(p)){return {from_exhausted_remote_results:true,thread_ids:this.$MercurySearchThreadsStrategy2.findMatchingThreadsFromIds(l,q)};}else if(m.length===0){m=p;n=this.$MercurySearchThreadsStrategy2.findMatchingThreadsFromIds(l,q);}}return {from_exhausted_remote_results:false,thread_ids:n};};k.prototype.$MercurySearchThreadsStrategy4=function(l,m){'use strict';return Object.keys(babelHelpers['extends']({},c('createObjectFrom')(l),c('createObjectFrom')(m)));};Object.assign(k,c('MercurySingletonMixin'));f.exports=k;},null);
__d('WebMessengerMasterViewSearchInputControl',['cx','Event','CSS','DOM','Input','Keys','MercurySearchThreadsStrategy','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerSubscriptionsHandler','WebMessengerEvents'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercurySearchThreadsStrategy').get();function j(r,s){'use strict';this._manager=r;this._rootElement=s;c('DOM').empty(this._rootElement);var t=c('WebMessengerTemplates')[':fb:web-messenger:master-view:search-input'].build();c('DOM').replace(this._rootElement,t.getRoot());this._searchBox=t.getRoot();this._searchInput=t.getNode('searchInput');this._searchClear=t.getNode('searchClear');this._searchButton=c('DOM').find(this._searchBox,'button');this._state=null;this._query=null;this._folder=null;this._threadID=null;this._ariaOwns=this._searchInput.getAttribute('aria-owns');c('WebMessengerSubscriptionsHandler').addSubscriptions(c('WebMessengerEvents').subscribe(c('WebMessengerEvents').UPDATE_SELECTION,q.bind(null,this)),c('Event').listen(this._searchButton,'click',function(){var u=c('Input').getValue(this._searchInput);if(u)o(this,u);}.bind(this)),c('Event').listen(this._searchClear,'click',n.bind(null,this)),c('Event').listen(this._searchInput,'keyup',function(event){var u=c('Input').getValue(this._searchInput);if(event.keyCode==c('Keys').ESC){n(this);}else if(event.keyCode==c('Keys').RETURN&&u){c('WebMessengerShortcuts').openSearchThread();}else if(u){p(this,u);}else if(u!==c('WebMessengerStateManager').getCurrentStateData().query){n(this);this.focus();}return false;}.bind(this)),c('Event').listen(this._searchInput,'focus',function(u){this._focused=true;}.bind(this)),c('Event').listen(this._searchInput,'blur',function(u){this._focused=false;}.bind(this)));}j.prototype.updateView=function(){'use strict';var r=l(this);k(this);if(r)m(this);};j.prototype.focusAndSelectSearch=function(){'use strict';o(this,c('Input').getValue(this._searchInput));this._manager.scrollToTop(false);this.focus();this._searchInput.select();};j.prototype.focus=function(){'use strict';setTimeout(function(){if(!this._focused){this._searchInput.focus();this._searchInput.value=this._searchInput.value;}}.bind(this),0);};j.prototype.destroy=function(){'use strict';};function k(r){var s=c('WebMessengerStateManager').getCurrentStateData();r._state=c('WebMessengerStateManager').getCurrentMasterState();r._folder=s.folder;if(r._state!=c('WebMessengerStateConstants').MASTER.SEARCH){r._query=null;}else r._query=s.query;}function l(r){if(!r._state||!r._folder)return true;var s=c('WebMessengerStateManager').getCurrentMasterState(),t=c('WebMessengerStateManager').getCurrentStateData();if(r._folder!=t.folder)return true;if(s!=r._state)return true;if(s==c('WebMessengerStateConstants').MASTER.SEARCH&&r._query!=t.query)return true;return false;}function m(r){if(r._state==c('WebMessengerStateConstants').MASTER.SEARCH){var s=r._query||'';if(c('Input').getValue(r._searchInput)!=s)c('Input').setValue(r._searchInput,s);r.focus();}else{c('Input').reset(r._searchInput);r._searchInput.blur();}c('CSS').conditionClass(r._searchBox,"_47",!c('Input').isEmpty(r._searchInput));}function n(r){i.clearTimer();var s=c('WebMessengerStateManager').getCurrentStateData();s.no_uri=true;delete s.query;c('WebMessengerStateManager').updateMasterState(c('WebMessengerStateConstants').MASTER.RECENT_THREADS,s);}function o(r,s){var t=c('WebMessengerStateManager').getCurrentMasterState();if(t!=c('WebMessengerStateConstants').MASTER.SEARCH)r._threadID=c('WebMessengerStateManager').getCurrentStateData().thread_id;if(s)c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET,{query:s,message_query:s});}function p(r,s){var t=c('WebMessengerStateManager').getCurrentStateData();if(s!==t.query){var u=c('WebMessengerStateManager').getCurrentMasterState();if(u!=c('WebMessengerStateConstants').MASTER.SEARCH)r._threadID=t.thread_id;if(s)c('WebMessengerStateManager').updateMasterState(c('WebMessengerStateConstants').MASTER.SEARCH,{all_people_query:t.all_people_query,message_query:t.message_query,message_id:t.message_id,query:s,thread_id:t.thread_id});}}function q(r,s,t){if(c('DOM').contains(r._ariaOwns,t))r._searchInput.setAttribute('aria-activedescendant',t);}f.exports=j;},null);
__d('MercurySearchThreadResultOrderer',['MercurySingletonMixin','MessagingTag','MercuryThreads','createObjectFrom'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(l){'use strict';this.$MercurySearchThreadResultOrderer1=l;this.$MercurySearchThreadResultOrderer2=c('MercuryThreads').getForFBID(l);}h.prototype.separateCanonicalThreadsInFolder=function(l,m){'use strict';var n=[],o=[];l.forEach(function(p){var q=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(p);if(q.folder===m&&q.is_canonical){n.push(p);}else o.push(p);}.bind(this));return {canonical_in_folder:n.sort(function(p,q){return this.$MercurySearchThreadResultOrderer3(p,q);}.bind(this)),remaining:o};};h.prototype.filterThreadsInFolder=function(l,m){'use strict';var n=[];l.forEach(function(o){var p=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(o);if(p.folder===m&&p.is_archived===false){n.push(o);}else if(m===c('MessagingTag').ACTION_ARCHIVED&&p.is_archived===true)n.push(o);}.bind(this));return n;};h.prototype.orderResults=function(l,m,n,o){'use strict';var p=k(m,n),q=p.sort(this.$MercurySearchThreadResultOrderer4.bind(this,o));return k(l,q);};h.prototype.$MercurySearchThreadResultOrderer4=function(l,m,n){'use strict';var o=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(m),p=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(n),q=i(o),r=i(p);if(q!==r)return j(q,l)>j(r,l)?-1:1;if(o.is_canonical!==p.is_canonical)return o.is_canonical?-1:1;return this.$MercurySearchThreadResultOrderer3(m,n);};h.prototype.$MercurySearchThreadResultOrderer3=function(l,m){'use strict';var n=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(l),o=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(m);return n.timestamp>o.timestamp?-1:1;};function i(l){return l.is_archived?c('MessagingTag').ACTION_ARCHIVED:l.folder;}function j(l,m){if(l===m)return 5;var n={};n[c('MessagingTag').INBOX]=4;n[c('MessagingTag').ACTION_ARCHIVED]=3;n[c('MessagingTag').OTHER]=2;n[c('MessagingTag').SPAM]=1;return n[l];}function k(l,m){var n=c('createObjectFrom')(l),o=m.filter(function(p){return !(p in n);});return l.concat(o);}Object.assign(h,c('MercurySingletonMixin'));f.exports=h;},null);
__d('WebMessengerMasterViewSearchThreadsControl',['csx','cx','fbt','Event','CSS','DOM','MercuryFolders','MercuryLogger','MercurySearchThreadResultOrderer','MercurySearchThreadResults','MercurySearchThreadsStrategy','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerThreadlistRenderer','WebMessengerEvents','WebMessengerMercury','WebMessengerSubscriptionsHandler','createObjectFrom','ge','getElementText'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercurySearchThreadResultOrderer').get(),l=c('MercurySearchThreadResults').get(),m=c('MercurySearchThreadsStrategy').get(),n='search:',o='search-indicator';function p(la,ma,na,oa){'use strict';this._manager=la;this._rootElement=ma;this._noMessagesIndicator=oa;this._orderedThreadlist=c('WebMessengerMercury').getOrderedThreadlist();this._threadInformer=c('WebMessengerMercury').getThreadInformer();this._threads=c('WebMessengerMercury').getThreads();c('DOM').empty(this._rootElement);var pa=c('WebMessengerTemplates')[':fb:web-messenger:thread-search'].build();c('DOM').setContent(this._rootElement,pa.getRoot());this._loadingSpinner=pa.getNode('loadingSpinner');this._threadlistRows=pa.getNode('threadlistRows');this._loadMoreButton=pa.getNode('loadMoreButton');this._loadMoreLink=pa.getNode('loadMoreLink');var qa=c('WebMessengerTemplates')[':fb:web-messenger:master-view-snippets-link'].build();this._threadSearchResultDescription=qa.getNode('threadSearchResultDescription');this._searchMessagesIndicator=qa.getRoot();this._searchMessagesIndicator.setAttribute('id',n+o);c('DOM').replace(na,this._searchMessagesIndicator);this._snippetSearchLink=qa.getNode('snippetSearchLink');this._snippetSearchLinkText=qa.getNode('snippetSearchLinkText');this._active=false;this._detailState=null;this._query=null;this._folder=null;this._selection=null;this._keyboardSelection=null;this._threadIDs=[];this._oldestTimestamps=r(this);this._namesChangedSinceLastRedraw=false;this._remoteResultsCompleted=true;c('WebMessengerSubscriptionsHandler').addSubscriptions(this._threadInformer.subscribe('threadlist-updated',function(ra,sa){da(this,c('createObjectFrom')(sa));}.bind(this)),this._threadInformer.subscribe('messages-received',function(){this._namesChangedSinceLastRedraw=true;}.bind(this)),c('Event').listen(this._loadMoreLink,'click',function(){ca(this);}.bind(this)),c('Event').listen(this._snippetSearchLink,'click',function(){this.updateKeyboardSelection(o);ka(this);}.bind(this)));}p.prototype.updateView=function(){'use strict';this._active=true;c('CSS').show(this._rootElement);c('CSS').hide(this._loadingSpinner);var la=s(this),ma=t(this),na=this._folder,oa=this._query,pa=this._selection;u(this);if(ma||la){var qa=this._keyboardSelection;switch(this._detailState){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:this._keyboardSelection=this._selection;break;case c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET:case c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT:this._keyboardSelection=o;}v(this,qa);}if(la){aa(this);}else{w(this,false);ba(this);}if(oa!=this._query||na!=this._folder)c('MercuryLogger').logThreadlistFromSearch(this._query,this._folder);if(this._selection&&pa!=this._selection)c('MercuryLogger').logThreadFromSearch(this._query,this._selection);};p.prototype.hideView=function(){'use strict';this._active=false;c('CSS').hide(this._rootElement);ea(this,false);ba(this);};p.prototype.openSearchThread=function(la){'use strict';if(la==o){ka(this);}else c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{query:this._query,thread_id:la});};p.prototype.updateKeyboardSelection=function(la){'use strict';var ma=this._keyboardSelection;this._keyboardSelection=la;v(this,ma);};p.prototype.destroy=function(){'use strict';q(this);};function q(la){la._searchThreadsSubscription&&l.unsubscribe(la._searchThreadsSubscription.subscriber_id,la._searchThreadsSubscription.query);la._searchThreadsSubscription=null;}function r(la){var ma={};c('MercuryFolders').getSupportedFolders().forEach(function(na){var oa=la._orderedThreadlist.getThreadlistUntilTimestamp(0,na);ma[na]=oa.length>0?la._threads.getThreadMetaNow(oa[oa.length-1]).timestamp:Infinity;}.bind(this));return ma;}function s(la){var ma=la._namesChangedSinceLastRedraw;la._namesChangedSinceLastRedraw=false;if(ma)return true;if(!la._remoteResultsCompleted)return true;var na=r(la),oa=la._oldestTimestamps;la._oldestTimestamps=na;var pa=c('WebMessengerStateManager').getCurrentStateData();if(la._query!==pa.query||la._folder!==pa.folder)return true;for(var qa in oa)if(oa[qa]>na[qa])return true;return false;}function t(la){var ma=c('WebMessengerStateManager').getCurrentStateData();if(la._selection!=ma.thread_id)return true;return false;}function u(la){var ma=c('WebMessengerStateManager').getCurrentStateData();la._detailState=c('WebMessengerStateManager').getCurrentDetailState();la._query=ma.query;la._folder=ma.folder;la._selection=ma.thread_id;}function v(la,ma){var na=c('ge')(ia(ma));if(na){c('CSS').removeClass(na,"_kv");na.removeAttribute('aria-selected');}var oa=c('ge')(ia(la._keyboardSelection));if(oa){c('CSS').addClass(oa,"_kv");oa.setAttribute('aria-selected',true);}c('WebMessengerEvents').updateSelection(oa&&oa.id);}function w(la,ma){if(la._keyboardSelection&&la._keyboardSelection!=o&&la._threadIDs.indexOf(la._keyboardSelection)<0)la._keyboardSelection=null;if(!la._keyboardSelection)if(la._threadIDs.length){la._keyboardSelection=la._threadIDs[0];}else if(!ma){la._keyboardSelection=o;v(la);}var na=la._threadIDs.slice(0);na.push(o);if(la._active)c('WebMessengerShortcuts').updateThreadlistIndex(la,na.map(ia),ia(la._keyboardSelection));}function x(la){var ma=c('DOM').scry(la._threadlistRows,"._l5");ma.filter(function(na){return c('getElementText')(na)!==c('WebMessengerStateManager').getCurrentStateData().folder;}).forEach(c('CSS').show.bind(c('CSS')));}function y(la){var ma=c('DOM').scry(la._threadlistRows,"._l5");ma.forEach(c('CSS').hide.bind(c('CSS')));}function z(la){x(la);la._manager.draw();}function aa(la){c('CSS').show(la._loadingSpinner);ea(la,false);c('CSS').hide(la._threadlistRows);c('CSS').hide(la._loadMoreButton);y(la);q(la);if(la._query){var ma=[],na=[];la._remoteResultsCompleted=false;m.search(la._query,function(oa){var pa=k.separateCanonicalThreadsInFolder(oa,c('WebMessengerStateManager').getCurrentStateData().folder);ma=pa.canonical_in_folder;na=pa.remaining;ja(la);c('CSS').show(la._threadlistRows);ga(la,ma);z(la);},function(oa,pa){la._remoteResultsCompleted=true;var qa=k.orderResults(ma,na,oa,c('WebMessengerStateManager').getCurrentStateData().folder);if(qa.length>0){c('CSS').conditionShow(la._loadMoreButton,!pa);ha(la,qa);}else fa(la);c('CSS').hide(la._loadingSpinner);z(la);},function(oa,pa){if(oa)la._searchThreadsSubscription={subscriber_id:oa,query:pa};});}else{m.clearTimer();c('CSS').hide(la._loadingSpinner);c('DOM').empty(la._threadlistRows);c('CSS').show(la._threadlistRows);la._threadIDs=[];}ba(la);}function ba(la){var ma=!!la._query&&la._active,na=ma^c('CSS').shown(la._searchMessagesIndicator);c('CSS').conditionShow(la._searchMessagesIndicator,ma);la._manager.sizeToFit(ma);na&&la._manager.draw();}function ca(la){q(la);c('CSS').addClass(la._loadMoreButton,'async_saving');var ma=l.getMoreThreadlist(la._query,function(na,oa){c('CSS').removeClass(la._loadMoreButton,'async_saving');c('CSS').conditionShow(la._loadMoreButton,!oa);ha(la,na);la._manager.poke();});if(ma)la._searchThreadsSubscription={subscriber_id:ma,query:la._query};}function da(la,ma){if(la._threadIDs.length){c('WebMessengerThreadlistRenderer').renderThreadsFromIDs(la._threadlistRows,la._threadIDs,la._keyboardSelection,ia,ma,c('WebMessengerStateConstants').MASTER.SEARCH);la._manager.poke();}}function ea(la,ma){ma=ma&&la._active;c('CSS').conditionClass(la._searchMessagesIndicator,"_33x",ma!==false);c('CSS').conditionShow(la._noMessagesIndicator,ma!==false);}function fa(la){la._threadIDs=[];w(la,false);var ma=j._("No people or conversations named {query}",[j.param('query',la._query)]),na=c('DOM').create('div',{},ma);c('DOM').setContent(la._noMessagesIndicator,na);ea(la,true);}function ga(la,ma){ha(la,ma,true);}function ha(la,ma,na){la._threadIDs=ma;w(la,na);c('WebMessengerThreadlistRenderer').renderThreadsFromIDs(la._threadlistRows,ma,la._keyboardSelection,ia,null,c('WebMessengerStateConstants').MASTER.SEARCH);c('WebMessengerEvents').updateSelection(la._keyboardSelection);if(la._keyboardSelection==o)v(la);}function ia(la){if(la)return n+la;return null;}function ja(la){var ma=j._("Showing results for name: {query}",[j.param('query',la._query)]);c('DOM').setContent(la._threadSearchResultDescription,ma);}function ka(la){if(la._query){c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET,{query:la._query,message_query:la._query});c('WebMessengerEvents').focusSearch();}}f.exports=p;},null);
__d('MessagingFilteringNux',['Arbiter','AsyncRequest','LayerDestroyOnHide','LayerHideOnTransition','MercuryConfig','isWebMessengerURI'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=null,i,j={ACCEPTED_EVENT:'filtering/accepted',DIALOG_REGISTERED_EVENT:'filtering/dialog-registered',tryShow:function(k){c('Arbiter').subscribe(j.DIALOG_REGISTERED_EVENT,function(){if(!h)return;h.setContext(k);h.show();h=null;},c('Arbiter').SUBSCRIBE_ALL);},registerDialog:function(k){h=k.disableBehavior(c('LayerDestroyOnHide')).disableBehavior(c('LayerHideOnTransition'));i=c('Arbiter').subscribe('page_transition',function(l,m){if(!c('isWebMessengerURI')(m.uri)){k&&k.destroy();i.unsubscribe();}},c('Arbiter').SUBSCRIBE_NEW);if(k)k.subscribe('confirm',function(){c('MercuryConfig').filtering_active=true;new (c('AsyncRequest'))('/ajax/web_messenger/dismiss_filtering_nux.php').send();k.hide();c('Arbiter').inform(j.ACCEPTED_EVENT,{});});c('Arbiter').inform(j.DIALOG_REGISTERED_EVENT,{},c('Arbiter').BEHAVIOR_PERSISTENT);}};f.exports=j;},null);
__d('WebMessengerAuxMenu',['SelectableMenu','MenuSelectableItem','MenuTheme','PopoverMenuOverlappingBorder','Popover','PopoverMenu'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j){'use strict';this._menu=new (c('SelectableMenu'))([],{className:j,theme:c('MenuTheme')});var k=new (c('Popover'))(i.parentNode,i,null,{alignh:'right'});new (c('PopoverMenu'))(k,i,this._menu,[c('PopoverMenuOverlappingBorder')]);}h.prototype.addOption=function(i,j){'use strict';var k=new (c('MenuSelectableItem'))({markup:i,title:''});k.setOnClickHandler(j);this._menu.addItem(k);return k;};h.prototype.destroy=function(){'use strict';};f.exports=h;},null);
__d('WebMessengerMenuFolderControl',['csx','cx','WebMessengerAuxMenu','CSS','Parent','WebMessengerTemplates','Toggler','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j,k;function l(n){return c('Parent').bySelector(n,"._282");}function m(n,o,p){'use strict';var q=!j||j!=o;j=o;this._template=c('WebMessengerTemplates')[':fb:web-messenger:master-view:tab-bar:menu-option'].build();this._template.setNodeContent('folderLabel',n);if(!k||q){k=new (c('WebMessengerAuxMenu'))(j,"_1j");c('CSS').show(l(j));c('WebMessengerSubscriptionsHandler').addSubscriptions(c('Toggler').subscribe(['show','hide'],function(r,s){var t=s.getActive(),u=t&&c('Parent').bySelector(t,"._282");if(u)c('CSS').conditionClass(u,"_50p_",r==='show');}));}this._menuItem=k.addOption(this._template.getRoot(),p);this._menuItem.getRoot();}m.prototype.getCountBadge=function(){'use strict';return this._template.getNode('count');};m.prototype.setSelected=function(n){'use strict';c('CSS').conditionClass(l(j),'selectedFolder',n);if(n){this._menuItem.select();}else this._menuItem.deselect();};m.prototype.destroy=function(){'use strict';k&&k.destroy();};f.exports=m;},null);
__d('WebMessengerTabbedFolderControl',['Event','CSS','WebMessengerTemplates'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j,k,l){'use strict';this._template=c('WebMessengerTemplates')[':fb:web-messenger:master-view:tab-bar:folder'].build();this._template.setNodeContent('folderLabel',i);this._listener=c('Event').listen(this._template.getNode('link'),'click',k);if(l)this._countListener=c('Event').listen(this._template.getNode('count'),'click',l);j.push(this._template.getRoot());}h.prototype.getCountBadge=function(){'use strict';return this._template.getNode('count');};h.prototype.setSelected=function(i){'use strict';c('CSS').conditionClass(this._template.getRoot(),'selectedFolder',i);};h.prototype.getElement=function(){'use strict';this._template.getRoot();};h.prototype.destroy=function(){'use strict';this._listener.remove();this._countListener&&this._countListener.remove();};f.exports=h;},null);
__d('WebMessengerMasterViewTabBarControl',['csx','fbt','JSXDOM','Arbiter','CSS','DOM','Event','Ellipsizer','WebMessengerMenuFolderControl','MercuryFilters','MercuryFolders','MercuryThreadlistConstants','MessagingFilteringNux','MessagingTag','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTabbedFolderControl','WebMessengerTemplates','WebMessengerEvents','WebMessengerSubscriptionsHandler','WebMessengerMercury'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();function j(q,r,s){'use strict';this._manager=q;this._rootElement=r;this._rootTopContentElement=s;this._threadInformer=c('WebMessengerMercury').getThreadInformer();this._unreadState=c('WebMessengerMercury').getUnreadState();c('DOM').empty(this._rootElement);var t=c('WebMessengerTemplates')[':fb:web-messenger:master-view:tab-bar'].build(),u=c('WebMessengerTemplates')[':fb:web-messenger:master-view:top-content'].build();c('DOM').setContent(this._rootElement,t.getRoot());c('DOM').setContent(this._rootTopContentElement,u.getRoot());this._tabList=t.getRoot();this._moreMenu=t.getNode('moreMenu');this._topContentCont=u.getRoot();this._topContent=u.getNode('masterViewTopContentHolder');this._closeButton=u.getNode('masterViewTopContentCloseButton');this._closeButtonCont=u.getNode('masterViewTopContentCloseCont');this._state=null;this._folder=null;this._filter=null;this._query=null;this._threadID=null;this._folders=c('MercuryFolders').getSupportedFolders();this._foldersToHeader={};this._filters=c('MercuryFilters').getSupportedFilters();this._filtersToHeader={};this._otherMarkAllRead=c('JSXDOM').a({href:"#"},i._("Mark All as Read"));this._unreadMarkAllRead=c('JSXDOM').a({href:"#"},i._("Mark All as Read"));var v=[];this._filters.forEach(function(y){var z=o.bind(null,this,c('MessagingTag').INBOX,y);switch(y){case c('MessagingTag').UNREAD:this._filtersToHeader[y]=this._filtersToHeader[y]||new (c('WebMessengerMenuFolderControl'))(i._("Unread"),this._moreMenu,z);break;}}.bind(this));this._folders.forEach(function(y){var z=o.bind(null,this,y,c('MercuryFilters').ALL),aa=o.bind(null,this,y,c('MessagingTag').UNREAD);switch(y){case c('MessagingTag').INBOX:var ba=i._("Recent");this._foldersToHeader[y]=this._foldersToHeader[y]||new (c('WebMessengerTabbedFolderControl'))(ba,v,z,aa);break;case c('MessagingTag').OTHER:this._foldersToHeader[y]=this._foldersToHeader[y]||new (c('WebMessengerMenuFolderControl'))(i._("Filtered"),this._moreMenu,z);break;case c('MessagingTag').ACTION_ARCHIVED:this._foldersToHeader[y]=this._foldersToHeader[y]||new (c('WebMessengerMenuFolderControl'))(i._("Archived"),this._moreMenu,z);break;case c('MessagingTag').SPAM:break;case c('MessagingTag').PENDING:this._foldersToHeader[y]=this._foldersToHeader[y]||new (c('WebMessengerTabbedFolderControl'))(i._("Message Requests"),v,z);break;}}.bind(this));c('DOM').prependContent(this._tabList,v);var w=c('DOM').scry(this._tabList,"._6xt");w.push(t.getNode('moreMenuLabel'));this._ellipsizer=new (c('Ellipsizer'))(w);k(this);var x=o.bind(null,this,c('MessagingTag').INBOX,c('MercuryFilters').ALL);c('Arbiter').subscribe(c('MessagingFilteringNux').ACCEPTED_EVENT,n.bind(null,this));c('WebMessengerSubscriptionsHandler').addSubscriptions(this._threadInformer.subscribe('unread-updated',p.bind(null,this)),c('Event').listen(this._otherMarkAllRead,'click',function(){this._unreadState.markFolderAsRead(c('MessagingTag').OTHER);}.bind(this)),c('Event').listen(this._unreadMarkAllRead,'click',function(){this._unreadState.markFolderAsRead(c('MessagingTag').INBOX);}.bind(this)),c('Event').listen(this._closeButton,'click',x));}j.prototype.updateView=function(){'use strict';var q=m(this);l(this);if(q)n(this);k(this);};j.prototype.getOtherFolderLabel=function(){'use strict';var q=c('MessagingTag').OTHER,r=this._foldersToHeader[q];if(!r||!r._template)return null;return r._template.getNode('folderLabel');};j.prototype.destroy=function(){'use strict';for(var q in this._foldersToHeader)this._foldersToHeader[q]&&this._foldersToHeader[q].destroy();for(var r in this._filtersToHeader)this._filtersToHeader[r]&&this._filtersToHeader[r].destroy();};function k(q){var r=85;c('DOM').scry(q._tabList,"._1r").forEach(function(s){r+=s.offsetWidth;});q._ellipsizer.confineWithin(q._rootElement.offsetWidth-r,1.3);}function l(q){var r=c('WebMessengerStateManager').getCurrentStateData();q._state=c('WebMessengerStateManager').getCurrentMasterState();q._folder=r.folder;q._filter=r.filter;q._query=r.query;}function m(q){if(!q._state||!q._folder)return true;var r=c('WebMessengerStateManager').getCurrentStateData();if(q._folder!=r.folder)return true;if(q._filter!=r.filter)return true;return false;}function n(q){var r=false,s;q._folders.forEach(function(t){var u=q._filter==c('MessagingTag').UNREAD,v=t==q._folder&&(q._filter==c('MercuryFilters').ALL||u),w,x;switch(t){case c('MessagingTag').INBOX:if(u){var y=c('JSXDOM').strong(null,i._("Unread")),z=c('JSXDOM').strong(null,i._("Inbox")),aa=i._("{unread} messages in {inbox}",[i.param('unread',y),i.param('inbox',z)]);w=c('JSXDOM').div(null,aa,' \u00b7 ',q._unreadMarkAllRead);x=true;}break;case c('MessagingTag').OTHER:break;}if(v){s=t;c('CSS').conditionShow(q._closeButtonCont,x);}else q._foldersToHeader[t].setSelected(false);if(v&&w){r=true;c('DOM').setContent(q._topContent,w);}});q._filters.forEach(function(t){var u=q._folder==c('MessagingTag').INBOX&&t==q._filter;q._filtersToHeader[t].setSelected(u);});s&&q._foldersToHeader[s].setSelected(true);c('CSS').conditionShow(q._topContentCont,r);p(q);q._manager.draw();}function o(q,r,s){var t=q._state==c('WebMessengerStateConstants').MASTER.SEARCH;if(t||q._folder!=r||q._filter!=s){var u=babelHelpers['extends']({},c('WebMessengerStateManager').getCurrentStateData()),v=c('WebMessengerStateManager').getCurrentDetailState();if(v!==c('WebMessengerStateConstants').DETAIL.SEARCH_SNIPPET&&v!==c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT)delete u.query;c('WebMessengerStateManager').updateMasterState(c('WebMessengerStateConstants').MASTER.RECENT_THREADS,Object.assign(u,{folder:r,filter:s}));}c('WebMessengerEvents').focusComposer();return false;}function p(q){for(var r in q._foldersToHeader){if(r==c('MessagingTag').ACTION_ARCHIVED)continue;var s=q._unreadState.exceedsMaxCount(r)?c('MercuryThreadlistConstants').MAX_UNREAD_COUNT+'+':q._unreadState.getUnreadCount(r),t=[q._foldersToHeader[r].getCountBadge()];if(r==c('MessagingTag').INBOX)q._filters.forEach(function(u){t.push(q._filtersToHeader[u].getCountBadge());});t.forEach(function(u){if(s)c('DOM').setContent(u,i._("({unread_count})",[i.param('unread_count',s)]));c('CSS').conditionShow(u,s);});}k(q);}f.exports=j;},null);
__d('WebMessengerMasterViewControlManager',['ArbiterMixin','DOM','WebMessengerFlexibleScrollArea','WebMessengerMasterViewTabBarControl','WebMessengerMasterViewSearchInputControl','WebMessengerMasterViewRecentThreadsControl','WebMessengerMasterViewSearchThreadsControl','WebMessengerStateManager','WebMessengerStateConstants','Style','WebMessengerTemplates','WebMessengerEvents','WebMessengerSubscriptionsHandler','mixin'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('mixin')(c('ArbiterMixin')));i=h&&h.prototype;function j(k){'use strict';i.constructor.call(this);this._rootElement=k;c('DOM').empty(this._rootElement);var l=c('WebMessengerTemplates')[':fb:web-messenger:master-view'].build();c('DOM').setContent(this._rootElement,l.getRoot());this._tabBarControl=new (c('WebMessengerMasterViewTabBarControl'))(this,l.getNode('masterViewTabBar'),l.getNode('masterViewTopContent'));this._searchInputControl=new (c('WebMessengerMasterViewSearchInputControl'))(this,l.getNode('masterViewSearchInput'));this._searchThreadsControl=new (c('WebMessengerMasterViewSearchThreadsControl'))(this,l.getNode('masterViewSearchThreads'),l.getNode('searchMessagesIndicator'),l.getNode('noMessages'));this._threadlistRowsWrapper=l.getNode('threadlistRowsWrapper');this._flexArea&&this._flexArea.destroy();var m={fade:true,persistent:true};this._flexArea=new (c('WebMessengerFlexibleScrollArea'))(this._threadlistRowsWrapper,m).setInfiniteScrollHandler(this.inform.bind(this,'scrolledNearBottom')).setContainer(this._rootElement).setMinFlexAreaHeight(40).draw();this._recentThreadsControl=new (c('WebMessengerMasterViewRecentThreadsControl'))(this,l.getNode('masterViewRecentThreads'),l.getNode('masterInfoBox'),l.getNode('masterViewTabBar'));c('WebMessengerSubscriptionsHandler').addSubscriptions(c('WebMessengerEvents').subscribe(c('WebMessengerEvents').FOCUS_AND_SELECT_SEARCH,this._searchInputControl.focusAndSelectSearch.bind(this._searchInputControl)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').FOCUS_SEARCH,this._searchInputControl.focus.bind(this._searchInputControl)),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').MASTER_DOM_CHANGED,function(){this._tabBarControl.updateView();this._flexArea&&this._flexArea.draw();}.bind(this)),c('WebMessengerStateManager').subscribe(c('WebMessengerStateConstants').STATE_CHANGE_EVENT,this.updateOnStateChange.bind(this)));this._resizeNodes=[this._rootElement,this._threadlistRowsWrapper,c('DOM').find(this._threadlistRowsWrapper,'div.uiScrollableAreaBody')];}j.prototype.updateOnStateChange=function(){'use strict';var k=c('WebMessengerStateManager').getCurrentMasterState();this._tabBarControl.updateView();this._searchInputControl.updateView();switch(k){case c('WebMessengerStateConstants').MASTER.RECENT_THREADS:this._searchThreadsControl.hideView();this._recentThreadsControl.updateView();break;case c('WebMessengerStateConstants').MASTER.SEARCH:this._recentThreadsControl.hideView();this._searchThreadsControl.updateView();break;}};j.prototype.scrollIntoView=function(k,l){'use strict';this._flexArea&&this._flexArea.scrollIntoView(k,l);};j.prototype.scrollToBottom=function(k){'use strict';this._flexArea&&this._flexArea.scrollToBottom(k);};j.prototype.scrollToTop=function(k){'use strict';this._flexArea&&this._flexArea.scrollToTop(k);};j.prototype.isScrolledToTop=function(){'use strict';return this._flexArea&&this._flexArea.isScrolledToTop();};j.prototype.getScrollTop=function(){'use strict';return this._flexArea.getScrollableArea().getScrollTop();};j.prototype.draw=function(){'use strict';this._flexArea&&this._flexArea.draw();};j.prototype.poke=function(){'use strict';this._flexArea&&this._flexArea.poke();};j.prototype.sizeToFit=function(k){'use strict';this._flexArea&&this._flexArea.setSizeToFit(k);};j.prototype.addScrollCallback=function(k){'use strict';this._flexArea&&this._flexArea.addScrollCallback(k);};j.prototype.forceFireScrollCallbacks=function(){'use strict';this._flexArea&&this._flexArea._onScroll();};j.prototype.getFlexAreaElement=function(){'use strict';return this._flexArea.flexArea;};j.prototype.resizeTo=function(k){'use strict';if(k!==null){k=k.toString();if(!(k.endsWith('%')||k.endsWith('px')))k=k+'px';}this._resizeNodes.forEach(function(l){c('Style').set(l,'width',k);});c('WebMessengerEvents').masterDOMChanged();};j.prototype.destroy=function(){'use strict';this._tabBarControl.destroy();this._recentThreadsControl.destroy();this._searchThreadsControl.destroy();this._flexArea.destroy();};f.exports=j;},null);
__d('WebMessengerPageTitleRenderer',['fbt','DocumentTitle','MercuryAPIArgsSource','MercuryViewer','MercuryParticipants','WebMessengerStateConstants','WebMessengerStateManager','MercuryThreadMetadataRenderer','MercuryThreads'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercuryThreadMetadataRenderer').get(),j=c('MercuryThreads').get(),k={updateTitleForState:function(n,o,p){this.withTitleForState(n,o,p||function(q){var r=c('WebMessengerStateManager').getCurrentDetailState(),s=c('WebMessengerStateManager').getCurrentStateData();if(n===r&&o===s)c('DocumentTitle').set(q);});},withTitleForState:function(n,o,p){switch(n){case c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES:l(o.thread_id,p);break;default:m(p);break;}}};function l(n,o){if(!n){m(o);return;}j.getThreadMeta(n,function(p){if(p.name){o(h._("{conversation_name} - Messages",[h.param('conversation_name',p.name)]));return;}c('MercuryParticipants').getMulti(p.participants,function(q){var r=[];for(var s in q)if(q.hasOwnProperty(s))r.push(q[s]);var t=i.renderParticipantList(n,r,q[c('MercuryViewer').getID()]?p.participants.length-1:p.participants.length,{abbr_mode:true,last_separator_uses_and:true,names_renderer:function(u){var v=[];if(u.length===1&&u[0].id===c('MercuryViewer').getID()){v.push(u[0].name);}else for(var w=0;w<u.length;w++)if(u[w].id!==c('MercuryViewer').getID())v.push(u[w].name);return v;}});o(h._("{conversation_name} - Messages",[h.param('conversation_name',t)]));});},c('MercuryAPIArgsSource').WEBMESSENGER);}function m(n){n(h._("Messages"));}f.exports=k;},null);
__d('WebMessengerPageTitleControl',['WebMessengerPageTitleRenderer','WebMessengerStateManager','WebMessengerStateConstants','WebMessengerSubscriptionsHandler','WebMessengerEvents'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=function(){var i=function(){c('WebMessengerPageTitleRenderer').updateTitleForState(c('WebMessengerStateManager').getCurrentDetailState(),c('WebMessengerStateManager').getCurrentStateData());};c('WebMessengerSubscriptionsHandler').addSubscriptions(c('WebMessengerStateManager').subscribe(c('WebMessengerStateConstants').STATE_CHANGE_EVENT,i),c('WebMessengerEvents').subscribe(c('WebMessengerEvents').DETAIL_DOM_CHANGED,i));};f.exports=h;},null);
__d('WebMessengerThreadMessagesAgent',['MercuryAPIArgsSource','MercuryMessages','MessagingTag','MercuryOrderedThreadlist','MercuryThreadInformer','MercuryThreads','WebMessengerConstants'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('MercuryMessages').get(),i=c('MercuryOrderedThreadlist').get(),j=c('MercuryThreadInformer').get(),k=c('MercuryThreads').get(),l=21,m=false,n='n_inbox_n_unreads',o=c('WebMessengerConstants').THREADLIST_MAX_READ_PRELOAD_NUM,p=c('WebMessengerConstants').THREADLIST_MAX_UNREAD_PRELOAD_NUM;function q(){'use strict';this._active=true;this._iterative=m;this._strategy=n;this._requestInFlight=false;this._requestIsQueued=false;this._pendingThreadIds={};this._processedThreadIds={};this._threadInformerSubscriptions=[];this._threadInformerSubscriptions.push(j.subscribe('threadlist-updated',r.bind(null,this)));}q.prototype.turnOn=function(){'use strict';this._active=true;};q.prototype.turnOff=function(){'use strict';this._active=false;};q.prototype.destroy=function(){'use strict';this._threadInformerSubscriptions.forEach(j.unsubscribe);this._threadInformerSubscriptions=[];};function r(u){if(u._active&&!u._requestIsQueued){if(u._requestInFlight){u._requestIsQueued=true;return;}var v=s(u);if(v.length){u._requestInFlight=true;if(v.length>l){v=v.slice(0,l);u._requestIsQueued=true;}}v.forEach(function(w){u._processedThreadIds[w]=true;u._pendingThreadIds[w]=true;h.getThreadMessagesRange(w,0,c('WebMessengerConstants').INITIAL_MESSAGES_LIMIT,function(){t(u,w);},null,c('MercuryAPIArgsSource').WEBMESSENGER);});}}function s(u){var v=i.getThreadlistUntilTimestamp(0,c('MessagingTag').INBOX),w=v.filter(function(ba){return !u._processedThreadIds[ba]&&!h.hasLoadedNMessages(ba,c('WebMessengerConstants').INITIAL_MESSAGES_LIMIT);});if(u._strategy===n){var x=[],y=[];for(var z=0;z<w.length;z++){var aa=k.getThreadMetaNow(w[z]);if(aa){if(aa.unread_count&&y.length<p)y.push(w[z]);if(!aa.unread_count&&x.length<o)x.push(w[z]);if(y.length>=p&&x.length>=o)break;}}w=x.concat(y);}return w;}function t(u,v){if(u._pendingThreadIds[v])delete u._pendingThreadIds[v];if(Object.keys(u._pendingThreadIds).length===0){if(!u._iterative)u._active=false;u._requestInFlight=false;if(u._requestIsQueued){u._requestIsQueued=false;r(u);}}}f.exports=q;},null);
__d('WebMessengerApp',['cx','Arbiter','CSS','WebMessengerDetailViewControlManager','DOM','WebMessengerMasterViewControlManager','MercuryStateCheck','WebMessengerPageTitleControl','PageTransitions','WebMessengerPermalinks','MercuryServerPayloadPreprocessor','WebMessengerShortcuts','SnowflakePermalinkUtils','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerStateStore','MercuryThreadInformer','WebMessengerThreadMessagesAgent','URI','WebMessengerAdsControl','WebMessengerSubscriptionsHandler','WebMessengerWidthControl','WebMessengerTemplates','clickRefAction','goURI','isWebMessengerURI','MercuryDeliveryState','MercuryParticipants'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercuryServerPayloadPreprocessor').get(),j=c('MercuryThreadInformer').get();c('MercuryDeliveryState').get();c('MercuryParticipants');e(['FBRTCMessageHandler'],function(s){s.init();});var k,l;function m(s,t){var u=t&&t.getQueryData().hasOwnProperty('theater'),v=t&&c('SnowflakePermalinkUtils').isPermalinkURI(t);if(u){k=c('Arbiter').subscribe('PhotoSnowlift.CLOSE',n.bind(null,s),c('Arbiter').SUBSCRIBE_NEW);return false;}else if(v){l=c('Arbiter').subscribe('PhotoSnowflake.CLOSE',n.bind(null,s),c('Arbiter').SUBSCRIBE_NEW);return false;}if(!t||!c('isWebMessengerURI')(t)){r(s);return false;}c('WebMessengerPermalinks').processURI(t,function(w){if(w){var x=c('WebMessengerStateManager').getCurrentStateData();if(w.redirect){c('WebMessengerPermalinks').goNextURI(w.master_state,w.detail_state,w.data,w.replace);}else c('WebMessengerStateManager').updateStateOnURI(w.master_state,w.detail_state,w.data);c('PageTransitions').transitionComplete();s._adsControl.stateChanged(x,c('WebMessengerStateManager').getCurrentStateData());return;}r(s);c('goURI')(t);});return true;}function n(s){c('PageTransitions').registerHandler(m.bind(null,s),6);if(k){k.unsubscribe();k=null;}if(l){l.unsubscribe();l=null;}}function o(){var s=c('WebMessengerStateManager').getCurrentStateData();c('WebMessengerStateStore').setLastSeen(s.folder,s.thread_id);}function p(s,t,u,v,w,x,y){c('WebMessengerSubscriptionsHandler').engage();n(this);c('Arbiter').inform('chat/set_does_page_occlude_tabs',true,c('Arbiter').BEHAVIOR_PERSISTENT);c('Arbiter').inform('chat/set_show_tab_unread_ui',false,c('Arbiter').BEHAVIOR_PERSISTENT);c('Arbiter').inform('chat/prefilled_messages_set',y,c('Arbiter').BEHAVIOR_PERSISTENT);var z=new (c('WebMessengerThreadMessagesAgent'))();z;c('WebMessengerStateManager').setStandaloneMode(x);i.handleUpdate(t);c('MercuryStateCheck').get();c('DOM').empty(s);var aa=c('WebMessengerTemplates')[':fb:web-messenger:page-skeleton'].build();c('DOM').setContent(s,aa.getRoot());if(c('WebMessengerStateManager').getStandaloneMode())c('CSS').addClass(document.body,"_k0_");c('WebMessengerShortcuts').registerGeneralShortcuts();this._masterViewManager=new (c('WebMessengerMasterViewControlManager'))(aa.getNode('masterView'));this._detailViewManager=new (c('WebMessengerDetailViewControlManager'))(aa.getNode('detailView'));this._pageTitleControl=new (c('WebMessengerPageTitleControl'))();v&&c('DOM').prependContent(aa.getRoot(),v);if(c('WebMessengerStateManager').getStandaloneMode()){this._widthControl=null;this._masterViewManager.resizeTo(null);this._detailViewManager.resizeTo(null);}else this._widthControl=new (c('WebMessengerWidthControl'))(this._masterViewManager.resizeTo.bind(this._masterViewManager),this._detailViewManager.resizeTo.bind(this._detailViewManager),w);this._adsControl=c('WebMessengerAdsControl').init();var ba=u?new (c('URI'))(u):c('WebMessengerPermalinks').getDefaultURI();m(this,ba);c('clickRefAction')('web_messenger').set_namespace('web_messenger');c('WebMessengerSubscriptionsHandler').addSubscriptions(j.subscribe('threads-deleted',function(ca,da){var ea=c('WebMessengerStateManager').getCurrentStateData().thread_id,fa=c('WebMessengerStateManager').getCurrentDetailState();if(fa==c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES&&da[ea]){c('WebMessengerStateManager').updateDetailState(c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES,{thread_id:null});}else o();}),c('WebMessengerStateManager').subscribe(c('WebMessengerStateConstants').STATE_CHANGE_EVENT,o));e(['MercuryBrowserAlerts'],function(ca){c('WebMessengerSubscriptionsHandler').addSubscriptions(j.subscribe('messages-received',function(da,ea){for(var fa in ea){var ga=ea[fa];for(var ha=0;ha<ga.length;ha++)ca.messageReceived(ga[ha]);}}));ca.subscribe('before-alert',function(da,event){if(event.threadID==q())event.cancelAlert();});});}function q(){var s=c('WebMessengerStateManager').getCurrentDetailState(),t=c('WebMessengerStateManager').getCurrentStateData();if(s==c('WebMessengerStateConstants').DETAIL.RECENT_MESSAGES||s==c('WebMessengerStateConstants').DETAIL.SEARCH_CONTEXT)return t.thread_id;return null;}function r(s){var t=true;e(['ChatTabActions'],function(u){t&&u.persistLocalState();});c('WebMessengerSubscriptionsHandler').release();c('Arbiter').inform('chat/set_does_page_occlude_tabs',false,c('Arbiter').BEHAVIOR_PERSISTENT);c('Arbiter').inform('chat/set_show_tab_unread_ui',true,c('Arbiter').BEHAVIOR_PERSISTENT);s._masterViewManager.destroy();s._detailViewManager.destroy();t=false;}f.exports=p;},null);