/*!CK:2815337947!*//*1459134295,*/

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

__d("GroupSellProductDetailsEvent",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={PHOTO_CLICK:"photo_click",SHOW_DIALOG:"show_dialog",HIDE_DIALOG:"hide_dialog",PROFILE_LINK_CLICK:"profile_link_click",GROUP_LINK_CLICK:"group_link_click",PERMALINK_CLICK:"permalink_click",ASYNC_DATA_REQUEST_FAIL:"async_data_request_fail",DIALOG_INSTANCE_NULL:"dialog_instance_null",MESSAGE_SELLER_CLICK:"message_seller_click",UFI_CLICK:"ufi_click",MARK_AS_SOLD_CLICK:"mark_as_sold_click",FAILED_SALE_POST_GEN:"failed_sale_post_gen"};},null);
__d("GroupSellProductDetailsImageAspect",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={HORIZONTAL:"horizontal",VERTICAL:"vertical",WIDE_HORIZONTAL:"wide_horizontal",WIDE_VERTICAL:"wide_vertical",SQUARE:"square",HEIGHT_BOUND:"height_bound"};},null);
__d("StoryRenderLocation",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={HOMEPAGE_STREAM:"homepage_stream",SUMMARY:"summary",ACTIVITY_LOG:"activity_log",BRIEF_ACTIVITY_LOG:"brief_activity_log",TIMELINE:"timeline",NEWSSTAND:"newsstand",GROUP:"group",EVENT:"event",NEWSSTAND_PERMALINK:"newsstand_permalink",TIMELINE_ENTSTREAM:"timeline_entstream",PERMALINK:"permalink",COVER_FEED:"cover_feed",BLENDED_SEARCH_RESULTS:"blended_search",FEED_MOBILE:"feed_mobile",HOME_BUBBLE:"home_bubble",FEED_IMMERSIVE:"feed_immersive",PERMALINK_IMMERSIVE:"permalink_immersive",TIMELINE_IMMERSIVE:"timeline_immersive",GROUP_IMMERSIVE:"group_immersive",COVER_IMMERSIVE:"cover_immersive",TIMELINE_CONTEXT:"timeline_context",EDIT_HISTORY:"edit_history",SNAPTU_FEED:"snaptu_feed",SNAPTU_TIMELINE:"snaptu_timeline",SIDE_FEED:"side_feed",MESSAGE_THREAD:"message_thread",PRESENCE_FEED:"presence_feed",APP_FEED:"app_feed",TRENDING_HOVERCARD:"trending_hovercard",SPACES_FEED:"spaces_feed",GAMETIME_HIGHLIGHTS:"gametime_highlights",VIDEO_CHANNEL:"video_channel",VIDEO_HOME_FEED:"video_home_feed",GROUPS_LANDING:"groups_landing",BUY_AND_SELL:"buy_and_sell",APPENDABLE_PROMPT:"appendable_prompt",REVIEWS_FEED:"reviews_feed",TOPIC_FEED:"topic_feed",ADMIN_FEED:"admin_feed",BREAKUP_VIEW_POSTS_FEED:"breakup_view_posts_feed",LOCAL_SEARCH_RESULTS_PAGE:"local_search_results_page",PLACE_FEED:"place_feed",NATIVE_TEMPLATES:"native_templates",SEARCH_RESULTS_PAGE:"search_results_page",REACTION_OVERLAY:"reaction_overlay",UNSPECIFIED:"unspecified"};},null);
__d('UFIFeedbackContext.react',['React','UFICentralUpdates','UFIFeedbackTargets'],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:'UFIFeedbackContext',_feedbackTargetSubscriberID:null,propTypes:{contextArgs:h.object.isRequired,render:h.func.isRequired},contextTypes:{stores:h.object},getInitialState:function(){return {contextArgs:this.props.contextArgs,feedback:null};},loadFeedbackTarget:function(j){if(!this._feedbackTargetSubscriberID)this._feedbackTargetSubscriberID=c('UFIFeedbackTargets').getFeedbackTarget(j,function(k){this._fbTargetSubscriberID=null;this.setState({feedback:k});}.bind(this));},componentDidMount:function(){this.loadFeedbackTarget(this.state.contextArgs.ftentidentifier);this.ufiCentralUpdatesSubscriptions=[c('UFICentralUpdates').subscribe('instance-updated',function(j,k){var l=this.state.contextArgs;if(l.instanceid in k.updates)this.loadFeedbackTarget(l.ftentidentifier);}.bind(this)),c('UFICentralUpdates').subscribe('feedback-updated',function(j,k){var l=this.state.contextArgs;if(l.ftentidentifier in k.updates)this.loadFeedbackTarget(l.ftentidentifier);}.bind(this)),c('UFICentralUpdates').subscribe('feedback-id-changed',function(j,k){var l=this.state.contextArgs;if(l.ftentidentifier in k.updates){var m=k.updates[l.ftentidentifier];this.setState({contextArgs:babelHelpers['extends']({},l,{ftentidentifier:m})});this.loadFeedbackTarget(m);}}.bind(this))];},componentWillUnmount:function(){this.ufiCentralUpdatesSubscriptions.forEach(function(j){return j&&c('UFICentralUpdates').unsubscribe(j);});if(this._feedbackTargetSubscriberID)c('UFIFeedbackTargets').unsubscribe(this._feedbackTargetSubscriberID);},render:function(){if(this.state.feedback)return this.props.render(this.state.contextArgs,this.state.feedback);return null;}});f.exports=i;},null);
__d('UFIAddCommentController',['Parent','React','ReactDOM','UFIActionTypes','UFIAddComment.react','UFICallbackStore','UFIDispatcher','UFIDispatcherContext.react','UFIFeedbackContext.react','UFIInstanceState','UFINewCommentNotifier'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j){'use strict';this.$UFIAddCommentController1=i;this.$UFIAddCommentController2=j;this.$UFIAddCommentController2.rootid=i.id;this.$UFIAddCommentController3=new (c('UFIDispatcher'))();this.$UFIAddCommentController4={UFICallbackStore:new (c('UFICallbackStore'))(this.$UFIAddCommentController3)};this.$UFIAddCommentController4.UFICallbackStore.on(c('UFIActionTypes').ADD_COMMENT.SUBMIT_NEW,function(k){return c('UFINewCommentNotifier').onNewComment(c('Parent').byTag(i,'form'),this.$UFIAddCommentController2,k.comment,k.target,k.replyCommentID,k.timestamp);}.bind(this));this.render();}h.prototype.render=function(){'use strict';var i=c('React').createElement(c('UFIDispatcherContext.react'),{dispatcher:this.$UFIAddCommentController3,stores:this.$UFIAddCommentController4},c('React').createElement(c('UFIFeedbackContext.react'),{contextArgs:this.$UFIAddCommentController2,render:this.renderAddComment}));c('ReactDOM').render(i,this.$UFIAddCommentController1);};h.prototype.renderAddComment=function(i,j){'use strict';var k=c('UFIInstanceState').getKeyForInstance(i.instanceid,'isediting');if(k||!j||!j.cancomment||!j.actorforpost)return null;return (c('React').createElement(c('UFIAddComment.react'),{viewerActorID:j.actorforpost,replyCommentID:null,targetID:j.ownerid,initialData:null,ref:null,withoutSeparator:null,editingComment:{},isEditing:false,mentionsDataSource:j.mentionsdatasource,showSendOnEnterTip:j.showsendonentertip,allowPhotoAttachments:j.allowphotoattachments&&!i.isstreaming,allowVideoAttachments:j.allowvideoattachments&&!i.isstreaming,allowStickerAttachments:j.allowstickerattachments&&!i.isstreaming,contextArgs:i,subtitle:j.subtitle,isQAndA:j.isqanda}));};f.exports=h;},null);
__d('GroupSellProductDetailActionsTypedLogger',['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('logger:GroupSellProductDetailActionsLoggerConfig',this.$GroupSellProductDetailActionsTypedLogger1,c('Banzai').BASIC);};h.prototype.logVital=function(){c('GeneratedLoggerUtils').log('logger:GroupSellProductDetailActionsLoggerConfig',this.$GroupSellProductDetailActionsTypedLogger1,c('Banzai').VITAL);};h.prototype.clear=function(){this.$GroupSellProductDetailActionsTypedLogger1={};return this;};h.prototype.updateData=function(j){this.$GroupSellProductDetailActionsTypedLogger1=babelHelpers['extends']({},this.$GroupSellProductDetailActionsTypedLogger1,j);return this;};h.prototype.setEvent=function(j){this.$GroupSellProductDetailActionsTypedLogger1.event=j;return this;};h.prototype.setGroupID=function(j){this.$GroupSellProductDetailActionsTypedLogger1.group_id=j;return this;};h.prototype.setReferralSurface=function(j){this.$GroupSellProductDetailActionsTypedLogger1.referral_surface=j;return this;};h.prototype.setStoryID=function(j){this.$GroupSellProductDetailActionsTypedLogger1.story_id=j;return this;};h.prototype.setSurface=function(j){this.$GroupSellProductDetailActionsTypedLogger1.surface=j;return this;};h.prototype.setVC=function(j){this.$GroupSellProductDetailActionsTypedLogger1.vc=j;return this;};var i={event:true,group_id:true,referral_surface:true,story_id:true,surface:true,vc:true};f.exports=h;},null);
__d('GroupCommerceProductDetailImageContainer.react',['cx','DOM','Event','GroupSellProductDetailActionsTypedLogger','GroupSellProductDetailsEvent','GroupSellProductDetailsImageAspect','Image.react','React','Style','Vector'],function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=38,m=10,n=483;i=babelHelpers.inherits(o,c('React').Component);j=i&&i.prototype;function o(p,q){j.constructor.call(this,p,q);var r=this;r.$GroupCommerceProductDetailImageContainer2=this.$GroupCommerceProductDetailImageContainer2.bind(this);r.$GroupCommerceProductDetailImageContainer3=this.$GroupCommerceProductDetailImageContainer3.bind(this);this.state={currentIndex:0,stageWidth:n,stageHeight:558};}o.prototype.render=function(){return (c('React').createElement('div',null,c('React').createElement('div',{className:"_57xm"},this.$GroupCommerceProductDetailImageContainer4()),c('React').createElement('div',{className:"_57xn"},this.props.media.length==0?this.$GroupCommerceProductDetailImageContainer5():this.$GroupCommerceProductDetailImageContainer6())));};o.prototype.componentDidUpdate=function(p,q){if(this.props.media&&this.props.media.length>1&&this.props.media!==p.media){this.$GroupCommerceProductDetailImageContainer7();this.$GroupCommerceProductDetailImageContainer1=c('Event').listen(document.body,'keydown',this.$GroupCommerceProductDetailImageContainer3);}else if(!this.props.media||this.props.media.length<1)this.$GroupCommerceProductDetailImageContainer7();};o.prototype.componentWillUnmount=function(){this.$GroupCommerceProductDetailImageContainer7();};o.prototype.componentWillReceiveProps=function(p){var q=this;if(this.props.media!==p.media){var r=0;if(p.media.length<1){this.setState({stageWidth:n});}else (function(){var s=q.props.query;if(s&&s.fbid){r=p.media.findIndex(function(t){return t.id.toString()===s.fbid;});if(r==-1)r=0;}q.$GroupCommerceProductDetailImageContainer8(r,p.media);})();this.setState({currentIndex:r});}};o.prototype.$GroupCommerceProductDetailImageContainer5=function(){var p=this.props.elem;if(!p)return null;var q=c('DOM').scry(p,'img')[0],r=c('DOM').scry(p,'i')[0],s=null,t=null;if(q){s=q.src;t=c('Vector').from(q.naturalWidth,q.naturalHeight);}else if(r){s=c('Style').get(r,'backgroundImage').replace(/.*url\("?([^"]*)"?\).*/,'$1');t=c('Vector').from(q.naturalWidth,q.naturalHeight);}else return null;if(!t.x||!t.y||!s)return null;return (c('React').createElement(c('Image.react'),{className:"_580_",width:t.x,height:t.y,src:s,style:this.$GroupCommerceProductDetailImageContainer9(t.x,t.y)}));};o.prototype.$GroupCommerceProductDetailImageContainer3=function(event){switch(event.keyCode){case 37:case 38:event.stopPropagation();this.$GroupCommerceProductDetailImageContainer10();break;case 39:case 40:event.stopPropagation();this.$GroupCommerceProductDetailImageContainer11();break;}};o.prototype.$GroupCommerceProductDetailImageContainer7=function(){if(this.$GroupCommerceProductDetailImageContainer1){this.$GroupCommerceProductDetailImageContainer1.remove();this.$GroupCommerceProductDetailImageContainer1=null;}};o.prototype.$GroupCommerceProductDetailImageContainer2=function(p){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').PHOTO_CLICK).setStoryID(this.props.storyID).setGroupID(this.props.group.id).log();this.$GroupCommerceProductDetailImageContainer8(p,this.props.media);this.setState({currentIndex:p});};o.prototype.$GroupCommerceProductDetailImageContainer8=function(p,q){var r=q[p],s=this.state.stageWidth;switch(r.aspect){case c('GroupSellProductDetailsImageAspect').HORIZONTAL:case c('GroupSellProductDetailsImageAspect').WIDE_HORIZONTAL:s=744;break;case c('GroupSellProductDetailsImageAspect').WIDE_VERTICAL:s=314;break;case c('GroupSellProductDetailsImageAspect').VERTICAL:s=419;break;case c('GroupSellProductDetailsImageAspect').SQUARE:s=558;break;case c('GroupSellProductDetailsImageAspect').HEIGHT_BOUND:s=r.width;break;}this.props.onResize(r.aspect,s);this.setState({stageWidth:s});};o.prototype.$GroupCommerceProductDetailImageContainer11=function(){var p=this.state.currentIndex+1,q=this.props.media.length-1;if(p>m||p>q)p=0;this.$GroupCommerceProductDetailImageContainer2(p);};o.prototype.$GroupCommerceProductDetailImageContainer10=function(){var p=this.state.currentIndex-1,q=this.props.media.length-1;if(p<0)p=m<q?m:q;this.$GroupCommerceProductDetailImageContainer2(p);};o.prototype.$GroupCommerceProductDetailImageContainer6=function(){var p=[],q=this.props.media.length;for(var r=0;r<q&&r<=m;r++){var s=this.props.media[r];p.push(c('React').createElement(c('Image.react'),{className:(this.state.currentIndex!=r?"_5810":'')+(' '+"_580_"),width:s.width,height:s.height,src:s.uri,key:'stage'+s.id,style:this.$GroupCommerceProductDetailImageContainer9(s.width,s.height)}));}return p;};o.prototype.$GroupCommerceProductDetailImageContainer9=function(p,q){var r=0;if(p>this.state.stageWidth){r=this.state.stageWidth/p;p*=r;q*=r;}if(q>this.state.stageHeight){r=this.state.stageHeight/q;p*=r;q*=r;}return {paddingTop:(this.state.stageHeight-q)/2+'px',paddingLeft:(this.state.stageWidth-p)/2+'px',maxWidth:this.state.stageWidth,maxHeight:this.state.stageHeight};};o.prototype.$GroupCommerceProductDetailImageContainer4=function(){var p=[],q=this.props.media.length;for(var r=0;r<q&&r<=m;r++){var s=this.props.media[r];p.push(c('React').createElement(c('Image.react'),{className:"_5811"+(this.state.currentIndex==r?' '+"_5812":''),width:l,height:l,src:s.uriThumb,onClick:this.$GroupCommerceProductDetailImageContainer2.bind(this,r),key:'thumbnail'+s.id}));}return (c('React').createElement('div',null,p));};o.propTypes={group:k.object.isRequired,media:k.any.isRequired,onResize:k.func.isRequired,storyID:k.string,query:k.object,elem:k.object};f.exports=o;},null);
__d('GroupCommerceProductDetailRHCContent.react',['cx','ix','GroupSellProductDetailActionsTypedLogger','GroupSellProductDetailsEvent','Image.react','Link.react','React','XUIText.react'],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').Component);k=j&&j.prototype;m.prototype.render=function(){var n=this.$GroupCommerceProductDetailRHCContent1(),o=this.$GroupCommerceProductDetailRHCContent2();return (c('React').createElement('div',{className:"_4g63"+(!this.props.actor.profilePicURI?' '+"_34xy":'')},c('React').createElement('div',{className:"_4g65"},o,n,c('React').createElement(c('XUIText.react'),{className:"_4g66"},this.props.product.price),c('React').createElement('div',{className:"_4g67"},this.props.description,c('React').createElement('div',{className:"_4g68"},this.props.actionButton))),c('React').createElement('div',{className:"_4g6d",ref:'ufi',onClick:function(){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').UFI_CLICK).setStoryID(this.props.storyID).setGroupID(this.props.group.id).log();}.bind(this)},this.props.ufi)));};m.prototype.$GroupCommerceProductDetailRHCContent2=function(){var n=this.props.product.statusText?this.props.product.statusText+' '+this.props.product.title:this.props.product.title;return (c('React').createElement(c('XUIText.react'),{id:this.props.titleID,className:"_4g6e"},n));};m.prototype.$GroupCommerceProductDetailRHCContent1=function(){var n=!this.props.product.deliveryNote?null:c('React').createElement(c('XUIText.react'),{display:'inline'},this.props.product.deliveryNote),o=n?' \u00b7 ':null,p=n?c('React').createElement(c('Image.react'),{className:"_4g6g",src:i('images/groups/sell/place_icon_sell.png')}):null;return (c('React').createElement('div',{className:"_4g6h"},p,c('React').createElement(c('XUIText.react'),null,n),o,c('React').createElement('div',{className:"_4g6i"},c('React').createElement(c('Link.react'),{href:this.props.product.uri,onClick:function(){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').PERMALINK_CLICK).setStoryID(this.props.storyID).setGroupID(this.props.group.id).log();this.props.hideDialog();}.bind(this)},this.props.timestamp))));};function m(){j.apply(this,arguments);}m.propTypes={actor:l.object.isRequired,product:l.object.isRequired,group:l.object.isRequired,feedback:l.object.isRequired,timestamp:l.any.isRequired,ufi:l.any.isRequired,actionButton:l.any.isRequired,storyID:l.string,description:l.any.isRequired,titleID:l.string};f.exports=m;},null);
__d('GroupCommerceProductDetailRHCFooter.react',['cx','Event','MentionsInputTypeaheadView.react','React','ReactDOM','UFIAddCommentController','UFIMentionsInputProxy.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;l.prototype.componentDidMount=function(){this.$GroupCommerceProductDetailRHCFooter1=c('Event').listen(c('ReactDOM').findDOMNode(this.refs.ufiAddComment),'keydown',this.$GroupCommerceProductDetailRHCFooter2);};l.prototype.createUFIAddComment=function(m){if(m.ufi&&m.ufi.params){m.ufi.params.mentionsinput={inputComponent:c('UFIMentionsInputProxy.react'),viewComponent:c('MentionsInputTypeaheadView.react')};new (c('UFIAddCommentController'))(c('ReactDOM').findDOMNode(this.refs.ufiAddComment),m.ufi.params).render();}};l.prototype.componentWillUnmount=function(){if(this.$GroupCommerceProductDetailRHCFooter1){this.$GroupCommerceProductDetailRHCFooter1.remove();this.$GroupCommerceProductDetailRHCFooter1=null;}};l.prototype.render=function(){return (c('React').createElement('div',{className:"_3g6i"+(!this.props.actor.profilePicURI?' '+"_34xy":''),key:this.props.ufiInstanceID,ref:'ufiAddComment'}));};l.prototype.$GroupCommerceProductDetailRHCFooter2=function(event){switch(event.keyCode){case 37:case 38:case 39:case 40:event.stopPropagation();break;}};function l(){i.apply(this,arguments);}l.propTypes={ufiInstanceID:k.string.isRequired,ufi:k.object.isRequired,actor:k.object.isRequired};f.exports=l;},null);
__d('GroupCommerceProductDetailRHCHeader.react',['cx','fbt','ix','GroupSellProductDetailActionsTypedLogger','GroupSellProductDetailsEvent','Image.react','Link.react','React','ReactLayeredComponentMixin','XUIContextualDialog.react','XUIContextualDialogBody.react','classWithMixins','mixin'],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,n=104,o=56;k=babelHelpers.inherits(p,c('classWithMixins')(c('React').Component,c('mixin')(c('ReactLayeredComponentMixin'))));l=k&&k.prototype;p.prototype.renderLayers=function(){return {contextualDialog:c('React').createElement(c('XUIContextualDialog.react'),{contextRef:function(){return this.refs.recommendation;}.bind(this),offsetX:-8,shown:true,hoverContextRef:function(){return this.refs.recommendation;}.bind(this),hideOnEscape:true,hoverHideDelay:0,hoverShowDelay:500,autoFocus:false,width:c('XUIContextualDialog.react').WIDTH.WIDE,position:'below'},c('React').createElement(c('XUIContextualDialogBody.react'),null,c('React').createElement('div',{id:this.props.recommendationID}))),actorDialog:c('React').createElement(c('XUIContextualDialog.react'),{contextRef:function(){return this.refs.actorName;}.bind(this),shown:true,hoverContextRef:function(){return this.refs.actorName;}.bind(this),hideOnEscape:true,hoverHideDelay:0,hoverShowDelay:500,autoFocus:false,width:c('XUIContextualDialog.react').WIDTH.WIDE,position:'below'},c('React').createElement(c('XUIContextualDialogBody.react'),null,c('React').createElement('div',{id:this.props.actorHoverID}))),actorImageDialog:c('React').createElement(c('XUIContextualDialog.react'),{contextRef:function(){return this.refs.actorImage;}.bind(this),shown:true,hoverContextRef:function(){return this.refs.actorImage;}.bind(this),hideOnEscape:true,hoverHideDelay:0,hoverShowDelay:500,autoFocus:false,width:c('XUIContextualDialog.react').WIDTH.WIDE,position:'below'},c('React').createElement(c('XUIContextualDialogBody.react'),null,c('React').createElement('div',{id:this.props.actorImageHoverID}))),groupDialog:c('React').createElement(c('XUIContextualDialog.react'),{contextRef:function(){return this.refs.groupName;}.bind(this),shown:true,hoverContextRef:function(){return this.refs.groupName;}.bind(this),hideOnEscape:true,hoverHideDelay:0,hoverShowDelay:500,autoFocus:false,width:c('XUIContextualDialog.react').WIDTH.WIDE,position:'below'},c('React').createElement(c('XUIContextualDialogBody.react'),null,c('React').createElement('div',{id:this.props.groupHoverID})))};};p.prototype.render=function(){var q=this.$GroupCommerceProductDetailRHCHeader1();return (c('React').createElement('div',{className:"_34xx"+(!this.props.actor.profilePicURI?' '+"_34xy":'')},c('React').createElement(c('Image.react'),{className:"_34xz",width:o,height:o,src:this.props.actor.profilePicURI,ref:'actorImage'}),c('React').createElement('div',{className:"_34x-"},c('React').createElement('div',{className:"_34x_"},c('React').createElement('div',{ref:'actorName',className:"_34y0"},c('React').createElement(c('Link.react'),{href:this.props.actor.uri,onClick:function(){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').PROFILE_LINK_CLICK).setStoryID(this.props.storyID).setGroupID(this.props.group.id).log();this.props.hideDialog();}.bind(this)},this.props.actor.name)),c('React').createElement(c('Image.react'),{className:"_34y1",src:j('images/icons/wall_arrow.gif')}),c('React').createElement('div',{ref:'groupName',className:"_34y0"},c('React').createElement(c('Link.react'),{href:this.props.group.uri,onClick:function(){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').GROUP_LINK_CLICK).setStoryID(this.props.storyID).setGroupID(this.props.group.id).log();this.props.hideDialog();}.bind(this)},this.props.group.name))),c('React').createElement('div',{ref:'recommendation',className:"_34y2"},q)),c('React').createElement('div',{id:this.props.chevronID})));};p.prototype.$GroupCommerceProductDetailRHCHeader1=function(){if(!this.props.actor.hasRecommendations)return null;var q=this.props.actor.recommendationsCount,r=this.props.actor.maxRecommendations,s=q<r?q:i._("{count} +",[i.param('count',r-1)]),t=q!==1?i._("{count} people recommended {short name of user}",[i.param('count',s),i.param('short name of user',this.props.actor.shortName)]):i._("{count} person recommended {short name of user}",[i.param('count',s),i.param('short name of user',this.props.actor.shortName)]);return (c('React').createElement('div',null,c('React').createElement('div',{className:"_1my1"+(!q?' '+"_29jg":'')}),c('React').createElement('div',{className:"_34y3"},t)));};p.prototype.componentDidUpdate=function(q,r){var s=this.refs.actorName.offsetWidth,t=n-s;this.refs.groupName.style.maxWidth=n+t+'px';};function p(){k.apply(this,arguments);}p.propTypes={actor:m.object.isRequired,group:m.object.isRequired,storyID:m.string,recommendationID:m.string.isRequired,actorHoverID:m.string.isRequired,actorImageHoverID:m.string.isRequired,groupHoverID:m.string.isRequired,chevronID:m.string.isRequired};f.exports=p;},null);
__d("XGroupCommerceMarketplaceProductDetailController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/marketplace\/product_detail\/",{story_id:{type:"String",required:true},ufi_id:{type:"String",required:true},date_time_id:{type:"String",required:true},action_button_id:{type:"String",required:true},recommendation_dialog_id:{type:"String",required:true},actor_dialog_id:{type:"String",required:true},actor_image_dialog_id:{type:"String",required:true},description_id:{type:"String",required:true},title_id:{type:"String",required:true},group_hover_id:{type:"String",required:true},ufi_instance_id:{type:"String",required:true},chevron_id:{type:"String",required:true}});},null);
__d("XGroupCommerceMarketplaceSimilarProductsController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/marketplace\/similar_products\/",{rid:{type:"Int"},rt:{type:"Enum",enumType:0},location:{type:"Enum",enumType:1},share_id:{type:"Int"},story_id:{type:"String",required:true},post_dom_id:{type:"String",required:true}});},null);
__d('GroupCommerceProductDetail.react',['csx','cx','fbt','AsyncRequest','GroupSellProductDetailActionsTypedLogger','GroupSellProductDetailsEvent','GroupSellProductDetailsImageAspect','LayerFadeOnHide','LayerHideOnEscape','LeftRight.react','GroupCommerceProductDetailRHCHeader.react','GroupCommerceProductDetailImageContainer.react','GroupCommerceProductDetailRHCContent.react','GroupCommerceProductDetailRHCFooter.react','StoryRenderLocation','Parent','React','ReactLayeredComponentMixin','ReactRenderer','ResponsiveBlock.react','ScrollableArea.react','XGroupCommerceMarketplaceProductDetailController','XGroupCommerceMarketplaceSimilarProductsController','XUIDialog.react','XUIDialogTitle.react','XUIDialogBody.react','classWithMixins','guid','mixin'],function a(b,c,d,e,f,g,h,i,j){'use strict';var k,l;if(c.__markCompiled)c.__markCompiled();var m=495,n=891;k=babelHelpers.inherits(o,c('classWithMixins')(c('React').Component,c('mixin')(c('ReactLayeredComponentMixin'))));l=k&&k.prototype;function o(p,q){l.constructor.call(this,p,q);var r=this;r.hideDialog=this.hideDialog.bind(this);r.showDialog=this.showDialog.bind(this);r.$GroupCommerceProductDetail2=this.$GroupCommerceProductDetail2.bind(this);r.$GroupCommerceProductDetail3=this.$GroupCommerceProductDetail3.bind(this);r.$GroupCommerceProductDetail4=this.$GroupCommerceProductDetail4.bind(this);r.$GroupCommerceProductDetail5=this.$GroupCommerceProductDetail5.bind(this);this.$GroupCommerceProductDetail1={};this.state={isDialogShown:false,width:n,rhcHeight:200,payload:this.$GroupCommerceProductDetail6(),ufiID:'ufi_detail_'+c('guid')(),datetimeID:'datetime_'+c('guid')(),actionButtonID:'actionButton'+c('guid')(),recommendationDialogID:'recommendationDialogID'+c('guid')(),actorHoverID:'actorHoverID'+c('guid')(),actorImageHoverID:'actorImageHoverID'+c('guid')(),descriptionID:'descriptionID'+c('guid')(),titleID:'titleID'+c('guid')(),groupHoverID:'groupHoverID'+c('guid')(),ufiInstanceID:'ufiInstanceID'+c('guid')(),chevronID:'chevronID'+c('guid')(),query:null,elem:null};}o.prototype.componentWillUnmount=function(){this.refs.modal.layer.hide();o.$GroupCommerceProductDetail7=null;};o.prototype.renderLayers=function(){var p=c('React').createElement('div',{id:this.state.datetimeID}),q=c('React').createElement('div',{id:this.state.ufiID}),r=c('React').createElement('div',{id:this.state.actionButtonID}),s=c('React').createElement('div',{className:"_3g5q",id:this.state.descriptionID});return {dialog:c('React').createElement(c('XUIDialog.react'),{className:"_5p3y",shown:this.state.isDialogShown,onToggle:this.$GroupCommerceProductDetail2,ref:'modal',width:this.state.width,behaviors:{LayerFadeOnHide:c('LayerFadeOnHide'),LayerHideOnEscape:c('LayerHideOnEscape')}},c('React').createElement(c('XUIDialogTitle.react'),null,j._("Item Details")),c('React').createElement(c('XUIDialogBody.react'),null,c('React').createElement('div',{className:"_3g6d"},c('React').createElement(c('LeftRight.react'),null,c('React').createElement('div',{className:"_3g6e"},c('React').createElement(c('GroupCommerceProductDetailImageContainer.react'),{group:this.state.payload.group,media:this.state.payload.media,storyID:this.state.payload.storyID,query:this.state.query,elem:this.state.elem,onResize:this.$GroupCommerceProductDetail5})),c('React').createElement('div',{className:"_3g6f"},c('React').createElement(c('ScrollableArea.react'),{className:"_3g6g",height:this.state.rhcHeight},c('React').createElement(c('ResponsiveBlock.react'),{className:"_3g6h",onResize:this.$GroupCommerceProductDetail3},c('React').createElement(c('GroupCommerceProductDetailRHCHeader.react'),{actor:this.state.payload.actor,group:this.state.payload.group,hideDialog:this.hideDialog,storyID:this.state.payload.storyID,recommendationID:this.state.recommendationDialogID,actorHoverID:this.state.actorHoverID,actorImageHoverID:this.state.actorImageHoverID,groupHoverID:this.state.groupHoverID,chevronID:this.state.chevronID}),c('React').createElement(c('GroupCommerceProductDetailRHCContent.react'),{actor:this.state.payload.actor,product:this.state.payload.product,group:this.state.payload.group,feedback:this.state.payload.feedback,timestamp:p,actionButton:r,ufi:q,hideDialog:this.hideDialog,storyID:this.state.payload.storyID,description:s,titleID:this.state.titleID}))),c('React').createElement(c('GroupCommerceProductDetailRHCFooter.react'),{actor:this.state.payload.actor,ref:'rhcFooter',className:"_3g6i",ufiInstanceID:this.state.ufiInstanceID,ufi:this.state.payload.ufi}))))))};};o.prototype.render=function(){return null;};o.prototype.showDialog=function(p,q,r){var s=c('XGroupCommerceMarketplaceProductDetailController').getURIBuilder().setString('story_id',p).setString('ufi_id',this.state.ufiID).setString('date_time_id',this.state.datetimeID).setString('action_button_id',this.state.actionButtonID).setString('recommendation_dialog_id',this.state.recommendationDialogID).setString('actor_dialog_id',this.state.actorHoverID).setString('actor_image_dialog_id',this.state.actorImageHoverID).setString('description_id',this.state.descriptionID).setString('title_id',this.state.titleID).setString('group_hover_id',this.state.groupHoverID).setString('ufi_instance_id',this.state.ufiInstanceID).setString('chevron_id',this.state.chevronID).getURI();new (c('AsyncRequest'))().setURI(s).setMethod('GET').setHandler(this.$GroupCommerceProductDetail4).setErrorHandler(function(t){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').ASYNC_DATA_REQUEST_FAIL).setStoryID(p.toString()).log();}).setReadOnly(true).send();this.setState({payload:this.$GroupCommerceProductDetail6(),query:q,elem:r,isDialogShown:true,width:n});this.$GroupCommerceProductDetail8(p,r);};o.prototype.$GroupCommerceProductDetail8=function(p,q){var r=q&&c('Parent').bySelector(q,"._4-u2");if(!r)return;if(!q||q.dataset.renderLocation!==c('StoryRenderLocation').GROUP)return;var s=r.id;if(this.$GroupCommerceProductDetail1[s])return;this.$GroupCommerceProductDetail1[s]=true;var t=c('XGroupCommerceMarketplaceSimilarProductsController').getURIBuilder().setString('story_id',p).setString('post_dom_id',s).getURI();new (c('AsyncRequest'))().setURI(t).setMethod('GET').setHandler(this.$GroupCommerceProductDetail9).setErrorHandler(function(u){}).setReadOnly(true).send();};o.prototype.$GroupCommerceProductDetail9=function(p){var q=p.getPayload();if(!q||!q.length)return;};o.prototype.hideDialog=function(){this.$GroupCommerceProductDetail2(false);};o.prototype.$GroupCommerceProductDetail5=function(p,q){var r=this.state.width;switch(p){case c('GroupSellProductDetailsImageAspect').HORIZONTAL:case c('GroupSellProductDetailsImageAspect').WIDE_HORIZONTAL:r=1153;break;case c('GroupSellProductDetailsImageAspect').WIDE_VERTICAL:r=723;break;case c('GroupSellProductDetailsImageAspect').VERTICAL:r=828;break;case c('GroupSellProductDetailsImageAspect').SQUARE:r=967;break;case c('GroupSellProductDetailsImageAspect').HEIGHT_BOUND:r=q+409;break;}this.setState({width:r});};o.prototype.$GroupCommerceProductDetail3=function(p,q){if(q>m)q=m;this.setState({rhcHeight:q});};o.prototype.$GroupCommerceProductDetail2=function(p){if(o.$GroupCommerceProductDetail7!==null)this.setState({isDialogShown:p});if(!p){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').HIDE_DIALOG).setStoryID(this.state.payload.storyID).setGroupID(this.state.payload.group.id).log();if(o.$GroupCommerceProductDetail7!==null)setTimeout(function(){this.setState({payload:this.$GroupCommerceProductDetail6(),query:null,elem:null});}.bind(this));}};o.prototype.$GroupCommerceProductDetail6=function(){return {actor:{profilePicURI:null},group:{},product:{},feedback:{},media:[],ufi:{}};};o.prototype.$GroupCommerceProductDetail4=function(p){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').SHOW_DIALOG).setStoryID(p.payload.storyID).setGroupID(p.payload.group.id).log();this.refs.rhcFooter.createUFIAddComment(p.payload);this.setState({payload:p.payload,isDialogShown:true});};o.init=function(p){var q=c('ReactRenderer').constructAndRenderComponent(o,{},p);o.$GroupCommerceProductDetail10=p;o.$GroupCommerceProductDetail7=q;if(o.$GroupCommerceProductDetail11){o.showDialog(o.$GroupCommerceProductDetail11,o.$GroupCommerceProductDetail12,o.$GroupCommerceProductDetail13);o.$GroupCommerceProductDetail11=null;o.$GroupCommerceProductDetail12=null;o.$GroupCommerceProductDetail13=null;}};o.showDialog=function(p,q,r){if(!o.$GroupCommerceProductDetail7){if(!o.$GroupCommerceProductDetail10){o.$GroupCommerceProductDetail11=p;o.$GroupCommerceProductDetail12=q;o.$GroupCommerceProductDetail13=r;return;}o.init(o.$GroupCommerceProductDetail10);}if(!o.$GroupCommerceProductDetail7){new (c('GroupSellProductDetailActionsTypedLogger'))().setEvent(c('GroupSellProductDetailsEvent').DIALOG_INSTANCE_NULL).setStoryID(p.toString()).log();return;}o.$GroupCommerceProductDetail7.showDialog(p,q,r);};o.$GroupCommerceProductDetail7=null;o.$GroupCommerceProductDetail11=null;o.$GroupCommerceProductDetail10=null;o.$GroupCommerceProductDetail13=null;o.$GroupCommerceProductDetail12=null;f.exports=o;},null);
__d('GroupCommerceProductDetailLayer',['Layer','GroupCommerceProductDetail.react'],function a(b,c,d,e,f,g){'use strict';var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('Layer'));i=h&&h.prototype;j.prototype._buildWrapper=function(k,l){c('GroupCommerceProductDetail.react').init(l);return l;};function j(){h.apply(this,arguments);}f.exports=j;},null);
__d('OGHovercardLayerHideOnBlur',['ContextualThing','DOM','Event'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){this._layer=i;}Object.assign(h.prototype,{_subscriptions:null,_clickListener:null,enable:function(){this._subscriptions=[this._layer.subscribe('show',this._attach.bind(this)),this._layer.subscribe('hide',this._detach.bind(this))];if(this._layer.isShown())this._attach();},disable:function(){this._detach();while(this._subscriptions.length)this._subscriptions.pop().unsubscribe();this._subscriptions=null;},_detach:function(){this._clickListener&&this._clickListener.remove();this._clickListener=null;},_attach:function(){setTimeout(function(){this._clickListener=c('Event').listen(document.documentElement,'click',this._maybeHide.bind(this));}.bind(this),0);},_maybeHide:function(event){var i=event.getTarget();if(c('DOM').contains(this._layer.getContent(),i)||c('ContextualThing').containsIncludingLayers(this._layer.getContentRoot(),i))return;if(this._shouldHide(event))this._layer.hide();},_shouldHide:function(event){return true;}});f.exports=h;},null);
__d('OGAggregationHovercardTarget',['cx','fbt','Event','ArbiterMixin','AsyncRequest','ContextualDialog','ContextualDialogArrow','CSS','DOM','LayerHideOnBlur','LayerHideOnEscape','OGHovercardLayerHideOnBlur'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=350,k={};function l(n){return new (c('ContextualDialog'))({addedBehaviors:[c('LayerHideOnBlur'),c('LayerHideOnEscape')],arrowBehavior:c('ContextualDialogArrow'),classNames:[n]},c('DOM').create('div',{className:"_4q1"},i._("Loading..."))).setWidth(j);}Object.assign(m,{setHovercard:function(n,o){var p=k[n];p&&p.setHovercard(o);}});function m(n,o,p,q,r,s,t,u,v){k[o]=this;this._targetID=o;this._endpoint=p;this._preventClose=r||[];this._position=t||'below';this._dialogClass=u||'';this._fetchOnHover=v;this.init(n);for(var w=0,x=q.length;w<x;w++){var y=q[w];this.addTrigger(y.element,y.trigger_class,y.context);}if(s)this.showHovercard(null,null);}Object.assign(m.prototype,c('ArbiterMixin'),{init:function(n){this._hovercardShown=false;this._hovercardScheduled=false;this._target=n;this._triggers=[];this._hovercard=null;this._fetching=false;this._placeholder=null;this._placeholderListener=null;this._shownClass='hover_shown';this._triggerClass=null;this._currentTrigger=null;this._context=null;return this;},addTrigger:function(n,o,p){this._triggers.push(n);c('Event').listen(n,'click',this._onTriggerClick.bind(this,n,o,p));if(this._fetchOnHover)c('Event').listen(n,'mouseover',this._onTriggerMouseOver.bind(this));},_onTriggerMouseOver:function(){this._fetch();},_onTriggerClick:function(n,o,p){p=p||this._target;if(this._hovercardShown&&this._hovercard.getContext()===p||this._hovercardScheduled&&this._placeholder.getContext()===p||(this._hovercardShown||this._hovercardScheduled)&&this._currentTrigger===n){this._currentTrigger=null;this.hideHovercard();return;}this.hideHovercard();this._currentTrigger=n;this.showHovercard(o,p);},_fetch:function(){if(this._hovercard!=null||this._fetching)return;this._fetching=true;var n=function(){this._fetching=false;},o=function(){this.hideHovercard();};new (c('AsyncRequest'))(this._endpoint).setData({hover_target:this._targetID}).setMethod('GET').setReadOnly(true).setErrorHandler(o.bind(this)).setTransportErrorHandler(o.bind(this)).setFinallyHandler(n.bind(this)).send();},setHovercard:function(n){var o,p,q=this;this._hovercard=n;o=babelHelpers.inherits(r,c('OGHovercardLayerHideOnBlur'));p=o&&o.prototype;function r(s){'use strict';p.constructor.call(this,s);}r.prototype.$conditionalHideOnBlur1=function(event){'use strict';var s=event.getTarget();for(var t=0,u=q.$conditionalHideOnBlur2.length;t<u;t++)if(c('DOM').contains(q.$conditionalHideOnBlur2[t],s))return false;return true;};this._hovercard.setPosition(this._position).setAlignment('center').enableBehaviors([r,c('LayerHideOnEscape')]);this._hovercard.subscribe('aftershow',this._onHovercardShow.bind(this));this._hovercard.subscribe('hide',this._onHovercardHide.bind(this));this._hovercard.subscribe('destroy',this._onHovercardDestroy.bind(this));if(this._hovercardScheduled)this.showHovercard(this._triggerClass,this._context);},showHovercard:function(n,o){c('CSS').addClass(this._target,this._shownClass);if(this._triggerClass&&this._triggerClass!==n)c('CSS').removeClass(this._target,this._triggerClass);this._triggerClass=n;this._triggerClass&&c('CSS').addClass(this._target,this._triggerClass);this._context=o;if(this._hovercard){this._hovercard.setContext(o||this._target).show();this._hovercardShown=true;this._hovercardScheduled=false;this._hidePlaceholder();}else{this._hovercardScheduled=true;this._fetch();this._showPlaceholder();}this.inform('showhovercard');},hideHovercard:function(){this._hovercardScheduled=false;this._hidePlaceholder();if(this._hovercard){this._hovercard.hide();}else this._onHovercardHide();},_showPlaceholder:function(){if(!this._placeholder){this._placeholder=l(this._dialogClass);this._placeholder.setContext(this._context||this._target).setPosition(this._position).setAlignment('center').show();this._placeholderListener=this._placeholder.subscribe('hide',this._onPlaceholderHide.bind(this));}},_hidePlaceholder:function(){this._placeholder&&this._placeholder.hide();},_onPlaceholderHide:function(){if(this._placeholder){this._hovercardScheduled=false;this._placeholderListener&&this._placeholder.unsubscribe(this._placeholderListener);this._placeholder=null;!this._hovercardShown&&this._removeTriggerClasses();}},_onHovercardShow:function(){var n=this._hovercard.getContent(),o=c('DOM').scry(n,'textarea.mentionsTextarea')[0];o&&o.focus();},_onHovercardHide:function(){this._hovercardShown=false;this._removeTriggerClasses();this.inform('hidehovercard');},_onHovercardDestroy:function(){this._hovercard=null;},_removeTriggerClasses:function(){c('CSS').removeClass(this._target,this._shownClass);this._triggerClass&&c('CSS').removeClass(this._target,this._triggerClass);}});f.exports=m;},null);
__d('BulkTagLoader',['AsyncRequest','emptyFunction'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=false;function i(){}Object.assign(i,{loadForSet:function(j){if(!h){h=true;new (c('AsyncRequest'))('/ajax/photos/sets/tags_fetch.php').setHandler(c('emptyFunction')).setData({set:j}).send();}},loadForAlbum:function(j){if(!h){h=true;new (c('AsyncRequest'))('/ajax/photos/album/tags_fetch.php').setHandler(c('emptyFunction')).setData({fbid:j}).send();}},reset:function(){h=false;}});f.exports=i;},null);
__d('PhotoCurationControl',['Event','Parent','Toggler'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={init:function(i){var j=c('Parent').byClass(i,'fbPhotoStarGridElement');c('Event').listen(j,'mouseleave',function(){c('Toggler').hide();});}};f.exports=h;},null);
__d('PhotoInlineActions',['csx','cx','Arbiter','AsyncRequest','CSS','Event','Nectar','Parent'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={init:function(k,l,m,n,o,p,q,r,s,t){var u=false;c('Arbiter').subscribe(['UFI/CommentAddedActive','UFI/CommentDeletedActive','UFI/LikeActive'],function(v,w){if(parseInt(k.getAttribute('data-fbid'),10)!==w)return;if(v==='UFI/LikeActive')c('CSS').toggleClass(k,"_53a");new (c('AsyncRequest'))().setURI('/ajax/photos/photo/refresh.php').setData({fbid:k.getAttribute('data-fbid')}).setRelativeTo(k).send();});c('Event').listen(k,'click',function(event){var v=event.getTarget();if(u||!c('Parent').bySelector(v,"._53b"))return;event.prevent();c('CSS').toggleClass(k,"_53a");var w={};c('Nectar').addModuleData(w,k);u=new (c('AsyncRequest'))().setURI('/ajax/photos/photo/like.php').setData(babelHelpers['extends']({fbid:k.getAttribute('data-fbid'),relatedid:l,hovercardendpoint:m,includecommentlink:n,hovercardposition:o,includeleadingseparator:p,dialogClass:q,fetchOnHover:r,includeSocialContext:s,tagURI:t},w)).setRelativeTo(k).setErrorHandler(function(){c('CSS').toggleClass(k,"_53a");}).setFinallyHandler(function(){u=false;}).send();});}};f.exports=j;},null);
__d('StarGridLayout',['Vector','removeFromArray'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';Object.assign(this,i);}h.prototype.getShortestColumn=function(i){'use strict';return i[0]<=i[1]?0:1;};h.prototype.getDangling=function(i){'use strict';var j=i.filter(function(k){return !this.isStarred(k);}.bind(this));if(j.length%2===1)return j[j.length-1];return null;};h.prototype.mangleOrder=function(i){'use strict';if(i.length<3||!(this.isFixed(i[0])&&this.isStarred(i[1])))return i;var j=this.nextNonStarred(i,2);if(!j)return i;var k=i.concat();c('removeFromArray')(k,j);k.splice(1,0,j);return k;};h.prototype.layout=function(i){'use strict';var j=[0,0],k=0,l=this.getDangling(i),m=[];i=this.mangleOrder(i);for(var n=0;n<i.length;++n){var o=this.getShortestColumn(j),p=i[n];if(this.isStarred(p)){this.renderStarred(this._grid,j,o,p);j[o]+=2;k=Math.max(k,o*2+2);}else{m.push(p);if(m.length===2||p===l){this.renderNonStarred(this._grid,j,o,m);k=Math.max(k,o*2+m.length);m=[];j[o]+=1;}}}return new (c('Vector'))(k,Math.max.apply(null,j));};h.prototype.inNonStarredBlock=function(i,j,k,l){'use strict';return j===k[l]&&Math.floor(i/2)===l;};h.prototype.inStarredBlock=function(i,j,k,l){'use strict';return (j===k[l]||j===k[l]+1)&&Math.floor(i/2)===l;};h.prototype.nextNonStarred=function(i,j){'use strict';for(;j<i.length;++j)if(!this.isStarred(i[j]))return i[j];return null;};h.prototype.layoutReorder=function(i,j,k,l){'use strict';i=i.concat();k=Math.max(0,Math.min(3,k));l=Math.max(0,l);c('removeFromArray')(i,j);i.push(j);var m=[0,0],n=this.getDangling(i),o=false,p=[];for(var q=0;q<i.length;++q){var r=this.getShortestColumn(m),s=i[q];if(this.isStarred(s)){if(s===j)o=true;if(!o&&this.isStarred(j)&&this.inStarredBlock(k,l,m,r)&&this.inNonStarredBlock(k,l,m,r)){c('removeFromArray')(i,j);this.renderStarred(this._grid,m,r,j);m[r]+=2;r=this.getShortestColumn(m);o=true;}if(!o&&!this.isStarred(j)&&this.inStarredBlock(k,l,m,r)&&this.inNonStarredBlock(k,l,m,r)){c('removeFromArray')(i,j);if(p.length===1){p.splice(k%2,0,j);}else{var t=this.nextNonStarred(i,q);if(t){c('removeFromArray')(i,t);p.push(t);p.splice(k%2,0,j);}else p.push(j);}this.renderNonStarred(this._grid,m,r,p);p=[];m[r]+=1;n=this.getDangling(i.slice(q+1));r=this.getShortestColumn(m);o=true;}if(!o&&this.inStarredBlock(k,l,m,r)&&!this.inNonStarredBlock(k,l,m,r)){c('removeFromArray')(i,j);var t=this.nextNonStarred(i,q);i.push(j);if(t){c('removeFromArray')(i,t);i.splice(q,0,t);q--;continue;}l-=1;q--;continue;}this.renderStarred(this._grid,m,r,s);m[r]+=2;}else{p.push(s);if(p.length===2||s===n){if(!o&&!this.isStarred(j)&&this.inNonStarredBlock(k,l,m,r)){c('removeFromArray')(p,j);c('removeFromArray')(i,j);p.splice(k%2,0,j);if(p.length===3){c('removeFromArray')(i,p[2]);i.splice(q,0,p[2]);q=i.indexOf(p[2])-1;p.pop();}n=this.getDangling(i.slice(q+1));o=true;}if(!o&&this.isStarred(j)&&this.inNonStarredBlock(k,l,m,r)){c('removeFromArray')(i,j);this.renderStarred(this._grid,m,r,j);m[r]+=2;r=this.getShortestColumn(m);o=true;}this.renderNonStarred(this._grid,m,r,p);p=[];m[r]+=1;}}}};h.prototype.getStoringLayout=function(i){'use strict';return new h({grid:this._grid,isStarred:this.isStarred,isFixed:this.isFixed,renderStarred:function(j,k,l,m){i.push(m);},renderNonStarred:function(j,k,l,m){i.push(m[0]);if(m.length>1)i.push(m[1]);}});};h.prototype.reorder=function(i,j,k,l){'use strict';var m=[];this.getStoringLayout(m).layoutReorder(i,j,k,l);return m;};h.prototype.canonicalize=function(i){'use strict';var j=[];this.getStoringLayout(j).layout(i);return j;};f.exports=h;},null);
__d('StarGrid',['Arbiter','CSS','DataStore','DOM','Locale','Parent','Style','StarGridLayout','removeFromArray'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={MARGIN:5,isStarred:function(i){return c('CSS').hasClass(i,'fbPhotoStarGridStarred');},isFixed:function(i){return c('CSS').hasClass(i,'fbPhotoStarGridFixed');},setPosition:function(i,j,k){var l=c('Locale').isRTL()?'margin-right':'margin-left';c('Style').set(i,'position','absolute');c('Style').set(i,'margin-top',j+'px');c('Style').set(i,l,k+'px');},renderNonStarred:function(i,j,k,l){for(var m=0;m<l.length;++m){var n=j[k]*h.getSize(i),o=(k*2+m)*h.getSize(i);h.setPosition(l[m],n,o);}},renderStarred:function(i,j,k,l){var m=j[k]*h.getSize(i),n=k*2*h.getSize(i);h.setPosition(l,m,n);},mergeWithPreviousGrid:function(i){var j=i.previousSibling;if(j&&c('CSS').hasClass(j,'fbStarGrid')){c('CSS').addClass(j,'fbStarGridAppendedTo');while(i.firstChild)j.appendChild(i.firstChild);c('DOM').remove(i);i=j;}return i;},addPhotos:function(i){var j=c('DOM').scry(document.body,'.fbStarGrid')[0];if(!j)return;c('DOM').prependContent(j,i);var k=this.getSize(j);this.mergeAndLayoutGrid(j,k);},removeFromGrid:function(i){var j=c('Parent').byClass(i,'fbStarGrid'),k=h.getElements(j);c('removeFromArray')(k,i);c('DOM').remove(i);h.layoutGrid(j,k);c('Arbiter').inform('StarGrid/UPDATE',j);},removePhoto:function(i){var j=c('DOM').scry(document.body,'.fbPhotoStarGridElement[data-fbid="'+i+'"]')[0];this.removeFromGrid(j);},removeUntaggedPhoto:function(i){var j=c('DOM').scry(document.body,'.fbPhotoStarGridElement[data-fbid="'+i+'"]'+'[data-in-photos-of="1"]');if(j.length>0)this.removeFromGrid(j[0]);},removePhotos:function(i){var j,k;for(var l=0;l<i.length;l++){var m=i[l],n=c('DOM').scry(document.body,'.fbPhotoStarGridElement[data-fbid="'+m+'"]')[0];j=c('Parent').byClass(n,'fbStarGrid');k=h.getElements(j);c('removeFromArray')(k,n);c('DOM').remove(n);}h.layoutGrid(j,k);c('Arbiter').inform('StarGrid/UPDATE',j);},layoutGrid:function(i,j){var k=new (c('StarGridLayout'))({_grid:i,isStarred:h.isStarred,isFixed:h.isFixed,renderNonStarred:h.renderNonStarred,renderStarred:h.renderStarred});h.setElements(i,j);var l=k.layout(j);c('Style').set(i,'width',l.x*h.getSize(i)+'px');c('Style').set(i,'height',l.y*h.getSize(i)+'px');},mergeAndLayoutGrid:function(i,j){var k=c('DOM').scry(i,'.fbPhotoStarGridElement'),l=h.mergeWithPreviousGrid(i),m=k;if(i!==l)m=h.getElements(l).concat(k);h.setElements(i,m);c('DataStore').set(i,'size',j);h.layoutGrid(l,m);c('Arbiter').subscribe('PhotosBulkEditablePhoto.MOVED',function(n,o){h.removePhoto(o);}.bind(this));c('Arbiter').inform('StarGrid/UPDATE',i);},getSize:function(i){return c('DataStore').get(i,'size');}};Object.assign(h,{getElements:function(i){var j=c('DataStore').get(i,'elements');if(!j){j=c('DOM').scry(i,'div.fbPhotoStarGridElement');h.setElements(i,j);}return j;},setElements:function(i,j){c('DataStore').set(i,'elements',j);}});f.exports=h;},null);
__d('TagSuggestionsDrawer',['AsyncRequest','PhotosAppSection'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=false,i={init:function(){if(h)return;h=true;c('PhotosAppSection').subscribe('toggle_drawer',i._onToggle);},_onToggle:function(j,k){if(k.button_clicked=='show'){i._notify(false);}else i._notify(true);},_notify:function(j){new (c('AsyncRequest'))('/ajax/medley/tag_suggestions_drawer.php').setData({is_closed:j}).send();}};f.exports=i;},null);