/*1358178753,173217599*/

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

/** js/deprecated/startsWith-legacy.js */
__d("legacy:startsWith",["startsWith"],function(a,b,c,d){



a.startsWith=b('startsWith');},

3);

/** js/comments/comments_admin.js */
























if(!window.CommentAdminPanelController){
window.CommentAdminPanelController=function(a){
copyProperties(this,
{locale:a.locale,
channel:a.channel,
controllerID:a.controllerID,
commentIDs:a.commentIDs,
domIDs:a.domIDs,
duplicateComments:[],
fetchMoreCommentsIsPending:{},
blacklistedActors:a.blacklistedActors,
actorToCommentInfoMap:a.actorToCommentIDMap,
commentInfoMap:a.commentInfoMap,
inAggregatedView:a.inAggregatedView,
inModerationQueue:a.inModerationQueue,
inContextualDialog:a.inContextualDialog,
isTopLevelCommentPollingEnabled:false,
loggedIn:a.loggedIn,
newestCommentTimestamp:a.newestCommentTimestamp,
realTimePollingParams:{},
userOwnsPages:a.userOwnsPages,
recentlyBlacklistedActors:a.blacklistedActors});


Arbiter.subscribe
(ChannelConstants.getArbiterType('comments_plugin_new_post'),
function(b,c){

if(c.obj.target===this.realTimePollingParams.target){
if(ge(c.obj.comment_element_id))

return;


var d=copyProperties({},this.realTimePollingParams);
d.post_fbid=c.obj.post_fbid;

var e=c.obj.parent_comment_id;
if(e){

var f=ge(e);
if(!f)

return;


var g=
DOM.scry(f,'.fbFeedbackPager.uiMorePager');
if(g.length>0)

return;


d.parent_comment_id=e;
d.is_reply_thread=true;}else{


if(!this.isTopLevelCommentPollingEnabled)


return;

d.is_reply_thread=false;}


this.pollForComments(d);}}.

bind(this));


this.controlledRegion=$(this.controllerID);
this.attachClickHandlers();
if(this.inModerationQueue)
this.registerModeratorQueueHandlers(true);


if(this.inContextualDialog)
this.attachContextualDialogHandlers();


if(!this.inAggregatedView)


UnverifiedXD.init
({autoResize:true,
channelUrl:a.channel,
hideOverflow:true,
resizeWidth:false});};




copyProperties(CommentAdminPanelController,
{allControllers:{},
mainController:null,
contextualControllers:{},

initController:function(a){
var b=new CommentAdminPanelController(a),
c=a.controllerID;
CommentAdminPanelController.allControllers[c]=b;
if(b.inContextualDialog){
CommentAdminPanelController.contextualControllers[c]=
b;}else 

CommentAdminPanelController.mainController=b;},



syncController:function(a,b){
var c=CommentAdminPanelController.allControllers[a];
c.attachClickHandlers();
if(!c.isControllingModerationQueue())
return;









c.deselectComments(b);
c.registerModeratorQueueHandlers
(false);
c.synchronizeModeratorQueueUI();},


resetController:function(a){
var b=CommentAdminPanelController.allControllers[a];
b.resetController();},


appendComments:function(a,
b,
c){
var d=CommentAdminPanelController.allControllers[a];
d.appendComments(b,c);},


prependComments:function(a,
b,
c){
var d=CommentAdminPanelController.allControllers[a];
d.prependComments(b,c);},


updateController:function(a,
b,
c,
d,
e,
f,
g){
var h=CommentAdminPanelController.allControllers[a];
h.updateController(b,
c,
d,
e,
f,
g);

if(!CommentAdminPanelController.mainController.loggedIn)
MultiLoginPopup.reattachLoginInterceptors();


if(!h.isControllingModerationQueue())
return;







h.registerModeratorQueueHandlers
(false);
h.synchronizeModeratorQueueUI();},


updatePollingParamsCommentas:function(a,
b){
var c=CommentAdminPanelController.allControllers[a];
c.updatePollingParamsCommentas(b);},


registerMoreCommentsLinkHandler:function(a,b){
var c=CommentAdminPanelController.allControllers[a];
c.registerMoreCommentsLinkHandler(b);},


setRealTimePollingParams:function(a,b){
var c=CommentAdminPanelController.allControllers[a];
c.setRealTimePollingParams(b);},


enableTopLevelCommentPolling:function(a){
var b=CommentAdminPanelController.allControllers[a];
b.enableTopLevelCommentPolling();},


disableTopLevelCommentPolling:function(a){
var b=CommentAdminPanelController.allControllers[a];
b.disableTopLevelCommentPolling();},


replaceContentMaybe:function(a,b){



var c=DOM.scry(document.documentElement,a)[0];
if(c)
DOM.replace(c,b);},



notifyCommentCreated:function(a){
if(!CommentAdminPanelController.mainController.channel)
return;


UnverifiedXD.send
({type:'commentCreated',
href:a.href,
parentCommentID:a.parentCommentID,
commentID:a.commentID});},



notifyCommentRemoved:function(a){
if(!CommentAdminPanelController.mainController.channel)
return;


UnverifiedXD.send
({type:'commentRemoved',
href:a.href,
commentID:a.commentID});},



markAsShowingAllReplies:function(a){
var b=
a+' a.fbUpDownVoteOption',
c=
DOM.scry(document.documentElement,b),

d=
a+' li.fbUpDownVoteOption a.itemAnchor',
e=
DOM.scry(document.documentElement,d),

f=c.concat(e);
for(var g=0;g<f.length;g++){
var h=f[g],
i=new URI(h.getAttribute('ajaxify'));
i.addQueryData({show_all_replies:1});
h.setAttribute('ajaxify',i.toString());}},



setLoggedIn:function(a){
CommentAdminPanelController.mainController.loggedIn=a;}});



copyProperties(CommentAdminPanelController.prototype,

{isControllingModerationQueue:function(){
var a=
this==CommentAdminPanelController.mainController&&
this.inModerationQueue;
return a;},


resetController:function(){
this.commentIDs=[];
this.domIDs=[];},


updateController:function(a,
b,
c,
d,
e,
f){

a.forEach(function(h){
this.commentIDs.push(h);},
this);

b.forEach(function(h){
this.domIDs.push(h);},
this);

copyProperties(this.blacklistedActors,d);
for(var g in e){
if(!this.actorToCommentInfoMap[g])
this.actorToCommentInfoMap[g]=[];


e[g].forEach(function(h){
this.actorToCommentInfoMap[g].push(h);},
this);}


this.newestCommentTimestamp=
Math.max(this.newestCommentTimestamp,c);

copyProperties(this.commentInfoMap,f);
this.attachClickHandlers();},


updatePollingParamsCommentas:function(a){
this.realTimePollingParams.commentas=a;},


attachClickHandlers:function(){
for(var a=0;a<this.domIDs.length;a++){
var b='li[id="'+this.domIDs[a]+'"]',
c=DOM.scry(this.controlledRegion,b);
if(c.length===0)
continue;


var d=c[0],
e=DOM.scry(d,'a.uiCloseButton');
Event.listen(d,
'mouseleave',
this.closeStickyMenuFlyouts.bind(this,e));
var f=DOM.scry(d,
'.fbModerateDropdownContainer');
if(f.length>0){
var g=f[0],
h=DOM.find(g,
'.fbModerateDropdownLink');
Event.listen(h,
'mouseover',
function(q,event){
CSS.addClass(q,'fbUnderlineText');}.
curry(h));
Event.listen(h,
'mouseout',
function(q,event){
CSS.removeClass(q,'fbUnderlineText');}.
curry(h));
var i=DOM.find(g,
'.fbModerationDropdownList');
Event.listen(h,
'click',
this.exposeDropDownMenu.bind(this,
h,
i));
Event.listen(i.parentNode,
'mouseleave',
this.concealDropDownMenu.bind(this,
h,
i));
this.attachDropDownHandlers(d,
this.commentIDs[a],
i);}


var j=this.commentInfoMap[this.commentIDs[a]].actor,
k=
!!this.recentlyBlacklistedActors[j];
if(k){



var l=DOM.scry(d,'.fbUndoBlacklistLink');
if(l.length>0){
var m=l[0];
Event.listen(m,'click',
this.toggleBlackListAndSync.bind(this,
this.commentIDs[a]));}}}




var n=
DOM.scry(this.controlledRegion,'.fbReplyButton'),
o=
DOM.scry(this.controlledRegion,'.fbReplyAfterLoginButton');

for(var p=0;p<n.length;p++)
if(this.loggedIn){
CSS.show(n[p]);
CSS.hide(o[p]);}else{

CSS.hide(n[p]);
CSS.show(o[p]);}},




closeStickyMenuFlyouts:function(a,event){
Toggler.hide();





for(var b=0;b<a.length;b++)
a[b].blur();},



attachDropDownHandlers:function(a,b,c){
var d=DOM.scry(c,'.fbBanUser');
if(d.length>0){
var e=d[0],
f=DOM.find(e,'^.fbFeedbackPost');
if(startsWith(f.id,b))





Event.listen(e,
'click',
this.toggleBlackListAndSync.bind(this,b));}},







exposeDropDownMenu:function(a,b,event){
if(CSS.shown(b))



return this.concealDropDownMenu(a,b,event);


Event.stop(event);
CSS.show(b);
b.focus();
a.blur();
return false;},


concealDropDownMenu:function(a,b,event){
Event.stop(event);
CSS.removeClass(a,'fbUnderlineText');
CSS.hide(b);
a.blur();
return false;},


registerMoreCommentsLinkHandler:function(a){
var b=a.pager_id;
if(!ge(b))
return;


var c=$(b);
Event.listen(c,'click',this.fetchMoreComments.bind(this,
a,
c));},


deselectComments:function(a){
for(var b=0;b<a.length;b++)
delete this.selectedCommentsMap[a[b]];},



registerModeratorQueueHandlers:function(a){
if(a)
this.selectedCommentsMap={};


this.selectableComments=this.findSelectableComments();
this.selectableCheckboxes=[];

this.selectAllCheckBoxes=
DOM.scry(this.controlledRegion,'.fbSelectAllCheckbox');
this.approveButtons=DOM.scry(this.controlledRegion,'.fbApproveButton');
this.removeButtons=DOM.scry(this.controlledRegion,'.fbRemoveButton');

for(var b=0;b<this.selectableComments.length;b++){
var c=this.selectableComments[b].id,
d=!!this.selectedCommentsMap[c];
this.setCommentSelection(this.selectableComments[b],d);
var e=
DOM.find(this.selectableComments[b],'.fbCommentCheckbox');

Event.listen(e,
'click',
this.toggleCommentSelection.bind(this));
Event.listen(this.selectableComments[b],
'click',
this.toggleCommentSelection.bind(this));
e.checked=d;
this.selectableCheckboxes.push(e);}


for(var f=0;f<this.selectAllCheckBoxes.length;f++){
this.selectAllCheckBoxes[f].checked=false;
this.selectAllCheckBoxes[f].disabled=
this.selectableComments.length===0;
Event.listen
(this.selectAllCheckBoxes[f],
'click',
this.toggleSelectAllCheckbox.bind(this,
this.selectAllCheckBoxes[f]));}


for(var g=0;g<this.approveButtons.length;g++)
Event.listen(this.approveButtons[g],
'click',
this.setBulkPrivacy.bind(this,false));


for(var h=0;h<this.removeButtons.length;h++)
Event.listen(this.removeButtons[h],
'click',
this.setBulkPrivacy.bind(this,true));},



findSelectableComments:function(){
var a=
DOM.scry(this.controlledRegion,'.fbTopLevelComment'),
b=[];
for(var c=0;c<a.length;c++)
if((DOM.scry(a[c],
'.fbCommentCheckbox').length===1)&&
(DOM.scry(a[c],
'.fbCommentOverlay').length===0))
b.push(a[c]);



return b;},


toggleCommentSelection:function(event){
var a={a:true},
b=event.getTarget(),
c=b.tagName.toLowerCase(),
d=b.parentNode.tagName.toLowerCase();
if(a[c]||
a[d])

return;


var e=
CSS.hasClass(b,'fbFeedbackPost')?b:
DOM.find(b,'^.fbFeedbackPost'),
f=this.commentIsSelected(e),
g=!f;
this.setCommentSelection(e,g);
this.synchronizeModeratorQueueUI();
if(CSS.hasClass(b,'fbCommentCheckbox'))
Event.stop(event);},






commentIsSelected:function(a){
return CSS.hasClass(a,'fbCommentSelected');},


setCommentSelection:function(a,b){
if(b){
this.selectComment(a);}else 

this.deselectComment(a);},



selectComment:function(a){
CSS.addClass(a,'fbCommentSelected');
this.selectedCommentsMap[a.id]=true;
DOM.find(a,'.fbCommentCheckbox').checked=true;},


deselectComment:function(a){
CSS.removeClass(a,'fbCommentSelected');
delete this.selectedCommentsMap[a.id];
DOM.find(a,'.fbCommentCheckbox').checked=false;},


toggleSelectAllCheckbox:function(a,event){
Event.stop(event);
var b=a.checked;
for(var c=0;c<this.selectableComments.length;c++){
this.setCommentSelection(this.selectableComments[c],
a.checked);
this.selectableCheckboxes[c].checked=b;}


this.synchronizeBulkModerationCheckboxes(b);
this.synchronizeBulkModerationButtons(b);},


synchronizeModeratorQueueUI:function(){
var a=0;
for(var b=0;b<this.selectableCheckboxes.length;b++)
if(this.selectableCheckboxes[b].checked)
a++;



var c=
this.selectableCheckboxes.length>0&&
a==this.selectableCheckboxes.length;
this.synchronizeBulkModerationCheckboxes(c);
this.synchronizeBulkModerationButtons(a>0);},


synchronizeBulkModerationCheckboxes:function(a){
for(var b=0;b<this.selectAllCheckBoxes.length;b++)
this.selectAllCheckBoxes[b].checked=a;},



synchronizeBulkModerationButtons:function(a){
for(var b=0;b<this.approveButtons.length;b++)
Button.setEnabled(this.approveButtons[b],a);


for(var c=0;c<this.removeButtons.length;c++)
Button.setEnabled(this.removeButtons[c],a);},



setBulkPrivacy:function(a,event){
Event.stop(event);

this.synchronizeBulkModerationButtons(false);
selectedCommentIDs=[];
for(var b in this.selectedCommentsMap)
selectedCommentIDs.push(b);


var c=
{is_private:a,
in_moderation_queue:true,
comment_ids:selectedCommentIDs,
uniqids:selectedCommentIDs,
controller_id:this.controllerID,
locale:this.locale,
owns_pages:this.userOwnsPages,
in_aggregated_view:this.inAggregatedView,
in_contextual_dialog:this.inContextualDialog};


new AsyncRequest().
setURI('/ajax/connect/comments/set_bulk_private.php').
setData(c).
send();
return false;},


toggleBlackListAndSync:function(a,event){
Event.stop(event);
var b=this.commentInfoMap[a].actor,
c=
{blacklist:!this.blacklistedActors[b],
in_moderation_queue:this.inModerationQueue,
comment_id:a,
other_comment_ids:this.getOtherCommentsByActor(b,a),
uniqid:a,
controller_id:this.controllerID,
locale:this.locale,
owns_pages:this.userOwnsPages,
in_aggregated_view:this.inAggregatedView,
in_contextual_dialog:this.inContextualDialog};


new AsyncRequest().
setURI('/ajax/connect/comments/set_blacklist.php').
setData(c).
setHandler(function(d){
this.blacklistedActors[b]=!this.blacklistedActors[b];
if(this.blacklistedActors[b]){
this.recentlyBlacklistedActors[b]=true;}else 

delete this.recentlyBlacklistedActors[b];}.

bind(this)).
send();
return false;},


getOtherCommentsByActor:function(a,b){
return this.actorToCommentInfoMap[a].filter
(function(c){return c!=b;});},



fetchMoreComments:function(a,b,event){
Event.kill(event);
CSS.addClass(b,'async_saving');
if(this.fetchMoreCommentsIsPending[a.pager_id]===true)
return;


this.fetchMoreCommentsIsPending[a.pager_id]=true;

var c=
{is_reply_thread:false,
in_moderation_queue:false,
view_as_moderator:false};


copyProperties(c,a);

c.offset=this.getVisibleCommentCount(c);

if(!c.aggregate_view)
delete c.aggregate_view;


if(!c.comment_id)
delete c.comment_id;


if(!c.is_reply_thread)
c.comment_ids=this.commentIDs;


if(!c.commentas){
var d=
CommentAdminPanelController.allControllers[c.controller_id];
c.commentas=d.realTimePollingParams.commentas;}


new AsyncRequest().
setURI('/ajax/connect/feedback.php').
setReadOnly(true).
setData(c).
setHandler(function(e){
this.fetchMoreCommentsIsPending[a.pager_id]=false;}.
bind(this)).
send();},


getVisibleCommentCount:function(a){
var b=this.getCommentsSelector(a),
c=this.getCollapsedCommentsSelector(a),
d=DOM.scry($(a.controller_id),b);
d=
d.concat(DOM.scry($(a.controller_id),c));
var e=0;
for(var f=0;f<d.length;f++)
if(!CSS.hasClass(d[f],'fbCommentIgnored'))
e++;



return e;},


getCommentsSelector:function(a){
var b=
a.is_reply_thread?'li.fbCommentReply':'li.fbTopLevelComment';
if(a.controller_id!=a.uniqid)
b='div[id="'+a.uniqid+'"] '+b;

return b;},


getCollapsedCommentsSelector:function(a){
var b=
a.is_reply_thread?'div.fbCommentReply':'div.fbTopLevelComment';
if(a.controller_id!=a.uniqid)
b='div[id="'+a.uniqid+'"] '+b;

return b;},


getRecentlyBlacklistedActors:function(){
var a=[];
for(var b in this.recentlyBlacklistedActors)
a.push(b);


return a;},


attachContextualDialogHandlers:function(){
this.documentClickListener=
Event.listen(document.documentElement,
'click',
this.closeContextualDialog.bind(this));},


closeContextualDialog:function(event){
var a=event.getTarget(),
b=
Parent.byClass(a,'fbCommentContext');

if(!b)
this.destroyContextualDialog();},



destroyContextualDialog:function(){
this.documentClickListener.remove();
delete this.documentClickListener;
var a=this.controllerID;
Feedback.closeContextualDialog(a);},


setRealTimePollingParams:function(a){
this.realTimePollingParams=a;},


enableTopLevelCommentPolling:function(){
this.isTopLevelCommentPollingEnabled=true;},


disableTopLevelCommentPolling:function(){
this.isTopLevelCommentPollingEnabled=false;},


appendComments:function(a,b){
var c=ge(a);
if(!c)
return;





var d=
DOM.scry(c,'.fbFeedbackReplies')[0];
if(!d)
return;


DOM.appendContent(d,b);},


prependComments:function(a,b){



var c=
DOM.scry(document.documentElement,a)[0];
if(!c)
return;


var d=b.getNodes(),
e=[];
for(var f=d.length;f-->0;){
var g=
{id:DOM.getID(d[f]),
element:d[f]};

e.push(g);

var h=ge(g.id);
if(h){





CSS.hide(g.element);
this.duplicateComments.push(g.element);
for(var i=0;i<e.length;++i)
DOM.insertAfter(h,e[i].element);

e=[];}}



for(f=0;f<e.length;++f)
DOM.prependContent(c,
e[f].element);




setTimeout(this.removeDuplicateComments.bind(this),0);},


removeDuplicateComments:function(){
for(var a=0;a<this.duplicateComments.length;++a)
DOM.remove(this.duplicateComments[a]);

this.duplicateComments=[];},


pollForComments:function(a){
data=
{locale:this.locale};


copyProperties(data,a);

if(!data.is_reply_thread)
data.comment_ids=this.commentIDs;


data.newest_comment_timestamp=this.newestCommentTimestamp;

handler=this.handlePollResponse.bind(this);
errorHandler=this.handlePollError.bind(this);
finallyHandler=this.handlePollFinally.bind(this);

new AsyncRequest().
setURI('/plugins/comments/poll').
setReadOnly(true).
setData(data).
setMethod('GET').
setHandler(handler).
setErrorHandler(errorHandler).
setFinallyHandler(finallyHandler).
send();},


handlePollResponse:function(a){


},

handlePollError:function(a){

},

handlePollFinally:function(a){
}});}

/** js/composerx/attachments/ComposerXAttachmentUtils.js */
__d("ComposerXAttachmentUtils",["CSS","DOMQuery","Focus","Input","PageTransitions","Run","StickyPlaceholderInput","tx"],function(a,b,c,d,e,f){



var g=b('CSS'),
h=b('DOMQuery'),
i=b('Focus'),
j=b('Input'),
k=b('PageTransitions'),
l=b('Run'),
m=b('StickyPlaceholderInput'),

n=b('tx'),

o=
{initMentions:function(p,q){
p.instance.setPlaceholder(q);
var r=h.find(p.element,'textarea.input');
i.set(r);},


setStickyPlaceholderForMentions:function(p,q){



if(h.contains(p.element,document.activeElement)&&
g.hasClass(document.activeElement,'DOMControl_placeholder'))
document.activeElement.blur();

p.instance.setPlaceholder(q);},


setStickyPlaceholderForTypeahead:function(p,q){
var r=h.find(p,'.textInput');
m.setPlaceholderText(r,q);},




registerInputForLeaveWarning:function(p){
l.onBeforeUnload(function(){
var q=k.getNextURI();
if(q.getQueryData().hasOwnProperty('theater'))
return;

if(a.Dialog&&a.Dialog.getCurrent())
return;

if(p.offsetParent!==null&&!j.isEmpty(p))
return "You haven't finished your post yet. Do you want to leave without finishing?";});}};





e.exports=o;});

/** js/composerx/attachments/ComposerXBootloadStatusAttachment.js */
__d("ComposerXBootloadStatusAttachment",["Event","function-extensions","Arbiter","Bootloader","Class","ComposerXAttachment","ComposerXController","ComposerXDragDrop","CSS","DOM","DOMQuery","Focus","Parent","PlaceholderListener","URI","copyProperties","csx","cx"],function(a,b,c,d,e,f){



var g=b('Event');
b('function-extensions');

var h=b('Arbiter'),
i=b('Bootloader'),
j=b('Class'),
k=b('ComposerXAttachment'),
l=b('ComposerXController'),
m=b('ComposerXDragDrop'),
n=b('CSS'),
o=b('DOM'),
p=b('DOMQuery'),
q=b('Focus'),
r=b('Parent'),
s=b('PlaceholderListener'),
t=b('URI'),

u=b('copyProperties'),
v=b('csx'),
w=b('cx'),

x={};

function y(z,aa){
this.parent.construct(this);
this._root=z;
this._config=aa;}


j.extend(y,k);

u(y.prototype,
{_attachmentIsActive:false,
_bootloading:false,
_fullVersion:false,
_focusListener:null,

_privacyWidgetTags:null,
_scraper:null,
_dragdrop:null,

attachmentClassName:"_4j",

getRoot:function(){
return this._root;},


initWithComponents:function(z){
x[this._composerID]=this;
this._attachmentIsActive=true;

var aa=p.find
(this.getComponent('maininput').element,'textarea.input');
if(this._fullVersion){
this._fullInitWithComponents();}else
if(!this._bootloading)
if(p.contains(this._root,document.activeElement)){
this._onInitialFocus();}else 

this._focusListener=g.listen
(aa,'focus',this._onInitialFocus.bind(this));





this._dragEnterHandler=h.subscribe('dragenter',function(ba,ca){
if(ca.element==this._root){
var da=
m.filterImages(ca.event.dataTransfer.items);

if(da.length>0){
q.set(aa);}else{


var ea=r.byClass(this._root,'focus_target');
s.expandInput(ea);
if(!this._bootloading&&!this._fullVersion)
this._onInitialFocus();}}}.



bind(this));

this.getComponent('maininput').instance.
setPlaceholder(this._config.mentionsPlaceholder);
if(!z)
q.set(aa);


if(this._config.plus_version){
this._dragdrop=new m
(this._root,
this._composerID,
this._config.targetID);
this._dragdrop.enableURLDropping();}},









_fullInitWithComponents:function(){


i.loadModules
(['ComposerXPrivacyWidgetTags','URLScraper','URI'],
function(z,aa,ba){

this._tagger.init(this);
this._privacyWidgetTags=new z(this);

var ca=p.find
(this.getComponent('maininput').element,'textarea.input');
if(!this._scraper){
this._scraper=new aa(ca);
this._scraper.subscribe('match',function(da,ea){
var fa=this._getScraperEndpoint();
fa.addQueryData
({scrape_url:encodeURIComponent(ea.url)});

l.getAttachment(this._root,fa.toString());}.
bind(this));}

this._scraper.enable();
this._scraper.check();}.
bind(this));},


cleanup:function(){
this._attachmentIsActive=false;
if(this._focusListener){
this._focusListener.remove();
this._focusListener=null;}

if(this._dragdrop){
this._dragdrop.deactivate();
this._dragdrop=null;}

if(this._fullVersion){
this._tagger.cleanup();
this._privacyWidgetTags.destroy();
this._privacyWidgetTags=null;
this._scraper.disable();}

if(this._dragEnterHandler){
this._dragEnterHandler.unsubscribe();
this._dragEnterHandler=null;}},



reset:function(){

var z=
r.byClass(this._root,"child_was_focused");
if(z)
n.removeClass(z,"child_was_focused");


if(this._tagger)
this._tagger.reset();


this.getComponent('maininput').instance.
setPlaceholder(this._config.mentionsPlaceholder);},


canSwitchAway:function(){
return !r.byClass(this._root,'async_saving');},


setBootloadedContent:function(z,aa,ba){
var ca=p.find
(this._root,"._3-6"),
da=p.find
(this._root,"._3-7");
o.setContent(ca,z.tagger_content);
o.setContent(da,z.tagger_icons);
l.addPlaceholders(this._root,this,ba);

this._tagger=aa;
this._fullVersion=true;
if(this._attachmentIsActive){
if(this._focusListener){
this._focusListener.remove();
this._focusListener=null;}

this._fullInitWithComponents();}},



_getScraperEndpoint:function(){
return t('/ajax/composerx/attachment/link/scraper/');},


_onInitialFocus:function(){
l.getEndpoint
(this._root,
'/ajax/composerx/attachment/status/bootload/',
true);
this._bootloading=true;}});



y.setBootloadedContent=
function(z,aa,ba,ca){
var da=x[z];
if(da)
da.setBootloadedContent(aa,ba,ca);};



e.exports=y;});

/** js/composerx/components/ComposerXMentionsInputReset.js */
__d("ComposerXMentionsInputReset",["DOMQuery","Input"],function(a,b,c,d,e,f){



var g=b('DOMQuery'),
h=b('Input');

function i(j){
var k=g.scry(j.element,'textarea.input')[0];
j.instance.reset();
h.reset(k);}


e.exports=i;});

/** js/composerx/components/ComposerXPrivacyWidgetReset.js */
__d("ComposerXPrivacyWidgetReset",["Arbiter"],function(a,b,c,d,e,f){



var g=b('Arbiter');

function h(i){
g.inform('Composer/changedtags',
{withTags:[],
mention:{},
eventTag:false});}



e.exports=h;});

/** js/composerx/components/ComposerXTaggerIconReset.js */
__d("ComposerXTaggerIconReset",["CSS","cx"],function(a,b,c,d,e,f){



var g=b('CSS'),

h=b('cx');

function i(j){
g.removeClass
(j.element,
"_1dsa");
g.removeClass
(j.element,
"_1dsb");
g.removeClass
(j.element,
"_4m");}


e.exports=i;});

/** js/connect_login.js */





ConnectLogin=











{init:function(a){
this.appID=a.appID;
this.addToProfile=a.addToProfile;
this.oneClick=a.oneClick;
this.channelUrl=a.channelUrl;
XD.init(a);},







login:function(a,b,c){
if(this.oneClick&&!b){
this._oneClick(a);}else 

this._openPopup(a,b,c);},






logout:function(){
XD.send({type:'logout'});},








_oneClick:function(a){
new AsyncRequest().
setURI('/ajax/api/tos.php').
setData
({app_id:this.appID,
grant_perm:1}).

setHandler(function(b){
ConnectLogin._refreshLoginStatus();
a&&a();}).

send();},









_openPopup:function(a,b,c){
c=c||{};

var d=WindowComm.makeHandler(function(h){
ConnectLogin._closePopup();
if(ConnectLogin.appID)
ConnectLogin._refreshLoginStatus();

a&&a();}),

e=WindowComm.makeHandler(function(h){
ConnectLogin._closePopup();}),

f=new URI('/login.php');

f.setQueryData
({api_key:this.appID,
next:d,
channel_url:e,
cancel_url:e,
req_perms:b,
v:'1.0',
fbconnect:1,
add_to_profile:this.addToProfile,
display:'popup'});

f.addQueryData(c);

var g=this._getSize(c);
this._popup=PopupResizer.open(f.toString(),g.height,g.width);},





_closePopup:function(){
if(this._popup){
this._popup.close();
this._popup=null;}},






_refreshLoginStatus:function(){
if(this.channelUrl){
XD.send({type:'refreshLoginStatus'});}else 

window.location.reload();},







_getSize:function(a){
if(a.social_plugin=='registration'){
return {width:640,height:370};}else 

return {width:610,height:280};}};

/** js/ui/xhp/form/mentions/MentionsInputMatchers.js */
__d("MentionsInputMatchers",[],function(a,b,c,d,e,f){




var g=['@','\\uff20','+','\\uff0b'].join(''),

h='.,*?$|#{}()\\^\\-\\[\\]\\\\\/!%&\'"~=<>_:;',
i='\\b[A-Z][^ A-Z'+h+']',




j='([^'+g+h+']|['+h+'][^ '+h+'])',


k='(?:^|\\s)(?:['+g+']('+j+'{0,20}))',


l='(?:(?:'+i+'+)|'+k+')',


m='(?:'+i+'{4,})',

n=
{trigger:new RegExp('['+g+']$'),
mainMatcher:new RegExp(k+'$'),
autoMatcher:new RegExp(l+'$'),
userMatcher:new RegExp(m+'$')};


e.exports=n;});

/** js/ui/xhp/form/mentions/MentionsInput.js */
__d("MentionsInput",["Event","function-extensions","Arbiter","ArbiterMixin","CSS","DataStore","DOM","HTML","Input","InputSelection","Parent","htmlize","Style","TypeaheadUtil","UserAgent","copyProperties","MentionsInputMatchers"],function(a,b,c,d,e,f){




var g=b('Event');
b('function-extensions');

var h=b('Arbiter'),
i=b('ArbiterMixin'),
j=b('CSS'),
k=b('DataStore'),
l=b('DOM'),
m=b('HTML'),
n=b('Input'),
o=b('InputSelection'),
p=b('Parent'),
q=b('htmlize'),
r=b('Style'),
s=b('TypeaheadUtil'),
t=b('UserAgent'),

u=b('copyProperties'),

v=b('MentionsInputMatchers');

function w
(x,y,z,aa,ba,ca){
k.set(x,'MentionsInput',this);
this._root=x;
this._typeahead=y;




this._input=z;

var da=false;



try{da=document.activeElement===this._input;}catch(
ea){}

var fa=this.init.bind(this,aa,ba,ca);
if(da){
fa.defer();}else 

var ga=g.listen(this._input,'focus',function(){
fa.defer();
ga.remove();});}




w.getInstance=function(x){
var y=p.byClass(x,'uiMentionsInput');
return y?k.get(y,'MentionsInput'):null;};


u(w.prototype,i,

{init:function(x,y,z){
if(this._initialized)
return;

this._initialized=true;

this._highlighter=l.find(this._root,'.highlighter');
this._highlighterInner=this._highlighter.firstChild;
this._highlighterContent=l.find(this._root,'.highlighterContent');
this._hiddenInput=l.find(this._root,'.mentionsHidden');
this._placeholder=this._input.getAttribute('placeholder')||'';
this._maxMentions=x.max||6;
this._metrics=z;


if(t.firefox()<4){
this._input.blur();
setTimeout(function(){this._input.focus();}.bind(this));}





if(!this._hiddenInput.name){
var aa=this._input.name;
this._input.name=aa+'_text';
this._hiddenInput.name=aa;}

this._initEvents();
this._initTypeahead();
this.reset(y);

this.inform('init',null,h.BEHAVIOR_STATE);},


reset:function(x){
if(!this._initialized)
return;

this._mentioned={};
this._orderedUIDs=[];
this._numMentioned=0;
this._filterData=null;
this._hiddenInput&&(this._hiddenInput.value='');
this._highlighterContent&&l.empty(this._highlighterContent);
this._highlighterAuxContent&&l.remove(this._highlighterAuxContent);
this._highlighterAuxContent=null;
n.setPlaceholder(this._input,this._placeholder);
r.set(this._typeahead.getElement(),'height','auto');

if(x){
n.setValue(this._input,x.flattened);
for(var y in x.mention_data)
this._addToken
({uid:y,
text:x.mention_data[y],
type:'unknown'});}




this._updateTypeahead();
this._updateWidth();
this._update();},


getValue:function(){
return n.getValue(this._input);},


getRawValue:function(){
this._update();
return n.getValue(this._hiddenInput);},


checkValue:function(){
var x=this._typeahead.getCore().getValue();
if(v.trigger.exec(x)||x==='')
this.inform('sessionEnd',{});},



getTypeahead:function(){
return this._typeahead;},


_initEvents:function(){
var x=this._update.bind(this);
g.listen(this._input,
{input:x,
keyup:x,
change:x,
blur:this._handleBlur.bind(this),
focus:this._handleFocus.bind(this)});


if(this._metrics){
this._metrics._reset();
this._metrics.bindSessionStart(this._typeahead,'render',true);
this._metrics.bindSessionEnd(this._typeahead.getView(),'select',true);
this._metrics.bindSessionEnd(this,'sessionEnd',false);
g.listen(this._input,'keyup',function(event){
this.checkValue.bind(this).defer();}.
bind(this));}},



_initTypeahead:function(){
this._typeahead.subscribe('select',function(ba,ca){
var da=ca.selected;
this._addToken
({uid:da.uid,
text:da.text,
type:da.type,
weakreference:da.weak_reference});

this.updateValue();}.
bind(this));


var x=this._input,
y=null,
z=function(){
if(y===null){
y=n.getSubmitOnEnter(x);
n.setSubmitOnEnter(x,false);}},


aa=function(){
if(y!==null){
n.setSubmitOnEnter(x,y);
y=null;}};


this._typeahead.subscribe('render',z);
this._typeahead.subscribe('reset',aa);
this._typeahead.subscribe('highlight',function(ba,ca){
ca.index>=0?z():aa();});

this._typeahead.subscribe('query',function(){
this._filterData=null;}.
bind(this));

this._typeahead.getCore().suffix='';
this._handleFocus();},


_handleBlur:function(){
if(this._filterToken){
this._filterToken.remove();
this._filterToken=null;}},



_handleFocus:function(){
if(!this._filterToken)
this._filterToken=
this._typeahead.getData().addFilter(this._filterResults.bind(this));

this._updateWidth();},


_filterResults:function(x){
if(this._filterData===null){
var y=o.get(this._input).start||0;
for(var z=0;z<this._offsets.length;z++){
var aa=this._offsets[z];
if(y>aa[0]&&y<=aa[1]){
this._filterData={caretIsInsideMention:true};
return false;}}



var ba=this._typeahead.getCore();
this._filterData=
{value:ba.getValue(),
rawValue:ba.getRawValue()};}




if(this._filterData.caretIsInsideMention)
return false;



if(v.mainMatcher.test(this._filterData.rawValue))
return true;




if(x.type!='user')
return false;




if(v.userMatcher.test(this._filterData.value))
return true;




return s.isExactMatch
(this._filterData.value,
this._typeahead.getData().getTextToIndex(x));},





_addToken:function(x){
var y=x.uid;
if(!this._mentioned.hasOwnProperty(y)){
this._mentioned[y]=x;
this._orderedUIDs.push(y);
this._numMentioned++;
this._updateTypeahead();}},



_removeToken:function(x){
if(this._mentioned.hasOwnProperty(x)){
delete this._mentioned[x];
this._orderedUIDs.remove(x);
this._numMentioned--;
this._updateTypeahead();}},



_reduceToken:function(x,y){
var z=y.split(' '),
aa=[];

for(var ba=0;ba<z.length;ba++)
if(x.indexOf(z[ba])!=-1)
aa.push(z[ba]);


z=aa;


for(ba=1;ba<z.length;ba++)
for(var ca=1;ca<z[ba-1].length+1;ca++)
if(x.indexOf(z[ba-1].substr(0,ca)+z[ba])!=-1)
z.splice(ba-1,1);





while(x.indexOf(z.join(' '))==-1)
z.splice(0,1);


return z.join(' ');},


_update:function(){
var x=this.getValue();
if(x==this._value)return;


this._updateTokens();
this.updateValue();
this._updateDirection();},


_updateTokens:function(){
var x=this.getValue(),
y=false;
for(var z=0;z<this._orderedUIDs.length;++z){
var aa=this._orderedUIDs[z],
ba=this._mentioned[aa],
ca=ba.text,
da;

if(ba.type=='user'&&
(da=this._reduceToken(x,ca))!==''){










if(da==ca.substring(0,ca.lastIndexOf(' '))&&
x==this._value.substring(0,this._value.length-1)){
x=x.substring(0,x.lastIndexOf(' '));
y=true;}


ba.text=da;}else

if(!ca||
x.indexOf(ca)==-1||
typeof ca!=='string')
this._removeToken(aa);}



this._value=x;
if(y)

n.setValue(this._input,x);},



updateValue:function(){
var x=this.getValue(),
y=this._orderedUIDs,
z=[],
aa,ba,ca,da;





for(da=0;da<y.length;++da){
ba=this._mentioned[y[da]].text;
x=x.replace(ba,function(fa,ga){
z.push([ga,ga+ba.length]);
return ba;});}





for(da=0;da<y.length;++da){
ca=y[da];
ba=this._mentioned[ca].text;
x=x.replace(ba,'@['+ca+':]');}




aa=q(x);
for(da=0;da<y.length;++da){
ca=y[da];
ba=this._mentioned[ca].text;
var ea=this._mentioned[ca].weakreference?
'<b class="weak">':'<b>';
aa=aa.replace('@['+ca+':]',ea+q(ba)+'</b>');
ba=ba.replace(/[\\\]:]/g,function(fa){return '\\'+fa;});
x=x.replace('@['+ca+':]','@['+ca+':'+ba+']');}


if(t.ie()){

aa=aa.replace(/ {2}/g,'&nbsp;<wbr />&nbsp;<wbr />');




aa=aa.replace(/ (?=[^\/]|\/[^>])/g,'&nbsp;<wbr />');}


this._offsets=z;
this._hiddenInput.value=x;
l.setContent(this._highlighterContent,m(aa));

this._updateHighlighter();
this._updateHeight();},


_updateDirection:function(){
var x=r.get(this._input,'direction');
if(x==this._dir)return;
this._dir=x;
r.set(this._highlighter,'direction',x);
if(x=='rtl'){
r.set(this._highlighter,'text-align','right');}else 

r.set(this._highlighter,'text-align','left');},



_updateWidth:function(){


var x=r.getFloat.curry(this._input),
y=this._input.offsetWidth-
x('paddingLeft')-
x('paddingRight')-
x('borderLeftWidth')-
x('borderRightWidth');

if(t.firefox())



y-=2;


if(t.ie()<=7){



y-=r.getFloat(this._highlighterInner,'paddingLeft');



this._highlighter.style.zoom=1;}

this._highlighterInner.style.width=Math.max(y,0)+'px';},


_updateHeight:function(){



if(this._highlighterAuxContent){
var x=this._highlighter.offsetHeight,
y=this._typeahead.getElement();
if(x>y.offsetHeight){
r.set(y,'height',x+'px');
h.inform('reflow');}}},




_updateTypeahead:function(){
var x=this._typeahead.getCore(),
y=null;
if(!this._maxMentions||this._numMentioned<this._maxMentions)
y=v.autoMatcher;

x.matcher=y;
x.setExclusions(this._orderedUIDs);
this.inform('update',{mentioned:this._mentioned});},


setPlaceholder:function(x){
this._placeholder=x;



if(!this.hasAuxContent())
n.setPlaceholder(this._input,x);},








_updateHighlighter:function(){
if(this._highlighterContent)
j.conditionShow
(this._highlighterContent,
this._numMentioned>0||this.hasAuxContent());},














setAuxContent:function(x){
if(this._highlighterContent){
if(!this._highlighterAuxContent){
this._highlighterAuxContent=l.create('span',
{className:'highlighterAuxContent'});

l.insertAfter(this._highlighterContent,this._highlighterAuxContent);}

l.setContent(this._highlighterAuxContent,x);
if(x){
n.setPlaceholder(this._input,'');}else 

n.setPlaceholder(this._input,this._placeholder);

this._updateHighlighter();
this._updateHeight();}},



hasAuxContent:function(){
var x=this.getAuxContentRoot();
return x&&x.innerHTML.length>0;},


getAuxContentRoot:function(){
return this._highlighterAuxContent;},






addMention:function(x){
var y=this.getValue();
n.setValue(this._input,y+" "+x.text);
this._addToken(x);
this._update();},


getMentions:function(){
return this._mentioned;}});




e.exports=w;});

/** js/ui/xhp/form/mentions/mentions-input.js */
__d("legacy:MentionsInput",["MentionsInput"],function(a,b,c,d){



a.MentionsInput=b('MentionsInput');},

3);

/** js/connect_widget/feedback.js */















add_properties('Feedback',
{registerComment:function(a,b){
Feedback.comments[a]=b;
return Feedback;},


getRegisteredComment:function(a){
return Feedback.comments[a];},





deleteClickHandler:function(a,
b,
c,
d,
e,
f){
var g=new Dialog().
setTitle("Delete post?").
setBody("Are you sure you want to delete this post?").
setButtons([Dialog.newButton('delete',"Delete"),
Dialog.CANCEL]).
setHandler(function(event){
new AsyncRequest().
setURI('/ajax/connect/feedback.php').
setData
({command:'delete',
url:a,
uniqid:d,
owns_pages:e,
controller_id:c,
locale:f,
comment_id:b}).

send();}.
bind(this)).
show();},


resizeCommentas:function(a){



var b=DOM.scry(a,'div.post')[0];
if(b){
var c=Vector2.getElementDimensions(b).x;
if(c){
var d=DOM.find(b,'.commentas'),
e=Vector2.getElementDimensions(d).x;
if((c-e)<190&&
(c-190)>60){

Style.set(d,
'width',
c-190+'px');

var f=DOM.scry(d,'span.commentas_inner')[0];
if(f){
var g=Vector2.getElementDimensions(f).x;
Style.set(d,'width',g+'px');}}}}},






exposeContextualDialogReply:function(a){
var b=$(a),
c=b.parentNode.parentNode;
CSS.show(DOM.find(c,"form"));
DOM.find(c,"textarea").focus();
return false;},


concealContextualDialogReply:function(a){
var b=$(a),
c=b.parentNode.parentNode,
d=DOM.find(c,"form"),
e=DOM.find(c,"textarea"),
f=e.value.length;
if(!Input.getValue(e))
CSS.hide(d);


return false;},


closeContextualDialog:function(a){
var b=ContextualDialogX.getInstance($(a));
b.hide();
return false;},


_clickLocked:false,
attachOptInClickListener:function(a){
Event.listen(a,'click',
function(b){
Event.kill(b);
if(!this._clickLocked){
this._clickLocked=true;
setTimeout(function(){
this._clickLocked=false;}.
bind(this),1000);
PlatformOptInPopup.open('feedback','plugin.optin');}});},







attachReplyListener:function(a){
if(!a)
return;


var b=DOM.find(a,'textarea');


a.suppressBlur=false;
Event.listen(a,'click',
function(c){
var d=c.getTarget(),
e=
Parent.byClass(d,'commentas')!==null,
f=
Parent.byClass(d,'uiButton')!==null,
g=
Parent.byClass(d,'uiSelector')!==null;
a.suppressBlur=
e||f||g;});


Event.listen(b,'blur',
function(c,d){
if(a.interval)
return;


a.interval=setInterval
((function(e,f){
if(e.suppressBlur||
Input.getValue(f)||
f==document.activeElement)
return;


CSS.hide(e);
e.suppressBlur=false;
clearInterval(e.interval);
delete e.interval;}).
curry(a,c),100);}.
curry(b));},





attachReplyClickListener:function(a,b,c){
if(!a)
return;


var d=DOM.find(a,'textarea');

Event.listen(b,'click',
function(e){
CSS.show(a);
d.focus();

if(!c.isViewer&&c.isReply){
var f=MentionsInput.getInstance(d);
if(f){
var g=f.getMentions();
if(!g[c.uid]&&Input.getValue(d)===''){
f.addMention(c);
Input.setValue(d,Input.getValue(d)+' ');}}else 




Input.setValue(d,c.text+' ');}



e.preventDefault();});},







resetInput:function(a){
var b=MentionsInput.getInstance(a);
if(b){
b.reset({flattened:'',mention_data:{}});}else 

Input.setValue(a,'');}});




if(!window.Feedback.comments)
window.Feedback.comments={};

/** js/deprecated/coalesce.js */
__d("legacy:coalesce",["coalesce"],function(a,b,c,d){



a.coalesce=b('coalesce');},

3);

/** js/lib/dom/controls/text_area.js */
__d("legacy:control-textarea",["TextAreaControl"],function(a,b,c,d){



a.TextAreaControl=b('TextAreaControl');},

3);

/** js/modules/ErrorDialog.js */
__d("ErrorDialog",["Dialog","emptyFunction"],function(a,b,c,d,e,f){



var g=b('Dialog'),

h=b('emptyFunction'),
















i=





{showAsyncError:function(j){

try{return i.show
(j.getErrorSummary(),
j.getErrorDescription());}catch(

k){
alert(j);}},









show:function(j,k,l,m){
return (new g()).
setTitle(j).
setBody(k).
setButtons([g.OK]).
setStackable(true).
setModal(true).
setHandler(l||h).
setButtonsMessage(m||'').
show();}};



e.exports=i;});

/** js/lib/ui/error_dialog.js */
__d("legacy:error-dialog",["ErrorDialog"],function(a,b,c,d){



var e=b('ErrorDialog');
a.ErrorDialog=e;},

3);

/** js/listeners/forms/RequiredFormListener.js */
__d("RequiredFormListener",["Event","Input"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('Input');

g.listen(document.documentElement,'submit',function(i){
var j=i.getTarget().getElementsByTagName('*');
for(var k=0;k<j.length;k++)
if(j[k].getAttribute('required')&&
h.isEmpty(j[k])){
j[k].focus();
return false;}},


g.Priority.URGENT);});

/** js/modules/DynamicIconSelector.js */
__d("DynamicIconSelector",["Button","CSS","DOM","Selector"],function(a,b,c,d,e,f){



var g=b('Button'),
h=b('CSS'),
i=b('DOM'),
j=b('Selector'),





k=
{swapIcon:function(l){
var m=j.getSelectedOptions(l)[0],
n=m&&i.scry(m,'.itemIcon')[0],
o=j.getSelectorButton(l);
if(n){
g.setIcon(o,n.cloneNode(true));}else{

var p=i.scry(o,'.img')[0];
p&&i.remove(p);}

h.conditionClass(o,'uiSelectorChevronOnly',!n);}};



j.subscribe('change',function(l,m){
var n=m.selector;
if(h.hasClass(n,'dynamicIconSelector'))
k.swapIcon(n);});



e.exports=k;});

/** js/modules/PrivacyConst.js */
__d("PrivacyConst",[],function(a,b,c,d,e,f){












var g=
{FRIENDS_PLUS_GAMER_FRIENDS:128,
FRIENDS_MINUS_ACQUAINTANCES:127,
FACEBOOK_EMPLOYEES:112,
CUSTOM:111,
EVERYONE:80,
NETWORKS_FRIENDS_OF_FRIENDS:60,
NETWORKS_FRIENDS:55,
FRIENDS_OF_FRIENDS:50,
ALL_FRIENDS:40,
SELF:10,
NOBODY:0},


h=
{EVERYONE:80,
NETWORKS_FRIENDS:55,



FRIENDS_OF_FRIENDS:50,
ALL_FRIENDS:40,
SOME_FRIENDS:30,
SELF:10,
NO_FRIENDS:0},


i=
{BaseValue:g,
FriendsValue:h};


e.exports=i;});

/** js/modules/AudienceSelector.js */
__d("AudienceSelector",["Arbiter","CSS","DOM","DynamicIconSelector","PrivacyConst","Selector"],function(a,b,c,d,e,f){




var g=b('Arbiter'),
h=b('CSS'),
i=b('DOM'),
j=b('DynamicIconSelector'),
k=b('PrivacyConst'),
l=b('Selector'),



m={};







l.subscribe('select',function(p,q){
if(!h.hasClass(q.selector,'audienceSelector'))
return;


var r=l.getOptionValue(q.option);
g.inform('AudienceSelector/changed',q);



if(r==k.BaseValue.CUSTOM&&
!h.hasClass(q.option,'noDialog')){
l.toggle(q.selector);
return false;}


if(h.hasClass(q.selector,'dataTooltip')){
var s=i.find(q.option,'.itemAnchor').
getAttribute('data-tooltip');

l.setButtonTooltip
(q.selector,
s||null);}



if(!h.hasClass(q.option,'specialOption'))
return;


var t=i.find(q.option,'a').getAttribute('data-type');
if(h.hasClass(q.option,'moreOption')){



h.addClass(q.selector,t);
h.addClass(q.selector,'showSecondaryOptions');
return false;}else
if(h.hasClass(q.option,'returnOption')){


h.removeClass(q.selector,'showSecondaryOptions');
h.removeClass(q.selector,'friendList');
return false;}});



var n={},

o=

{hasTags:function(p){
return n.hasOwnProperty(p);},



keepSynchronized:function(p,q){
m[p]||(m[p]={});
m[p][q.id]=q;},


setHasTags:function(p){
if(!p)
return;


n[p]=true;}};



g.subscribe('CustomPrivacyOption/update',function(p,q){
if(!h.hasClass(q.selector,'audienceSelector'))
return;


l.setSelected(q.selector,l.getOptionValue(q.option));
j.swapIcon(q.selector);
l.setButtonTooltip(q.selector,q.tooltip);

g.inform('AudienceSelector/update',q);});


g.subscribe
(['AudienceSelector/changed','AudienceSelector/update'],
function(event,p){
var q=l.getOptionValue(p.option);
if(q==k.BaseValue.CUSTOM&&
event=='AudienceSelector/changed')

return;




for(var r in m){
var s=m[r];
if(s[p.selector.id])
for(var t in s){
var u=s[t];
if(u&&
p.selector!==u&&
l.getValue(u)!==q){
l.setSelected(u,q);
j.swapIcon(u);}}}});








e.exports=o;});

/** js/modules/CustomPrivacyOption.js */
__d("CustomPrivacyOption",["Event","Arbiter","AsyncDialog","AsyncRequest","DOM","Form","Parent","PrivacyConst","Selector","copyProperties"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('Arbiter'),
i=b('AsyncDialog'),
j=b('AsyncRequest'),
k=b('DOM'),
l=b('Form'),
m=b('Parent'),
n=b('PrivacyConst'),
o=b('Selector'),

p=b('copyProperties');


















function q(r,s,t,
u,v,w,x,y){
if(!r)
return;





(function(){
this.initCustomState(r,s,t);

g.listen(r,'click',function(event){
this.openCustomDialog(event,s,
u,w,x,y);}.
bind(this));

this._initSelector(r,v);}).
bind(this).defer();}


p(q,
{_instances:{},
update:function(r,s,t,u){
var v=q._instances[r];

v.
_update(s,t).
_updateOption(t,u);

h.inform('Form/change',{node:v._container});},


getData:function(r){
return q._instances[r]._privacyData;}});



p(q.prototype,
{_initSelector:function(r,s){
this._selector=m.byClass(r,'uiSelector');



o.listen(this._selector,'select',function(t){
if(t.option._id!=this._id)
this.clearCustomState();}.

bind(this));



if(s)
o.setButtonTooltip(this._selector,s);},







_updateOption:function(r,s){


var t=
o.getOption(this._selector,r)||
o.getOption(this._selector,n.BaseValue.CUSTOM+'');

h.inform
('CustomPrivacyOption/update',

{selector:this._selector,
option:t,
tooltip:s});


return this;},


_update:function(r,s){
var t=
s==n.BaseValue.CUSTOM||
!o.getOption(this._selector,s),
u=this._selector.getAttribute('data-name');

this.updateCustomState(r,t,u);
return this;},









initCustomState:function(r,s,t){
q._instances[s]=this;
this._container=k.find(r,'.customPrivacyInputs');
this._id=t;
this._privacyData={};


var u=l.serialize(this._container);
if(u.audience)
this._privacyData=u.audience[t];


return r;},






openCustomDialog:function(event,r,
s,t,u,v){

var w=new j('/ajax/privacy/custom_dialog/').
setData
({option_id:r,
id:this._id,
privacy_data:this._privacyData,
explain_tags:s,
autosave:t,
limit_to_friends:u,
source:v});

w.setRelativeTo(event.getTarget());

i.send(w);},














updateCustomState:function(r,s,t){
this.clearCustomState();
this._privacyData=p({},r);


if(s)



if(t){
t=t.slice(0,-'[value]'.length);

var u={};
u[t]=r;
l.createHiddenInputs(u,this._container,null,true);}},










clearCustomState:function(){
this._privacyData={};
k.empty(this._container);}});



e.exports=q;});

/** js/modules/ComposerAudienceSelector.js */
__d("ComposerAudienceSelector",["DynamicIconSelector","CustomPrivacyOption","PrivacyConst","Selector"],function(a,b,c,d,e,f){



b('DynamicIconSelector');

var g=b('CustomPrivacyOption'),
h=b('PrivacyConst'),
i=b('Selector'),

j={},
k={},

l=

{syncSelector:function(m){
j[m]&&i.setSelected(m,j[m]);

if(j[m]==h.BaseValue.CUSTOM&&
k[m]){
var n=i.getOption
(m,
h.BaseValue.CUSTOM+''),
o=k[m];


(function(){
g.update
(n.id,
o.data,
o.audience,
o.tooltip);}).
defer();}}};




e.exports=l;});

/** js/openid/protocol.js */



















































function OpenIDRequest(){
var a=new AsyncRequest().
setReadOnly(true).
setHandler(this.asyncResponseHandler.bind(this)).
setErrorHandler(this.asyncErrorHandler.bind(this));
copyProperties(this,
{openidUrl:null,
requestId:OpenIDRequest.maxRequestId++,
successResponseHandler:null,
cancelHandler:null,
intermediateHandler:null,
immediateMode:false,
useExtensions:true,
thirdPartyLogin:false,
popupWindow:null,
asyncRequest:a,
retryCount:0});


OpenIDRequest.requests[this.requestId]=this;}



















OpenIDRequest.getRequestById=function(a){
return OpenIDRequest.requests[a];};





OpenIDRequest.prototype.setOpenIDUrl=function(a){
this.openidUrl=a;
return this;};










OpenIDRequest.prototype.setSuccessHandler=function(a){
this.successResponseHandler=a;
return this;};











OpenIDRequest.prototype.setErrorHandler=function(a){
this.errorHandler=a;
return this;};









OpenIDRequest.prototype.setCancelHandler=function(a){
this.cancelHandler=a;
return this;};








OpenIDRequest.prototype.setImmediateMode=function(a){
this.immediateMode=a;
return this;};






OpenIDRequest.prototype.setUseExtensions=function(a){
this.useExtensions=a;
return this;};











OpenIDRequest.prototype.setIntermediateHandler=function(a){
this.intermediateHandler=a;
return this;};







OpenIDRequest.prototype.setThirdPartyLogin=function(a){
this.thirdPartyLogin=a;
return this;};







OpenIDRequest.prototype.send=function(){

if(!this.openidUrl)
throw "openidUrl is a required parameter. Call setOpenIDUrl()";


uri=this.calculateRedirectUrl();

if(!uri){
this.logMetrics('redirectUrlNotFound');
return;}


if(this.immediateMode){
this.createHiddenIframe(uri);}else{

if(this.popupWindow)
throw "OpenID popup is already in progress";

this.showPopup(uri);}


this.logMetrics('requestSent');};









OpenIDRequest.prototype.calculateRedirectUrl=function(a){
var b=this.immediateMode?'checkid_immediate':'checkid_setup',

c={'openid.mode':b},

d;
if(!OpenIDRequest.cache[this.openidUrl])



return null;


d=OpenIDRequest.cache[this.openidUrl].url;




var e=URI(URI(d).getQueryData()['openid.return_to']);


e.addQueryData({context:OpenIDRequest.context,
request_id:this.requestId});


c['openid.return_to']=e.toString();

c.third_party_login=this.thirdPartyLogin;

return URI(d).addQueryData(c).getQualifiedURI();};





OpenIDRequest.prototype.createHiddenIframe=function(a){

var b='openid_request_'+this.requestId,
c=document.body.appendChild(document.createElement('div')),


d=function(){
c.innerHTML=
('<iframe name="'+b+'"'+
' src="'+a.toString()+'"'+
' scrolling="no" '+
' frameborder="0" class="hidden_elem"></iframe>');};









if(ua.ie()){
c.innerHTML='<iframe src="javascript:false"></iframe>';
d.defer();}else 

d();};







OpenIDRequest.prototype.showPopup=function(a){
if(OpenIDRequest.cache[this.openidUrl])
popupDimensions=OpenIDRequest.cache[this.openidUrl].popup_dimensions;



if(typeof(popupDimensions)=="undefined"||
!popupDimensions||
!popupDimensions.height||
!popupDimensions.width)
popupDimensions={height:'580',
width:'790'};



var b=
{x:coalesce(window.screenX,window.screenLeft),
y:coalesce(window.screenY,window.screenTop),
width:coalesce(window.outerWidth,document.body.clientWidth),
height:coalesce(window.outerHeight,document.body.clientHeight)},

c=b.x+((b.width-popupDimensions.width)/2),
d=b.y+((b.height-popupDimensions.height)/2),

e=["location=yes",
"scrollbars=1",
"left="+c,
"top="+d,
"resizable=yes",
"height="+popupDimensions.height,
"width="+popupDimensions.width].
join(",");

this.popupWindow=window.open(a.toString(),
'_blank',
e);


this.popupPollInterval=setInterval(this.pollPopupWindow.bind(this),100);

this.popupWindow.focus();};






OpenIDRequest.prototype.pollPopupWindow=function(){
if(!(this.popupPollInterval&&
this.popupWindow))
return;


if(this.popupWindow.closed){
clearInterval(this.popupPollInterval);
this.cancel();}};







OpenIDRequest.prototype.closePopupIfOpen=function(){
if(this.popupWindow){
if(this.popupPollInterval)
clearInterval(this.popupPollInterval);

this.popupWindow.close();}

this.popupWindow=null;};











OpenIDRequest.prototype.cancel=function(){
this.closePopupIfOpen();

if(this.cancelHandler)
this.cancelHandler();


this.logMetrics('requestCanceled');};





OpenIDRequest.prototype.logMetrics=function(a){
new AsyncSignal('/ajax/openid/metrics.php',
{metric:a,
immediate:this.immediateMode,
context:OpenIDRequest.context,
openid_url:this.openidUrl}).
send();};










OpenIDRequest.prototype.triggerCompleteAuthAsync=function(a){







if(a.charAt(0)=='?'||
a.charAt(0)=='&')
a=a.substr(1);

var b=URI.explodeQuery(a);



this.closePopupIfOpen();



if(b['openid.mode']=='cancel'){
this.cancel();
return;}




if(this.intermediateHandler)
this.intermediateHandler();



this.asyncRequest.
setData({openid_params:b}).
send();};










OpenIDRequest.prototype.asyncResponseHandler=function(a){
var b=a.getPayload();

if(this.successResponseHandler)
this.successResponseHandler(b);

this.closePopupIfOpen();};







OpenIDRequest.prototype.cleanHandleResponse=function(a){
if(a.css)
a.css=$A(a.css);

this.asyncRequest.handleResponse(a);};









OpenIDRequest.prototype.asyncErrorHandler=function(a){
this.closePopupIfOpen();


if(a.error==1428010||
a.error==1428011){
this.cancel();
return;}


if(this.errorHandler)
this.errorHandler(a);};








OpenIDRequest.prototype.retry=function(){
++this.retryCount;
this.requestId=OpenIDRequest.maxRequestId++;
this.send();};












OpenIDRequest.prototype.setProviderCache=function(a){
OpenIDRequest.cache=a;
return this;};

OpenIDRequest.cache={};

OpenIDRequest.requests=[];
OpenIDRequest.maxRequestId=0;







OpenIDRequest.context='default';

/** js/privacy/audience/AudienceSelector.js */
__d("legacy:AudienceSelector",["AudienceSelector"],function(a,b,c,d){



b('AudienceSelector');},

3);

/** js/privacy/audience/ComposerAudienceSelector.js */
__d("legacy:ComposerAudienceSelector",["ComposerAudienceSelector"],function(a,b,c,d){



a.ComposerAudienceSelector=b('ComposerAudienceSelector');},

3);

/** js/privacy/audience/FriendListPrivacyOptions.js */
__d("FriendListPrivacyOptions",["Arbiter","AsyncDialog","AsyncRequest","Dialog","DOMQuery","PageTransitions","Parent","Selector","$","ge"],function(a,b,c,d,e,f){



var g=b('Arbiter'),
h=b('AsyncDialog'),
i=b('AsyncRequest'),
j=b('Dialog'),
k=b('DOMQuery'),
l=b('PageTransitions'),
m=b('Parent'),
n=b('Selector'),

o=b('$'),
p=b('ge'),

q=false,
r=false,
s=null,
t={},

u=function(w){
if(!Object.keys(t).length)
l.registerHandler(function(){
t={};
q=false;
r=false;});



var x=w.getAttribute('data-name');


t[x]=w;
n.listen(w,'select',function(y){
var z=y.option,
aa=k.find(z,'a.itemAnchor'),
ba=aa.getAttribute('data-flid');
if(!ba)
return;

var ca=aa.getAttribute('data-dynamic');

if(ca&&q){
v.showSmartListNux(z,ba);}else
if(!ca&&r)
v.showDumbListNux([ba]);});},




v=
{listen:function(w,x,y){
var z=p(w);
if(!z)
return;

var aa=m.byClass(z,'audienceSelector');
if(aa){
u(aa);
q=x;
r=y;}},



showSmartListNux:function(w,x){
w=o(w);
new i
('/ajax/friends/lists/smart_list_publish_nux.php').
setData({option_id:w.id,flid:x}).
send();
q=false;},


setContextualDialog:function(w,x){
x=o(x);
var y=m.byClass(x,'audienceSelector');
if(y){
w.setContext(y);
w.show();
var z=g.subscribe('composer/publish',function(){
w.hide();});

w.subscribe('hide',function(){
z.unsubscribe();});}},




showDumbListNux:function(w){
h.send
(new i('/ajax/friends/lists/dumb_list_publish_nux.php').
setData({flids:w}));

r=false;},


showBothListsNux:function(w,x){
s=o(w);
v.showDumbListNux(x);},


setDialogX:function(w){
if(!s)
return;

w.subscribe('hide',function(){
v.showSmartListNux(s);
s=null;});},




setDialog:function(){
if(!s)
return;

var w=j.getCurrent();
if(w)
w.setCloseHandler(function(){
v.showSmartListNux(s);
s=null;});}};





e.exports=v;});

/** js/privacy/audience/OnlyMePrivacyOption.js */
__d("OnlyMePrivacyOption",["Arbiter","copyProperties","CSS","DOM","Env","Parent","PrivacyConst","Selector","tx"],function(a,b,c,d,e,f){



var g=b('Arbiter'),
h=b('copyProperties'),
i=b('CSS'),
j=b('DOM'),
k=b('Env'),
l=b('Parent'),
m=b('PrivacyConst'),
n=b('Selector'),
o=b('tx');

function p(q){
this._selector=l.byClass(q,'composerAudienceSelector');
this._plusLabel=j.scry(q,'.plusLabel')[0];

if(!this._selector)
return;


this._elem=q;
this._taggedIDs=[];
this._tags=[];
this._hasEvent=false;
this._recalculateTooltipAndLabel();
this._updateSelector();


g.subscribe('Composer/changedtags',function(r,s){
var t=this._hasEvent;
this._hasEvent=!!s.eventTag;
this._tags=s.withTags.map(function(v){
return v.getText();});


this._taggedIDs=s.withTags.map(function(v){
return v.getValue();});


for(var u in s.mention)
if(s.mention[u].type=='user'&&
s.mention[u].uid!=k.user){
this._tags.push(s.mention[u].text);
this._taggedIDs.push(s.mention[u].uid);}else

if(s.mention[u].type=='event')
this._hasEvent=true;



if(this._hasEvent&&
t!=this._hasEvent)
this._eventTagChanged();


if(this._recalculateTooltipAndLabel()&&
n.isOptionSelected(this._elem)){
this._updateSelector();
g.inform('SelectedPrivacyOption/changed',
this._getChangedData());}}.

bind(this));

n.listen(this._selector,'change',this._updateSelector.bind(this));}


h(p.prototype,

{_eventTagChanged:function(){
},




_getChangedData:function(){

return {hasEvent:this._hasEvent,
tags:this._taggedIDs,
privacy:m.FriendsValue.SELF};},






_recalculateTooltipAndLabel:function(){
var q=this._tooltip,
r=this._label;

if(this._taggedIDs.length){
this._tooltip="Anyone tagged";
this._label="Only Me"+' (+)';}else{

this._tooltip="Only you";
this._label="Only Me";}


i.conditionShow(this._plusLabel,this._taggedIDs.length);

return (q!=this._tooltip)||(r!=this._label);},








_updateSelector:function(){
if(n.isOptionSelected(this._elem)){
n.setButtonLabel(this._selector,this._label);
n.setButtonTooltip(this._selector,this._tooltip);
return false;}


return true;}});




e.exports=p;});

/** js/privacy/audience/FriendsMinusAcquaintancesPrivacyOption.js */
__d("FriendsMinusAcquaintancesPrivacyOption",["Class","OnlyMePrivacyOption","PrivacyConst","CSS","tx","copyProperties"],function(a,b,c,d,e,f){



var g=b('Class'),
h=b('OnlyMePrivacyOption'),
i=b('PrivacyConst'),
j=i.FriendsValue,
k=b('CSS'),
l=b('tx'),
m=b('copyProperties');

function n(o,p){
this._hasRestricted=p;
this.parent.construct(this,o);}


g.extend
(n,
h);


m(n.prototype,
{_getChangedData:function(){

return {hasEvent:this._hasEvent,
tags:this._taggedIDs,
privacy:j.FRIENDS_MINUS_ACQUAINTANCES};},






_recalculateTooltipAndLabel:function(){

var o=this._hasEvent,
p=this._tags.length,
q=this._tooltip,
r=this._label,
s=this._taggedIDs.length||this._hasEvent;

if(o){
if(p>1){
this._tooltip=this._hasRestricted?
"Your friends, friends of anyone tagged and event guests; Except: Acquaintances, Restricted":
"Your friends, friends of anyone tagged and event guests; Except: Acquaintances";}else
if(p==1){
if(this._hasRestricted){
this._tooltip=l._("Your friends, {user}'s friends and event guests; Except: Acquaintances, Restricted",
{user:this._tags[0]});}else 

this._tooltip=l._("Your friends, {user}'s friends and event guests; Except: Acquaintances",
{user:this._tags[0]});}else 


this._tooltip=this._hasRestricted?
"Your friends and event guests; Except: Acquaintances, Restricted":
"Your friends and event guests; Except: Acquaintances";}else 


this._tooltip=this._hasRestricted?
"Friends except Acquaintances, Restricted":
"Friends except Acquaintances";


k.conditionShow(this._plusLabel,s);

this._label=this._elem.getAttribute('data-label');
if(s)
this._label+=' (+)';


return ((q!=this._tooltip)||(r!=this._label));}});



e.exports=n;});

/** js/privacy/audience/FriendsPrivacyOption.js */
__d("FriendsPrivacyOption",["Arbiter","Class","CSS","OnlyMePrivacyOption","PrivacyConst","Selector","tx"],function(a,b,c,d,e,f){



var g=b('Arbiter'),
h=b('Class'),
i=b('CSS'),
j=b('OnlyMePrivacyOption'),
k=b('PrivacyConst'),
l=b('Selector'),
m=b('tx');

function n(o,p){
this._hasRestricted=p;
this.parent.construct(this,o);}


h.extend(n,j);




n.prototype._getChangedData=function(){
return {hasEvent:this._hasEvent,
tags:this._taggedIDs,
privacy:k.FriendsValue.ALL_FRIENDS};};


n.prototype._eventTagChanged=function(){


var o=this._getChangedData();
o.privacy=l.getValue(this._selector);
g.inform('EventTagged/changed',o);};





n.prototype._recalculateTooltipAndLabel=function(){

var o=this._hasEvent,
p=this._tags.length,
q=this._tooltip,
r=this._label;

if(p>2){
if(o){
this._tooltip=this._hasRestricted?
"Your friends, friends of anyone tagged and event guests; Except: Restricted":
"Your friends, friends of anyone tagged and event guests";}else 

this._tooltip=this._hasRestricted?
"Your friends and friends of anyone tagged; Except: Restricted":
"Your friends and friends of anyone tagged";}else

if(p==2){
if(o){
if(this._hasRestricted){
this._tooltip="Your friends, friends of anyone tagged and event guests; Except: Restricted";}else 

this._tooltip="Your friends, friends of anyone tagged and event guests";}else 


if(this._hasRestricted){
this._tooltip=m._("Your friends, {user}'s friends and {user2}'s friends; Except: Restricted ",
{user:this._tags[0],user2:this._tags[1]});}else 

this._tooltip=m._("Your friends, {user}'s friends and {user2}'s friends",
{user:this._tags[0],user2:this._tags[1]});}else


if(p==1){
if(o){
if(this._hasRestricted){
this._tooltip=
m._("Your friends, {user}'s friends and event guests; Except: Restricted",{user:this._tags[0]});}else 

this._tooltip=m._("Your friends, {user}'s friends and event guests",{user:this._tags[0]});}else 


if(this._hasRestricted){
this._tooltip=m._("Your friends and {user}'s friends; Except: Restricted",{user:this._tags[0]});}else 

this._tooltip=m._("Your friends and {user}'s friends",{user:this._tags[0]});}else 



if(o){
this._tooltip=this._hasRestricted?
"Your friends and event guests; Except: Restricted":
"Your friends and event guests";}else 

this._tooltip=this._hasRestricted?
"Your friends; Except: Restricted":
"Your friends";



i.conditionShow(this._plusLabel,this._tags.length);

this._label=this._elem.getAttribute('data-label');
if(this._tags.length||this._hasEvent)
this._label+=' (+)';

return (q!=this._tooltip)||(r!=this._label);};


e.exports=n;});

/** js/privacy/audience/MetaComposerEdDialog.js */
__d("MetaComposerEdDialog",["Animation","Arbiter","ARIA","AsyncRequest","copyProperties","CSS","DOM","Ease","ge","Parent","Selector","Vector"],function(a,b,c,d,e,f){


var g=b('Animation'),
h=b('Arbiter'),
i=b('ARIA'),
j=b('AsyncRequest'),
k=b('copyProperties'),
l=b('CSS'),
m=b('DOM'),
n=b('Ease'),
o=b('ge'),
p=b('Parent'),
q=b('Selector'),
r=b('Vector'),

s=null;

function t(u){
this._dialog=u.dialog;
this.config=u;
this._init();}


t.init=function(u){
if(s){
s.config.show_audience=u.show_audience;
u.dialog.destroy();
return;}


s=new t(u);};


k(t.prototype,
{_init:function(){
h.subscribe('ComposerXStatusAttachment/ready',
function(){
if(this.config.show_audience){
this._sendEducationRequest
({},
'/ajax/composer/audience/education',
this._handlerCustomDuration.bind(this,6000));





this.config.show_audience=false;}}.

bind(this));



if(this.config.show_sticky)
h.subscribe
('composer/mutate',
function(u,v){
this._sendEducationRequest
({sticky_num:this.config.n_sticky_shown},
'/ajax/composer/audience/sticky_education');}.

bind(this));


if(this.config.show_event_tags)
if(this.config.n_event_tag_shown===0){

h.subscribe
('EventTagged/changed',
function(u,v){
this._sendEducationRequest
({id:"composerTourAudience",
privacy:v.privacy,
event_tag_num:this.config.n_event_tag_shown},
'/ajax/events/tagging/user_education');}.

bind(this));
h.subscribe
(['composer/publish',
'composer/reset'],
function(){
var u=o("event_tagging_tag_expansion_NUX");
u&&l.hide(u);}.
bind(this));}else 

h.subscribe
('EventTagged/changed',
function(u,v){
this._sendEducationRequest
({ids:v.tags,
from:'AtTagger',
hasEvent:v.hasEvent,
type:v.privacy,
tag_num:this.config.n_tag_shown,
event_tag_num:this.config.n_event_tag_shown},
'ajax/composer/audience/tag_education',
this._handler.bind(this));}.

bind(this));




if(this.config.show_tags)
h.subscribe
('SelectedPrivacyOption/changed',
function(u,v){
this._sendEducationRequest
({ids:v.tags,
from:'WithTagger',
hasEvent:v.hasEvent,
type:v.privacy,
tag_num:this.config.n_tag_shown,
event_tag_num:this.config.n_event_tag_shown},
'/ajax/composer/audience/tag_education',
this._handler.bind(this));}.

bind(this));



q.subscribe('open',this._killAnim.bind(this));},


_sendEducationRequest:function(u,v,w){
if(!this._updateDialogContext())
return;

this._async&&this._async.abort();
this._async=new j(v);
this._async.
setData(u).
setHandler(w).
send();},


_updateDialogContext:function(){
var u=m.scry(document.body,'div.composerAudienceWrapper'),
v,w;
for(var x=0;x<u.length;x++){
v=u[x];
w=r.getElementPosition(v);
if(v&&w.x>0&&w.y>0){
this._dialog.setContext(v);
return true;}}


return false;},


_handler:function(u){
this._handlerCustomDuration(1500,u);},


_handlerCustomDuration:function(u,v){
var w=v.payload;
if(!w||!this._updateDialogContext())
return;



var x=this._dialog.getContent().firstChild;
m.setContent(x,w);
i.announce(m.getText(x));

this._dialog.show();


var y=p.byClass(x,'metaComposerUserEd');

if(this._anim){
this._anim.stop();
this._anim=new g(y);}else 

this._anim=new g(y).
from('opacity',0);


this._anim.
to('opacity',1).
ease(n.sineOut).
checkpoint().
duration(u).
checkpoint().
to('opacity',0).
ease(n.sineOut).
checkpoint().
ondone(this._killAnim.bind(this)).
go();},


_killAnim:function(u,v){
if(this._anim){
this._dialog.hide();
this._anim.stop();
this._anim=null;}}});




e.exports=t;});

/** js/ui/xhp/form/mentions/MentionsTypeaheadAreaView.js */
__d("MentionsTypeaheadAreaView",["Class","ContextualTypeaheadView","Parent","copyProperties"],function(a,b,c,d,e,f){



var g=b('Class'),
h=b('ContextualTypeaheadView'),
i=b('Parent'),

j=b('copyProperties');

function k(l,m){
this.parent.construct(this,l,m);}


g.extend(k,h);

j(k.prototype,
{getContext:function(){
return i.byClass(this.element,'uiMentionsInput');}});



e.exports=k;});

/** js/ui/xhp/form/selector.js */
__d("legacy:Selector",["Selector"],function(a,b,c,d){



a.Selector=b('Selector');},

3);

/** js/ui/xhp/typeahead/TypeaheadAreaCore.js */
__d("TypeaheadAreaCore",["Class","InputSelection","TypeaheadCore","copyProperties","emptyFunction"],function(a,b,c,d,e,f){






var g=b('Class'),
h=b('InputSelection'),
i=b('TypeaheadCore'),

j=b('copyProperties'),
k=b('emptyFunction');

function l(m){
this.parent.construct(this,m);
this.matcher=new RegExp(this.matcher+'$');
this.preventFocusChangeOnTab=true;}


g.extend(l,i);

j(l.prototype,

{prefix:'',

suffix:', ',

matcher:"\\b[^,]*",


click:k,

select:function(m){
this.parent.select(m);

var n=this.element.value,
o=this.prefix+m.text+this.suffix;

this.expandBounds(n,o);

var p=n.substring(0,this.start),
q=n.substring(this.end);

this.element.value=p+o+q;
h.set(this.element,p.length+o.length);},







expandBounds:function(m,n){
m=m.toLowerCase().trim();
n=n.toLowerCase();
var o,p,q,r,
s=/\s/;

p=m.substring(this.start,this.end);
q=n.indexOf(p);
o=this.start;

while(o>=0&&q>=0){
r=m.charAt(o-1);
if(!r||s.test(r))
this.start=o;

p=r+p;
q=n.indexOf(p);
o--;}


p=m.substring(this.start,this.end);
q=n.indexOf(p);
o=this.end;

while(o<=m.length&&q>=0){
r=m.charAt(o);
if(!r||s.test(r))
this.end=o;

p=p+r;
q=n.indexOf(p);
o++;}},



getRawValue:function(){
var m=h.get(this.element).start||0;
return this.parent.getValue().substring(0,m);},


getValue:function(){
var m=this.matcher&&this.matcher.exec(this.getRawValue());
if(!m)return '';

var n=m[0],
o=m.index+n.length;

n=n.replace(/^\s/,'');
var p=n.length;
n=n.replace(/\s$/,'');
var q=p-n.length;

this.start=o-p;
this.end=o+q;

return m[1]||m[0];}});




e.exports=l;});

/** js/ui/xhp/typeahead/TypeaheadMetrics.js */
__d("TypeaheadMetrics",["Event","AsyncRequest","copyProperties","emptyFunction"],function(a,b,c,d,e,f){





var g=b('Event'),

h=b('AsyncRequest'),

i=b('copyProperties'),
j=b('emptyFunction');

function k(l){
this.extraData={};
i(this,l);}


i(k.prototype,


{endPoint:'/ajax/typeahead/record_basic_metrics.php',

init:function(l){
this.init=j;
this.core=l.getCore();
this.view=l.getView();
this.data=l.getData();
this.stats={};
this.sessionActive=false;
this._sessionStartEvents=[];
this._sessionEndEvents=[];

this._reset();
this.initEvents();},





_reset:function(){
this.stats={};
this.avgStats={};
this.sessionActive=false;
this.sid=Math.floor(Date.now()*Math.random());
this.data.setQueryData({sid:this.sid});},


recordSelect:function(l){
var m=l.selected;
if(m.uid==null){
this.recordStat('selected_id','SELECT_NULL');}else 

this.recordStat('selected_id',m.uid);

this.recordStat('selected_type',m.type);
this.recordStat('selected_position',l.index);
this.recordStat('selected_with_mouse',l.clicked?1:0);
this._sessionEnd();},










bindSessionStart:function(l,event,m){
if(m)
for(var n=0;n<this._sessionStartEvents.length;++n){
var o=this._sessionStartEvents[n];
o.obj.unsubscribe(o.token);}



this._sessionStartEvents.push
({obj:l,
token:l.subscribe(event,function(p,q){
this._sessionStart();}.
bind(this))});},











bindSessionEnd:function(l,event,m){
if(m)
for(var n=0;n<this._sessionEndEvents.length;++n){
var o=this._sessionEndEvents[n];
o.obj.unsubscribe(o.token);}



this._sessionEndEvents.push
({obj:l,
token:l.subscribe(event,function(p,q){
this._sessionEnd();}.
bind(this))});},



initEvents:function(){
this.bindSessionStart(this.core,'focus',false);
this.bindSessionEnd(this.core,'blur',false);

this.view.subscribe('select',function(l,m){
this.recordSelect(m);}.
bind(this));
this.bindSessionEnd(this.view,'select',false);

this.view.subscribe('render',function(l,m){
this.results=m;}.
bind(this));

this.data.subscribe('beforeQuery',function(l,m){
if(!m.value)return;
this.query=m.value;
this.recordCountStat('num_queries');}.
bind(this));


this.data.subscribe('beforeFetch',function(l,m){
if(m.fetch_context.bootstrap){
this.bootstrapBegin=Date.now();}else 

m.fetch_context.queryBegin=Date.now();}.

bind(this));


this.data.subscribe('fetchComplete',function(l,m){
if(m.fetch_context.bootstrap){
this.recordAvgStat('bootstrap_latency',
Date.now()-this.bootstrapBegin);

var n={};
m.response.payload.entries.forEach(function(o){
if(!n[o.type]){
n[o.type]=1;}else 

n[o.type]++;});



this.recordStat('bootstrap_response_types',n);

this.bootstrapped=true;}else 

this.recordAvgStat('avg_query_latency',
Date.now()-m.fetch_context.queryBegin);}.

bind(this));

this.data.subscribe('dirty',function(l,m){
this.bootstrapped=false;});},



_sessionStart:function(){
if(this.sessionActive)return;
this.sessionActive=true;},


_sessionEnd:function(){
if(!this.sessionActive)return;
this.sessionActive=false;

this.submit();
this._reset();},


recordStat:function(l,m){
this.stats[l]=m;},


recordCountStat:function(l){
var m=this.stats[l];
this.stats[l]=m?m+1:1;},


recordAvgStat:function(l,m){
if(this.avgStats[l]){
this.avgStats[l][0]+=m;
++this.avgStats[l][1];}else 

this.avgStats[l]=[m,1];},






submit:function(){
if(Object.keys(this.stats).length){
i(this.stats,this.extraData);

if(this.results){
var l=(this.results).map(function(o,p){
return o.uid;});

this.recordStat('candidate_results',JSON.stringify(l));}


if(this.query)
this.recordStat('query',this.query);


if(this.sid)
this.recordStat('sid',this.sid);


if(this.bootstrapped)
this.recordStat('bootstrapped',1);


for(var m in this.avgStats){
var n=this.avgStats[m];
this.stats[m]=n[0]/n[1];}


new h().
setURI(this.endPoint).
setMethod('POST').
setData({stats:this.stats}).
send();
this._reset();}}});




k.register=function(l,m,n){
if(document.activeElement===l){
m.init(n);}else 

var o=g.listen(l,'focus',function(){
m.init(n);
o.remove();});};




e.exports=k;});

/** js/ui/xhp/typeahead/behaviors/TypeaheadHoistFriends.js */
__d("TypeaheadHoistFriends",["copyProperties"],function(a,b,c,d,e,f){



var g=b('copyProperties');

function h(i){
this._typeahead=i;}


g(h.prototype,
{_subscription:null,

enable:function(){
var i=this._typeahead.getView();
this._subscription=
i.subscribe('beforeRender',function(j,k){
var l=[],
m=[],
n=[];

for(var o=0;o<k.results.length;++o){
var p=k.results[o];

if(p.type=='header'){
n=n.concat(m,l);
n.push(p);
m=[];
l=[];}else
if(p.type=='user'&&p.bootstrapped){
m.push(p);}else 

l.push(p);}



k.results=n.concat(m,l);});},



disable:function(){
this._typeahead.getView().unsubscribe(this._subscription);
this._subscription=null;}});




e.exports=h;});

/** js/ui/xhp/typeahead/behaviors/LegacyHoistFriendsTypeaheadBehavior.js */
__d("legacy:HoistFriendsTypeaheadBehavior",["TypeaheadHoistFriends"],function(a,b,c,d){



var e=b('TypeaheadHoistFriends');

if(!a.TypeaheadBehaviors)a.TypeaheadBehaviors={};
a.TypeaheadBehaviors.hoistFriends=function(f){
f.enableBehavior(e);};},


3);
