if (self.CavalryLogger) { CavalryLogger.start_js(["0Bxfz"]); } __d('PagesMessengerThreadDialogLink.react',['AsyncDialog','AsyncRequest','Link.react','MessageThreadViewSource','PagesMessagingConst','ReactComponentWithPureRenderMixin','React','URI'],(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:'PagesMessengerThreadDialogLink',mixins:[c('ReactComponentWithPureRenderMixin')],propTypes:{threadID:h.string.isRequired,viewer:h.string.isRequired,folder:h.string},getInitialState:function j(){return {permalinkURI:'#'};},componentDidMount:function j(){this._getPermalinkURI(this.props);},componentWillReceiveProps:function j(k){if(k.threadID!==this.props.threadID||k.folder!==this.props.folder)this._getPermalinkURI(k);},render:function j(){return (c('React').createElement(c('Link.react'),{className:this.props.className,href:'#',onClick:this._handleClick,role:'button'},this.props.children));},_handleClick:function j(k){k.preventDefault();c('AsyncDialog').send(new (c('AsyncRequest'))(this.state.permalinkURI).setRelativeTo(k.target));},_getPermalinkURI:function j(k){this.setState(this.getInitialState());var l=k.threadID,m=k.viewer,n=k.folder;e(['MercuryThreadIDMap'],function(o){var p=o.getForFBID(m);p.getServerIDFromClientID(l,function(q){this.isMounted()&&this.setState({permalinkURI:new (c('URI'))(c('PagesMessagingConst').LOAD_MESSAGE_THREAD_URI).setQueryData({pageid:m,threadid:l,threadElementID:q,folder:n,source:c('MessageThreadViewSource').REFRESH_HIGHLANDER_JEWEL}).toString()});}.bind(this));}.bind(this));}});f.exports=i;}),null); __d('MercuryJewelCountControl',['Arbiter','MercuryDispatcher','MercuryThreadInformer','MercuryUnseenState','UserActivity','isInFocusMode'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';var j=c('MercuryDispatcher').get(),k=c('MercuryThreadInformer').get();this.$MercuryJewelCountControl2=c('MercuryUnseenState').get();this.render();j.subscribe('model-update-completed',function(l,m){this.$MercuryJewelCountControl3(false);}.bind(this));k.subscribe('unseen-updated',function(){return this.render();}.bind(this));this.$MercuryJewelCountControl1=i;this.$MercuryJewelCountControl1.subscribe('marked-seen',function(){this.$MercuryJewelCountControl3(true);}.bind(this));}h.prototype.render=function(){'use strict';var i=c('isInFocusMode')()?0:this.$MercuryJewelCountControl2.getUnseenCount();c('Arbiter').inform('jewel/count-updated',{jewel:'mercurymessages',count:i},c('Arbiter').BEHAVIOR_STATE);};h.prototype.$MercuryJewelCountControl3=function(i){'use strict';if(i||this.$MercuryJewelCountControl1.isOpen()&&c('UserActivity').isActive())this.$MercuryJewelCountControl2.markAsSeen();};h.constructStores=function(){'use strict';c('MercuryUnseenState').get();};f.exports=h;}),null); __d('P2PBannerStore',['invariant','EventEmitter','P2PActionConstants','P2PAPI','P2PDispatcher'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=void 0,l={},m=false,n=false;i=babelHelpers.inherits(o,c('EventEmitter'));j=i&&i.prototype;function o(){j.constructor.call(this);k=c('P2PDispatcher').register(this.onEventDispatched.bind(this));}o.prototype.onEventDispatched=function(p){var q=p.type,r=p.data;switch(q){case c('P2PActionConstants').BANNER_STATES_UPDATED:this.handleBannerStatesUpdated(r);this.emit('change');break;case c('P2PActionConstants').BANNER_DISMISSED:this.handleBannerDismissed(r);this.emit('change');break;case c('P2PActionConstants').BANNER_COMPLETED:this.handleBannerCompleted(r);this.emit('change');break;}};o.prototype.handleBannerStatesUpdated=function(p){m=true;l=p;};o.prototype.handleBannerDismissed=function(p){var q=this.getBannerState(p);q.hasBeenDismissed=true;};o.prototype.shouldShowBanner=function(p){var q=void 0;if(!n){c('P2PAPI').getBannerStates();n=true;return false;}if(!m)return false;q=this.getBannerState(p);return (q.eligible&&!q.hasBeenDismissed);};o.prototype.handleBannerCompleted=function(p){var q=this.getBannerState(p);q.eligible=false;};o.prototype.getBannerState=function(p){var q=l[p];!q?h(0):void 0;return q;};f.exports=new o();}),null); __d('P2PJewelBanner.react',['cx','fbt','ix','Image.react','Layout.react','P2PButton.react','React','TooltipLink.react','URI','XUIGrayText.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('Layout.react').FillColumn,n=c('Layout.react').Column,o=c('React').PropTypes;k=babelHelpers.inherits(p,c('React').Component);l=k&&k.prototype;function p(){var q,r;for(var s=arguments.length,t=Array(s),u=0;u=c('MercuryThreadlistConstants').JEWEL_THREAD_COUNT+3||this.$MercuryThreadlistContainer1.hasLoadedThreadlist(r,s)));}.bind(this),this.$MercuryThreadlistContainer17=function(r){var s=this.state.threads.get(r);return s?s.length:0;}.bind(this),this.$MercuryThreadlistContainer7=function(){this.$MercuryThreadlistContainer2&&this.$MercuryThreadlistContainer19&&this.$MercuryThreadlistContainer2.unsubscribe(this.$MercuryThreadlistContainer19);}.bind(this),this.$MercuryThreadlistContainer8=function(){this.$MercuryThreadlistContainer1&&this.$MercuryThreadlistContainer18&&this.$MercuryThreadlistContainer1.unsubscribe(this.$MercuryThreadlistContainer18.subscriberID,this.$MercuryThreadlistContainer18.folder,this.$MercuryThreadlistContainer18.filter);}.bind(this),this.$MercuryThreadlistContainer11=function(r,s){this.setState({isLoading:s,searchThreads:[]},function(){return this.$MercuryThreadlistContainer5(k,c('MercuryFilters').ALL,r);}.bind(this));}.bind(this),this.$MercuryThreadlistContainer10=function(r){this.setState({isSearching:!!r});}.bind(this),n;}l.prototype.componentDidMount=function(){c('Bootloader').loadModules(["MercuryOrderedThreadlist","MercuryThreadInformer","MercuryThreads"],function(m,n,o){this.$MercuryThreadlistContainer1=m.getForFBID(this.props.viewer);this.$MercuryThreadlistContainer2=o.getForFBID(this.props.viewer);this.$MercuryThreadlistContainer3=n.getForFBID(this.props.viewer);this.$MercuryThreadlistContainer4=new (c('SubscriptionsHandler'))();this.$MercuryThreadlistContainer4.addSubscriptions(this.$MercuryThreadlistContainer3.subscribe('threadlist-updated',function(p,q){this.$MercuryThreadlistContainer5(this.props.folder,this.props.filter);}.bind(this)));this.$MercuryThreadlistContainer6(this.props.folder,this.props.filter);}.bind(this),'MercuryThreadlistContainer.react');};l.prototype.componentWillReceiveProps=function(m){if(m.folder!==this.props.folder||m.filter!==this.props.filter)this.$MercuryThreadlistContainer6(m.folder,m.filter);};l.prototype.componentWillUnmount=function(){this.$MercuryThreadlistContainer7();this.$MercuryThreadlistContainer8();this.$MercuryThreadlistContainer4&&this.$MercuryThreadlistContainer4.release();};l.prototype.render=function(){var m=this.props,n=m.ChildClass,o=m.folder,p=m.filter,q=babelHelpers.objectWithoutProperties(m,['ChildClass','folder','filter']),r=this.state.isSearching?this.state.threads.get(k)||[]:this.state.threads.get(o)||[];return c('React').createElement(n,babelHelpers['extends']({},q,{folder:o,isLoaded:!!this.$MercuryThreadlistContainer1&&this.$MercuryThreadlistContainer1.hasLoadedThreadlist(o,p),isLoading:this.state.isLoading,isSearching:this.state.isSearching,newMessageRequestThreads:this.state.unreadMessageRequestThreads,onLoadMoreRequest:this.$MercuryThreadlistContainer9,onQuery:this.$MercuryThreadlistContainer10,onSearchResults:this.$MercuryThreadlistContainer11,p2pJewelBannerContainer:this.$MercuryThreadlistContainer12(),threads:r}));};l.propTypes={ChildClass:j.func.isRequired,folder:j.string.isRequired,showCount:j.bool,showPresence:j.bool,source:j.string,threadCount:j.number,viewer:j.string.isRequired};l.defaultProps={source:c('MercuryAPIArgsSource').JEWEL};f.exports=l;}),null); __d('MercuryThreadlistRowContainer.react',['immutable','ImmutableObject','MercuryParticipants','React','StoreAndPropBasedStateMixin','shallowEqual'],(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:'MercuryThreadlistRowContainer',mixins:[c('StoreAndPropBasedStateMixin')(c('MercuryParticipants'))],propTypes:{ChildClass:h.func.isRequired,thread:h.instanceOf(c('ImmutableObject')).isRequired,viewer:h.string.isRequired},statics:{calculateState:function j(k){return {participants:c('immutable').Map(c('immutable').Seq(k.thread.participants).map(function(l){return [l,c('MercuryParticipants').getOrFetch(l)];}))};}},shouldComponentUpdate:function j(k,l){return (!c('shallowEqual')(k,this.props)||!c('immutable').is(l.participants,this.state.participants));},render:function j(){var k=this.props,l=k.ChildClass,m=babelHelpers.objectWithoutProperties(k,['ChildClass']);return (c('React').createElement(l,babelHelpers['extends']({},m,{participants:this.state.participants})));}});f.exports=i;}),null); __d('MercuryPresenceIndicator.react',['cx','fbt','Arbiter','AvailableListConstants','MercuryIDs','PresenceStatus','React','SubscriptionsHandler'],(function a(b,c,d,e,f,g,h,i){'use strict';var j,k;if(c.__markCompiled)c.__markCompiled();var l=c('React').PropTypes;j=babelHelpers.inherits(m,c('React').PureComponent);k=j&&j.prototype;function m(){var n,o;for(var p=arguments.length,q=Array(p),r=0;r0?t.markRead(this.props.threadID):t.markUnread(this.props.threadID);}.bind(this),o;}m.prototype.render=function(){!(this.props.unreadCount>=0)?i(0):void 0;return c('React').createElement(c('ReadToggle.react'),{isRead:this.props.unreadCount===0,onClick:this.$MercuryThreadReadToggle1,readLabel:h._("Mark as Unread"),unreadLabel:h._("Mark as Read")});};m.propTypes={threadID:l.string.isRequired,viewer:l.string.isRequired,unreadCount:l.number.isRequired};f.exports=m;}),null); __d('MessagesJewelInlineThumbnail.react',['cx','MercuryAttachmentType','React'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes;i=babelHelpers.inherits(l,c('React').Component);j=i&&i.prototype;function l(){var m,n;for(var o=arguments.length,p=Array(o),q=0;q1)o=c('React').createElement('span',null,c('React').createElement('span',{className:"_56hy"}),o);return o;};l.propTypes={thread:k.object.isRequired};f.exports=l;}),null); __d('MessagesJewelThreadListRow.react',['cx','ImageBlock.react','immutable','ImmutableObject','MercuryPresenceIndicator.react','MercurySeenIndicator.react','MercuryThreadImage.react','MercuryThreadPermalink.react','MercuryThreadReadToggle.react','MercuryThreadSnippet.react','MercuryThreadTimestamp.react','MercuryThreadTitle.react','MessagesJewelInlineThumbnail.react','MNAdsMessageUtils','React','UserAgent'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes;i=babelHelpers.inherits(l,c('React').PureComponent);j=i&&i.prototype;function l(){var m,n;for(var o=arguments.length,p=Array(o),q=0;q0?"jewelItemNew":''},c('React').createElement(c('MercuryThreadPermalink.react'),{className:'messagesContent',threadID:this.props.thread.thread_id,viewer:this.props.viewer,folder:this.props.thread.folder,onClick:this.props.onClick},n));};l.propTypes={onClick:k.func,participants:k.instanceOf(c('immutable').Map).isRequired,showPresence:k.bool,thread:k.instanceOf(c('ImmutableObject')).isRequired,viewer:k.string.isRequired,wasSeenByAll:k.bool};f.exports=l;}),null); __d('MessagesJewelThreadlistRowContainer.react',['ChatOpenTab','ChatOpenTabEventLogger','FantaTabActions','ImmutableObject','MercuryConfig','MercuryDelayedRoger','MercuryThreadlistRowContainer.react','MessagesJewelThreadListRow.react','ReactComponentWithPureRenderMixin','React','StoreAndPropBasedStateMixin'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('MercuryDelayedRoger').get(),i=c('React').PropTypes,j=c('React').createClass({displayName:'MessagesJewelThreadlistRowContainer',mixins:[c('ReactComponentWithPureRenderMixin'),c('StoreAndPropBasedStateMixin')(h)],propTypes:{thread:i.instanceOf(c('ImmutableObject')).isRequired,viewer:i.string.isRequired},statics:{calculateState:function k(l){return {wasSeenByAll:h.wasSeenByAll(l.thread.thread_id)};}},render:function k(){return (c('React').createElement(c('MercuryThreadlistRowContainer.react'),{ChildClass:c('MessagesJewelThreadListRow.react'),onClick:this._handleClick,showPresence:c('ChatOpenTab').canOpenTab(),thread:this.props.thread,viewer:this.props.viewer,wasSeenByAll:this.state.wasSeenByAll}));},_handleClick:function k(l){if(l.button===1||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;if(!c('ChatOpenTab').canOpenTab())return;l.preventDefault();var m=this.props.thread.thread_id;if(c('MercuryConfig').FantaTabs){c('FantaTabActions').openTab(m);c('ChatOpenTabEventLogger').log('jewel',m);}else c('ChatOpenTab').openThread(m,'jewel');}});f.exports=j;}),null); __d('MessagesJewelThreadList.react',['cx','fbt','BootloadedComponent.react','ImmutableObject','JewelConstants','JSResource','Link.react','MessagesJewelThreadlistRowContainer.react','MessagingTag','React','ScrollableArea.react','XUISpinner.react','debounce','getViewportDimensions','throttle'],(function a(b,c,d,e,f,g,h,i){'use strict';var j,k;if(c.__markCompiled)c.__markCompiled();var l=160,m=450,n=c('React').PropTypes;j=babelHelpers.inherits(o,c('React').Component);k=j&&j.prototype;function o(){var p,q;for(var r=arguments.length,s=Array(r),t=0;t=u.getScrollHeight()-1)this.props.onLoadMoreRequest&&this.props.onLoadMoreRequest();}.bind(this),this.$MessagesJewelThreadList8=function(u){u.preventDefault();this.props.onLoadMoreRequest&&this.props.onLoadMoreRequest();}.bind(this),this.$MessagesJewelThreadList4=function(){var u=this.props.newMessageRequestThreads;if(!this.props.jewelRequestsUI||this.props.folder===c('MessagingTag').PENDING||!u||u.length===0)return null;return (c('React').createElement(c('BootloadedComponent.react'),{bootloadPlaceholder:c('React').createElement('li',{style:{height:60}}),bootloadLoader:c('JSResource')('MessagesJewelMessageRequestsRow.react').__setRef('MessagesJewelThreadList.react'),onClick:this.$MessagesJewelThreadList9,threads:u,viewer:this.props.viewer}));}.bind(this),this.$MessagesJewelThreadList5=function(){if(!this.props.jewelRequestsUI||this.props.folder!==c('MessagingTag').PENDING)return null;return (c('React').createElement('li',{className:"_16bh _16bi"},i._("Open a request to get more info about who's messaging you."),c('React').createElement('br',null),i._("They won't know you've seen it until you accept.")));}.bind(this),this.$MessagesJewelThreadList9=function(u){if(this.props.onMessageRequestsClick)this.props.onMessageRequestsClick(u);}.bind(this),this.$MessagesJewelThreadList7=function(u){if(this.props.onFilteredRequestsClick)this.props.onFilteredRequestsClick(u);}.bind(this),this.state={height:this.$MessagesJewelThreadList2()},q;}o.prototype.componentDidMount=function(){this.$MessagesJewelThreadList1=Event.listen(window,'resize',c('debounce')(function(){this.setState({height:this.$MessagesJewelThreadList2()});}.bind(this)));};o.prototype.componentWillUnmount=function(){this.$MessagesJewelThreadList1.remove();};o.prototype.render=function(){return c('React').createElement(c('ScrollableArea.react'),{className:"_2q3u",height:this.state.height,onScroll:c('throttle')(this.$MessagesJewelThreadList3,50),ref:'scrollable'},c('React').createElement('ul',{className:'jewelContent'},this.props.p2pJewelBannerContainer?c('React').createElement('li',null,this.props.p2pJewelBannerContainer):null,this.$MessagesJewelThreadList4(),this.$MessagesJewelThreadList5(),this.props.threads.map(function(p){return c('React').createElement(c('MessagesJewelThreadlistRowContainer.react'),{key:p.thread_id,thread:p,viewer:this.props.viewer});}.bind(this))),this.$MessagesJewelThreadList6());};o.propTypes={isLoaded:n.bool,isLoading:n.bool,jewelRequestsUI:n.bool,onLoadMoreRequest:n.func,p2pJewelBannerContainer:n.element,threads:n.arrayOf(n.instanceOf(c('ImmutableObject'))).isRequired,viewer:n.string.isRequired};f.exports=o;}),null); __d('MercuryJewelThreadlistControl',['csx','cx','fbt','ArbiterMixin','CurrentUser','CSS','DOM','Event','JSLogger','MercuryConfig','MercuryFilters','MercuryThreadlistConstants','MercuryThreadlistContainer.react','MessagesJewelThreadList.react','MessagingTag','WebMessengerPermalinkConstants','React','ReactDOM','MercuryThreadInformer','MercuryUnreadState'],(function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercuryThreadInformer').get(),l=c('MercuryUnreadState').get(),m=c('JSLogger').create('mercury_jewel'),n=c('MessagingTag').PENDING,o=c('WebMessengerPermalinkConstants').PENDING_PATH,p='back_to_inbox';function q(u){var v=u.getFlyout();this._jewelController=u;this._threadlistContainer=c('DOM').find(v,"._3v_l");this._currentFolder=c('MessagingTag').INBOX;this._currentFilter=c('MercuryFilters').ALL;this._jewelTabLinks={};this._jewelTabCounts={};this._jewelTabLinks[c('MessagingTag').INBOX]=c('DOM').find(v,"._1sde");this._jewelTabCounts[c('MessagingTag').INBOX]=c('DOM').find(v,"._1sdg");c('Event').listen(this._jewelTabLinks[c('MessagingTag').INBOX],'click',r.bind(this,c('MessagingTag').INBOX,c('MercuryFilters').ALL));if(!c('MercuryConfig').JewelRequestsUI){this._jewelTabLinks[n]=c('DOM').find(v,"._1sdf");this._jewelTabCounts[n]=c('DOM').find(v,"._1sdh");c('Event').listen(this._jewelTabLinks[n],'click',r.bind(this,n,c('MercuryFilters').ALL));}else{this._jewelTabLinks[p]=c('DOM').find(v,"._34zq");c('Event').listen(this._jewelTabLinks[p],'click',r.bind(this,c('MessagingTag').INBOX,c('MercuryFilters').ALL));}this._markAllReadLink=c('DOM').find(v,"._1c1m");this._seeAllLink=c('DOM').find(v,'.seeMore');c('Event').listen(this._markAllReadLink,'click',function(w){l.markFolderAsRead(this._currentFolder);w.kill();}.bind(this));k.subscribe('unread-updated',s.bind(this));s.bind(this)();this.render();m.bump('opened_threadlist_'+this._currentFolder);}Object.assign(q.prototype,c('ArbiterMixin'));Object.assign(q.prototype,{render:function u(){c('ReactDOM').render(c('React').createElement(c('MercuryThreadlistContainer.react'),{ChildClass:c('MessagesJewelThreadList.react'),viewer:c('CurrentUser').getID(),folder:this._currentFolder,filter:this._currentFilter,jewelRequestsUI:c('MercuryConfig').JewelRequestsUI,onMessageRequestsClick:this._handleMessageRequestsClick.bind(this),onFilteredRequestsClick:this._handleFilteredRequestsClick.bind(this)}),this._threadlistContainer);},_handleMessageRequestsClick:function u(v){v.preventDefault();r.call(this,c('MessagingTag').PENDING,c('MercuryFilters').ALL);},_handleFilteredRequestsClick:function u(v){v.preventDefault();r.call(this,c('MessagingTag').OTHER,c('MercuryFilters').ALL);}});function r(u,v){if(this._currentFolder!==u||this._currentFilter!==v){var w=this._currentFolder,x=u===c('MessagingTag').INBOX,y=u;m.bump('opened_threadlist_'+u);if(this._jewelTabLinks[y])c('CSS').addClass(this._jewelTabLinks[y],"_1sdd");if(this._jewelTabLinks[w])c('CSS').removeClass(this._jewelTabLinks[w],"_1sdd");this._currentFolder=u;this._currentFilter=v;if(x){this._seeAllLink.href=c('WebMessengerPermalinkConstants').BASE_PATH;}else this._seeAllLink.href=o;if(c('MercuryConfig').JewelRequestsUI){c('CSS').conditionShow(this._jewelTabLinks[c('MessagingTag').INBOX],x);c('CSS').conditionShow(this._jewelTabLinks[p],!x);}this.render();}}function s(){t.call(this,c('MessagingTag').INBOX);if(!c('MercuryConfig').JewelRequestsUI)t.call(this,n);}function t(u){var v;if(l.exceedsMaxCount(u)){v=c('MercuryThreadlistConstants').MAX_UNREAD_COUNT;}else v=l.getUnreadCount(u);var w=this._jewelTabCounts[u];if(!w)return;if(v>0){if(v==c('MercuryThreadlistConstants').MAX_UNREAD_COUNT)v+='+';c('DOM').setContent(w,j._("({unread_count})",[j.param('unread_count',v)]));}else c('DOM').setContent(w,'');}f.exports=q;}),null); __d('MercuryJewel',['MercuryChannelHandlerDEPRECATED','Arbiter','MercuryJewelCountControl','MercuryServerPayloadPreprocessor'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();c('MercuryChannelHandlerDEPRECATED').get().turnOn();var h=false;function i(j,k){'use strict';c('MercuryJewelCountControl').constructStores();c('MercuryServerPayloadPreprocessor').get().handleUpdate(k);this.$MercuryJewel1=new (c('MercuryJewelCountControl'))(j);if(j.getRoot()&&j.isOpen()){this.$MercuryJewel2(j);}else j.subscribeOnce('opened',this.$MercuryJewel2.bind(this,j));}i.prototype.$MercuryJewel2=function(j){'use strict';if(!h){e(['MercuryJewelThreadlistControl'],function(k){this.$MercuryJewel3=new k(j);}.bind(this));c('Arbiter').inform('mercury-jewel/opened',null,c('Arbiter').BEHAVIOR_STATE);h=true;}};f.exports=i;}),null);