/*1360572766,173213213*/

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

__d("ComposerXAttachmentBootstrap",["CSS","Form","Parent","URI","cx"],function(a,b,c,d,e,f){var g=b('CSS'),h=b('Form'),i=b('Parent'),j=b('URI'),k=b('cx'),l=[],m={bootstrap:function(n){m.load(i.byTag(n,'form'),n.getAttribute('data-endpoint'));},load:function(n,o,p){var q=j(o).addQueryData({composerurihash:m.getURIHash(o)});g.conditionClass(n,"_fu",p);var r=i.byClass(n,"_2_4");g.removeClass(r,'async_saving');h.setDisabled(n,false);n.action=q.toString();h.bootstrap(n);},getURIHash:function(n){if(n==='initial')return 'initial';var o=l.indexOf(n);if(o!==-1){return o+'';}else{o=l.length;l[o]=n;return o+'';}}};e.exports=m;});
__d("ComposerXStore",["function-extensions","Arbiter","ge"],function(a,b,c,d,e,f){b('function-extensions');var g=b('Arbiter'),h=b('ge'),i={};function j(l,m){return 'ComposerX/'+l+'/'+m;}var k={set:function(l,m,n){if(!i[l])i[l]={};i[l][m]=n;g.inform(j(l,m),{},g.BEHAVIOR_STATE);},get:function(l,m){if(i[l])return i[l][m];return null;},getAllForComposer:function(l){return i[l]||{};},waitForComponents:function(l,m,n){g.registerCallback(n,m.map(j.curry(l)));}};g.subscribe('page_transition',function(){for(var l in i)if(!h(l))delete i[l];});e.exports=k;});
__d("ComposerX",["Arbiter","ComposerXAttachmentBootstrap","ComposerXStore","CSS","DOM","DOMQuery","copyProperties","csx","cx","getObjectValues"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ComposerXAttachmentBootstrap'),i=b('ComposerXStore'),j=b('CSS'),k=b('DOM'),l=b('DOMQuery'),m=b('copyProperties'),n=b('csx'),o=b('cx'),p=b('getObjectValues'),q='any';function r(s){this._root=s;this._composerID=s.id;this._attachments={};this._attachmentFetchForm=l.find(s,"._2_4");this._resetSubscription=g.subscribe('composer/publish',function(t,u){if(u.composer_id===this._composerID)this.reset();}.bind(this));}m(r.prototype,{_endpointHashToShow:q,_lastFetchEndpoint:'',_initialAttachmentEndpoint:'',getAttachment:function(s,t){var u=h.getURIHash(s);this._endpointHashToShow=u;var v=this._attachments[u];if(v){this._showAttachmentAfterComponentsLoaded(u);}else this.fetchAttachmentData(s,t);},fetchAttachmentData:function(s,t){var u=h.getURIHash(s);if(this._attachments[u])return;if(s!==this._lastFetchEndpoint){h.load(this._attachmentFetchForm,s,t);this._lastFetchEndpoint=s;}},setAttachment:function(s,t,u,v){this._setupAttachment(s,t,u,v);this._showAttachmentAfterComponentsLoaded(s);},setInitialAttachment:function(s,t,u,v){var w=h.getURIHash(s);this._setupAttachment(w,t,u,v);this._initialAttachmentEndpoint=s;if(!this._currentInstance)this._showAttachmentAfterComponentsLoaded(w);},setComponent:function(s,t){if(!i.get(this._composerID,s)){i.set(this._composerID,s,t);k.appendContent(this._attachmentFetchForm,k.create('input',{type:'hidden',name:'loaded_components[]',value:s}));}},reset:function(){if(this._currentInstance){this._currentInstance.cleanup();this._currentInstance=null;}for(var s in this._attachments)this._attachments[s].instance.reset();var t=i.getAllForComposer(this._composerID);p(t).forEach(function(u){if(u.reset)u.reset(u);});this.getAttachment(this._initialAttachmentEndpoint);g.inform('composer/reset');},destroy:function(){if(this._resetSubscription){this._resetSubscription.unsubscribe();this._resetSubscription=null;}},addPlaceholders:function(s,t){var u;for(var v in this._attachments){u=this._attachments[v];if(u.instance===s){t.forEach(function(w){u.placeholders.push(w);u.required_components.push(w.component_name);});break;}}if(this._currentInstance===s)this._fillPlaceholders(t);},_setupAttachment:function(s,t,u,v){t.setComposerID(this._composerID);this._attachments[s]={instance:t,placeholders:u,required_components:v};var w=l.find(this._root,"div._118"),x=t.getRoot();if(x.parentNode!==w){j.hide(x);k.appendContent(w,x);}},_showAttachment:function(s,t,u){if(this._currentInstance===s)return;if(this._endpointHashToShow===q){this._endpointHashToShow=null;}else if(this._endpointHashToShow!==t)return;if(this._currentInstance){if(!this._currentInstance.canSwitchAway())return;this._currentInstance.cleanup();}this._currentInstance=s;var v=l.find(this._root,"div._118"),w=v.childNodes,x=s.getRoot();for(var y=0;y<w.length;y++)if(w[y]!==x)j.hide(w[y]);j.show(x);this._fillPlaceholders(u);var z=h.getURIHash(this._initialAttachmentEndpoint),aa=t===z;s.initWithComponents(aa);this._setAttachmentSelectedClass(s.attachmentClassName);g.inform('composer/initializedAttachment',{composerRoot:this._root,isInitial:aa});},_showAttachmentAfterComponentsLoaded:function(s){var t=this._attachments[s];i.waitForComponents(this._composerID,t.required_components,this._showAttachment.bind(this,t.instance,s,t.placeholders));},_fillPlaceholders:function(s){s.forEach(function(t){var u=i.get(this._composerID,t.component_name);if(t.element!==u.element.parentNode)k.setContent(t.element,u.element);}.bind(this));},_setAttachmentSelectedClass:function(s){var t=l.scry(this._root,"._4n")[0],u;if(t){j.removeClass(t,"_4n");u=l.scry(t,'*[aria-pressed="true"]')[0];if(u)u.setAttribute('aria-pressed','false');}if(s){var v=l.scry(this._root,'.'+s)[0];if(v){j.addClass(v,"_4n");u=l.scry(v,'*[aria-pressed="false"]')[0];if(u)u.setAttribute('aria-pressed','true');}}}});e.exports=r;});
__d("ComposerXAttachment",["ComposerXStore","copyProperties","emptyFunction"],function(a,b,c,d,e,f){var g=b('ComposerXStore'),h=b('copyProperties'),i=b('emptyFunction');function j(){}h(j.prototype,{getRoot:i,initWithComponents:function(k){},cleanup:i,reset:i,attachmentClassName:'',getComponent:function(k){return g.get(this._composerID,k);},canSwitchAway:i.thatReturnsTrue,setComposerID:function(k){this._composerID=k;}});e.exports=j;});
__d("ComposerXController",["Arbiter","ComposerX","ComposerXAttachmentBootstrap","Parent","$","cx","emptyFunction","ge"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ComposerX'),i=b('ComposerXAttachmentBootstrap'),j=b('Parent'),k=b('$'),l=b('cx'),m=b('emptyFunction'),n=b('ge'),o={};function p(r){var s=j.byClass(k(r),"_119"),t=s.id;if(!o[t])o[t]=new h(s);return o[t];}var q={getAttachment:function(r,s,t){var u=p(r);u.getAttachment(s,t);},fetchAttachmentData:function(r,s,t){p(r).fetchAttachmentData(s,t);},setAttachment:function(r,s,t,u,v){var w=p(r);w.setAttachment(s,t,u,v);},setInitialAttachment:function(r,s,t,u,v){var w=p(r);w.setInitialAttachment(s,t,u,v);},setComponent:function(r,s,t){var u=p(r);u.setComponent(s,t);},reset:function(r){var s=p(r);s.reset();},holdTheMarkup:m,getEndpoint:function(r,s,t){var u=p(r);i.load(u._attachmentFetchForm,s,t);},addPlaceholders:function(r,s,t){var u=p(r);u.addPlaceholders(s,t);}};i.bootstrap=function(r){q.getAttachment(r,r.getAttribute('data-endpoint'));};g.subscribe('page_transition',function(){for(var r in o)if(!n(r)){o[r].destroy();delete o[r];}});e.exports=q;});
__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 "Vous n\u2019avez pas encore fini votre message. Voulez-vous quitter sans le terminer\u00a0?";});}};e.exports=o;});
__d("DragDropFileUpload",[],function(a,b,c,d,e,f){f.isSupported=function(){return typeof(FileList)!=="undefined";};});
__d("DocumentDragDrop",["Event","Arbiter","CSS","DOM","DOMQuery","DragDropFileUpload","emptyFunction","getObjectValues"],function(a,b,c,d,e,f){var g=b('Event'),h=b('Arbiter'),i=b('CSS'),j=b('DOM'),k=b('DOMQuery'),l=b('DragDropFileUpload'),m=b('emptyFunction'),n=b('getObjectValues'),o={},p=0;function q(){p=0;n(o).forEach(function(t){i.removeClass(t.element,t.className);h.inform('dragleave',{element:t.element});});}function r(){if(!l.isSupported())return;g.listen(document,'dragenter',function(u){if(p===0)n(o).forEach(function(v){i.addClass(v.element,v.className);h.inform('dragenter',{element:v.element,event:u});});p++;});g.listen(document,'dragleave',function(u){p--;if(p===0)q();});g.listen(document,'drop',function(u){var v=u.getTarget();if(k.isNodeOfType(u.getTarget(),'input'))if(v.type==='file')return;u.prevent();});g.listen(document,'dragover',g.prevent);var t=null;document.addEventListener('dragover',function(){t&&clearTimeout(t);t=setTimeout(q,839);},true);r=m;}var s={registerStatusElement:function(t,u){r();o[j.getID(t)]={element:t,className:u};},removeStatusElement:function(t){var u=j.getID(t),v=o[u];i.removeClass(v.element,v.className);delete o[u];}};e.exports=s;});
__d("DragDropTarget",["Event","CSS","DocumentDragDrop","DragDropFileUpload","copyProperties","emptyFunction"],function(a,b,c,d,e,f){var g=b('Event'),h=b('CSS'),i=b('DocumentDragDrop'),j=b('DragDropFileUpload'),k=b('copyProperties'),l=b('emptyFunction');function m(n){this._element=n;this._listeners=[];this._statusElem=n;this._dragEnterCount=0;this._enabled=false;}k(m.prototype,{_onFilesDropCallback:l,_onURLDropCallback:l,_fileFilterFn:l.thatReturnsArgument,setOnFilesDropCallback:function(n){this._onFilesDropCallback=n;return this;},setOnURLDropCallback:function(n){this._onURLDropCallback=n;return this;},enable:function(){if(!j.isSupported())return this;i.registerStatusElement(this._statusElem,'fbWantsDragDrop');this._listeners.push(g.listen(this._element,'dragenter',this._onDragEnter.bind(this)));this._listeners.push(g.listen(this._element,'dragleave',this._onDragLeave.bind(this)));this._listeners.push(g.listen(this._element,'dragover',g.kill));this._listeners.push(g.listen(this._element,'drop',function(n){this._dragEnterCount=0;h.removeClass(this._statusElem,'fbDropReady');var o=this._fileFilterFn(n.dataTransfer.files);if(o.length)this._onFilesDropCallback(o);var p=n.dataTransfer.getData('url')||n.dataTransfer.getData('text/uri-list');if(p)this._onURLDropCallback(p);n.kill();}.bind(this)));this._enabled=true;return this;},disable:function(){if(!this._enabled)return this;i.removeStatusElement(this._statusElem,'fbWantsDragDrop');h.removeClass(this._statusElem,'fbDropReady');while(this._listeners.length)this._listeners.pop().remove();this._enabled=false;return this;},setFileFilter:function(n){this._fileFilterFn=n;return this;},setStatusElement:function(n){this._statusElem=n;return this;},_onDragEnter:function(){if(this._dragEnterCount===0)h.addClass(this._statusElem,'fbDropReady');this._dragEnterCount++;},_onDragLeave:function(){this._dragEnterCount=Math.max(this._dragEnterCount-1,0);if(this._dragEnterCount===0)h.removeClass(this._statusElem,'fbDropReady');}});e.exports=m;});
__d("ComposerXDragDrop",["Arbiter","ComposerXController","CSS","DragDropTarget","DOMQuery","Parent","URI","copyProperties","csx","cx"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ComposerXController'),i=b('CSS'),j=b('DragDropTarget'),k=b('DOMQuery'),l=b('Parent'),m=b('URI'),n=b('copyProperties'),o=b('csx'),p=b('cx'),q='/ajax/composerx/attachment/media/upload/',r='/ajax/composerx/attachment/link/scraper/',s=function(u){u();};function t(u,v,w,x){this._root=u;this._composerID=v;this._targetID=w;x=x||s;this._dragdrop=new j(u).setOnFilesDropCallback(function(y){x(this._uploadFiles.bind(this,y));}.bind(this)).setFileFilter(t.filterImages).enable();t.handleDragEnterAndLeave(u);g.subscribe('composer/deactivateDragdrop',function(){this.deactivate();}.bind(this));}n(t,{handleDragEnterAndLeave:function(u){var v=k.scry(l.byClass(u,"_119"),"._2wr");g.subscribe('dragenter',function(w,x){if(u==x.element)v.forEach(i.hide);});g.subscribe('dragleave',function(w,x){if(u==x.element)v.forEach(i.show);});},filterImages:function(u){var v=[];for(var w=0;w<u.length;w++)if(u[w].type.match('image/*'))v.push(u[w]);return v;}});n(t.prototype,{enableURLDropping:function(){this._dragdrop.setOnURLDropCallback(this._onURLDrop.bind(this));},deactivate:function(){this._dragdrop.disable();},_uploadFiles:function(u){h.getAttachment(this._root,q);g.inform('ComposerXFilesStore/filesDropped/'+this._composerID+'/mediaupload',{files:u},g.BEHAVIOR_PERSISTENT);},_onURLDrop:function(u){var v=new m(r);v.addQueryData({scrape_url:encodeURIComponent(u)});h.getAttachment(this._root,v.toString());}});e.exports=t;});
__d("ComposerXBootloadStatusAttachment",["Event","function-extensions","Arbiter","AsyncRequest","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('AsyncRequest'),j=b('Bootloader'),k=b('Class'),l=b('ComposerXAttachment'),m=b('ComposerXController'),n=b('ComposerXDragDrop'),o=b('CSS'),p=b('DOM'),q=b('DOMQuery'),r=b('Focus'),s=b('Parent'),t=b('PlaceholderListener'),u=b('URI'),v=b('copyProperties'),w=b('csx'),x=b('cx'),y={};function z(aa,ba){this.parent.construct(this);this._root=aa;this._config=ba;}k.extend(z,l);v(z.prototype,{_attachmentIsActive:false,_bootloading:false,_fullVersion:false,_focusListener:null,_privacyWidgetTags:null,_scraper:null,_dragdrop:null,attachmentClassName:"_4j",getRoot:function(){return this._root;},initWithComponents:function(aa){y[this._composerID]=this;this._attachmentIsActive=true;var ba=q.find(this.getComponent('maininput').element,'textarea.input');if(this._fullVersion){this._fullInitWithComponents();}else if(!this._bootloading)if(q.contains(this._root,document.activeElement)){this._onInitialFocus();}else this._focusListener=g.listen(ba,'focus',this._onInitialFocus.bind(this));this._dragEnterHandler=h.subscribe('dragenter',function(ca,da){if(da.element==this._root){var ea=da.event.dataTransfer.items,fa;if(ea)fa=n.filterImages(ea);if(fa&&fa.length>0){r.set(ba);}else{var ga=s.byClass(this._root,'focus_target');t.expandInput(ga);if(!this._bootloading&&!this._fullVersion)this._onInitialFocus();}}}.bind(this));this.getComponent('maininput').instance.setPlaceholder(this._config.mentionsPlaceholder);if(!aa)r.set(ba);if(this._config.plus_version){this._dragdrop=new n(this._root,this._composerID,this._config.targetID);this._dragdrop.enableURLDropping();}},_fullInitWithComponents:function(){j.loadModules(['ComposerXPrivacyWidgetTags','URLScraper','URI'],function(ba,ca,da){this._tagger.init(this);this._privacyWidgetTags=new ba(this);var ea=q.find(this.getComponent('maininput').element,'textarea.input');if(!this._scraper){this._scraper=new ca(ea);this._scraper.subscribe('match',function(fa,ga){var ha=this._getScraperEndpoint();ha.addQueryData({scrape_url:encodeURIComponent(ga.url)});m.getAttachment(this._root,ha.toString());}.bind(this));}this._scraper.enable();this._scraper.check();}.bind(this));if(this._reminderDialog&&!this._reminderShown){this._reminderShown=true;this._reminderDialog.setContext(this.getComponent('mainprivacywidget').element).show();var aa=function(){new i('/ajax/privacy/reminders/dismiss').setData({type:'only_me'}).send();this._reminderDialog.hide();}.bind(this);this._reminderEvents=[g.listen(this._reminderDialog.getContent(),'click',aa),g.listen(this._reminderDialog.getContext(),'click',aa)];}},cleanup:function(){this._attachmentIsActive=false;if(this._focusListener){this._focusListener.remove();this._focusListener=null;}if(this._reminderDialog){this._reminderDialog.hide();this._reminderEvents.forEach(function(aa){aa.remove();});}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 aa=s.byClass(this._root,"child_was_focused");if(aa)o.removeClass(aa,"child_was_focused");if(this._tagger)this._tagger.reset();this.getComponent('maininput').instance.setPlaceholder(this._config.mentionsPlaceholder);},canSwitchAway:function(){return !s.byClass(this._root,'async_saving');},setBootloadedContent:function(aa,ba,ca,da){this._reminderDialog=da;var ea=q.find(this._root,"._3-6"),fa=q.find(this._root,"._3-7");p.setContent(ea,aa.tagger_content);p.setContent(fa,aa.tagger_icons);m.addPlaceholders(this._root,this,ca);this._tagger=ba;this._fullVersion=true;if(this._attachmentIsActive){if(this._focusListener){this._focusListener.remove();this._focusListener=null;}this._fullInitWithComponents();}},_getScraperEndpoint:function(){return u('/ajax/composerx/attachment/link/scraper/');},_onInitialFocus:function(){m.getEndpoint(this._root,'/ajax/composerx/attachment/status/bootload/',true);this._bootloading=true;}});z.setBootloadedContent=function(aa,ba,ca,da,ea){var fa=y[aa];if(fa)fa.setBootloadedContent(ba,ca,da,ea);};e.exports=z;});
__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;});
__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;});
__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;});
__d("legacy:dom-scroll",["DOMScroll"],function(a,b,c,d){a.DOMScroll=b('DOMScroll');},3);
__d("legacy:bind",["bind"],function(a,b,c,d){a.bind=b('bind');},3);
__d("legacy:input-methods",["Input","copyProperties"],function(a,b,c,d){var e=b('Input'),f=b('copyProperties');f(a.Input||(a.Input={}),e);},3);
__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;});
__d("legacy:error-dialog",["ErrorDialog"],function(a,b,c,d){var e=b('ErrorDialog');a.ErrorDialog=e;},3);
__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);});
__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;});
__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;});
__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;});
__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;});
__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;});
__d("PopoverMenuInterface",["ArbiterMixin","copyProperties","emptyFunction"],function(a,b,c,d,e,f){var g=b('ArbiterMixin'),h=b('copyProperties'),i=b('emptyFunction');function j(){}h(j.prototype,g,{getRoot:i,onShow:i,onHide:i,focusAnItem:i.thatReturnsFalse,blur:i,handleKeydown:i.thatReturnsFalse,done:function(){this.inform('done');}});e.exports=j;});
__d("MenuX",["Event","Class","copyProperties","CSS","DataStore","DOM","Keys","Parent","PopoverMenuInterface","ScrollableArea","Style","UserAgent"],function(a,b,c,d,e,f){var g=b('Event'),h=b('Class'),i=b('copyProperties'),j=b('CSS'),k=b('DataStore'),l=b('DOM'),m=b('Keys'),n=b('Parent'),o=b('PopoverMenuInterface'),p=b('ScrollableArea'),q=b('Style'),r=b('UserAgent');function s(t,u,v,w){this.parent.construct(this);this._id=t;this._className=u;this._items=[];for(var x=0;x<v.length;x++)this._items[x]=new v[x].ctor(v[x]);this._config=w;}h.extend(s,o);i(s.prototype,{_focused:null,_root:null,addItem:function(t,u){if(u==null||u>this._items.length)u=this._items.length;var v=this._items.indexOf(t);if(v>=0){if(v===u)return;this._items.splice(v,1);}var w=this._items[u];this._items.splice(u,0,t);if(this._root)this._insertItem(t,w);},removeItem:function(t){var u=this._items.indexOf(t);if(u<0)return;this._items.splice(u,1);this._root&&l.remove(t.getRoot());},getItemAt:function(t){return this._items[t]||null;},getRoot:function(){if(!this._root)this._render();return this._root;},onShow:function(){if(this._config.maxheight)if(!this._scrollableArea){q.set(this._scrollableElems.root,'width',this._scrollableElems.body.offsetWidth+'px');this._scrollableArea=p.fromNative(this._scrollableElems.root,{fade:true});q.set(this._scrollableElems.wrap,'max-height',this._config.maxheight+'px');}else{q.set(this._scrollableElems.root,'width','');q.set(this._scrollableElems.content,'width','');if(r.ie()<=7){q.set(this._scrollableElems.root,'width',this._scrollableElems.content.offsetWidth+'px');}else q.set(this._scrollableElems.root,'width',this._scrollableElems.content.offsetWidth+'px');this._scrollableArea.resize();}},onHide:function(){this.blur();},focusAnItem:function(){return this._attemptFocus(0,1);},blur:function(){if(this._focused){this._focused.blur();this._focused=null;this.inform('blur');}},handleKeydown:function(t){var u=this._items.indexOf(this._focused);switch(t){case m.UP:case m.DOWN:var v=t===m.UP?-1:1;if(u!==-1){return this._attemptFocus(u+v,v);}else if(t===m.UP){return this._attemptFocus(this._items.length-1,-1);}else return this._attemptFocus(0,1);break;case m.SPACE:if(this._items.indexOf(this._focused)!==-1){this._handleItemClick(this._focused);return true;}return false;default:var w=String.fromCharCode(t).toLowerCase(),x;for(var y=u+1;y<this._items.length;y++){x=this._items[y].getAccessKey();if(x&&x.charAt(0).toLowerCase()===w)if(this._focusItem(this._items[y]))return true;}return false;}},_render:function(){this._ul=l.create('ul',{className:'uiMenuX'});this._ul.setAttribute('role','menu');this._items.forEach(function(v){this._insertItem(v,null);}.bind(this));g.listen(this._ul,'click',this._handleClick.bind(this));g.listen(this._ul,'mouseover',this._handleMouseOver.bind(this));g.listen(this._ul,'mouseout',this._handleMouseOut.bind(this));var t=this._ul;if(this._config.maxheight){this._scrollableElems=p.renderDOM();l.setContent(this._scrollableElems.content,this._ul);t=this._scrollableElems.root;}var u='uiMenuXWrapper'+(this._className?' '+this._className:'');this._root=l.create('div',{className:u},l.create('div',{className:'uiMenuXBorder'},t));this._id&&this._root.setAttribute('id',this._id);this.inform('rendered',this._root);},_handleClick:function(t){var u=this._getItemInstance(t.getTarget());if(u)return this._handleItemClick(u);},_handleItemClick:function(t){this.inform('itemclick',t);if(t.hasAction())this.done();return t.handleClick();},_handleMouseOver:function(t){var u=this._getItemInstance(t.getTarget());u&&this._focusItem(u,true);},_handleMouseOut:function(t){var u=this._getItemInstance(t.getTarget());if(u&&this._focused===u)this.blur();},_insertItem:function(t,u){var v=t.getRoot();j.addClass(v,'__MenuXItem');k.set(v,'MenuXItem',t);if(u){l.insertBefore(u.getRoot(),v);}else l.appendContent(this._ul,v);},_attemptFocus:function(t,u){var v=this.getItemAt(t);if(v)if(this._focusItem(v)){return true;}else return this._attemptFocus(t+u,u);return false;},_focusItem:function(t,u){if(t.focus(u)!==false){if(this._focused!==t){this.blur();this._focused=t;this.inform('focus');}return true;}return false;},_getItemInstance:function(t){var u=n.byClass(t,'__MenuXItem');return u?k.get(u,'MenuXItem'):null;}});e.exports=s;});
__d("MenuXSelectable",["array-extensions","createArrayFrom","Class","copyProperties","MenuX"],function(a,b,c,d,e,f){b('array-extensions');var g=b('createArrayFrom'),h=b('Class'),i=b('copyProperties'),j=b('MenuX');function k(n,o,p,q){this.parent.construct(this,n,o,p,q);}function l(n){return n.select&&n.deselect&&n.isSelected;}function m(n){return l(n)&&n.isSelected();}h.extend(k,j);i(k.prototype,{focusAnItem:function(){for(var n=0;n<this._items.length;n++)if(m(this._items[n]))if(this._focusItem(this._items[n])!==false)return true;return this.parent.focusAnItem();},setValue:function(n){if(!this._root)this._render();var o=g(n);this._items.forEach(function(p){if(l(p))if(o.contains(p.getValue())){p.select();}else if(m(p))p.deselect();});this.inform('change',this._getSelection());},_handleItemClick:function(n){if(!l(n))return this.parent._handleItemClick(n);this.inform('itemclick',n);if(this._config.multiple){if(m(n)){n.deselect();}else n.select();this.inform('change',this._getSelection());}else{if(!m(n)){n.select();this._items.forEach(function(o){if(m(o)&&o!==n)o.deselect();});this.inform('change',this._getSelection());}this.done();}return n.handleClick();},_getSelection:function(){var n=[];this._items.forEach(function(o){if(m(o))n.push({label:o.getLabel(),value:o.getValue(),item:o});});if(!this._config.multiple)n=n[0];return n;}});e.exports=k;});
__d("MenuXSelectableItem",["Class","copyProperties","CSS","MenuXItem"],function(a,b,c,d,e,f){var g=b('Class'),h=b('copyProperties'),i=b('CSS'),j=b('MenuXItem');function k(l){this.parent.construct(this,l);}g.extend(k,j);h(k.prototype,{_selected:false,getLabel:function(){return this._data.label;},getIcon:function(){return this._data.icon;},isSelected:function(){return this._selected;},select:function(){i.addClass(this._root,'checked');this._selected=true;},deselect:function(){i.removeClass(this._root,'checked');this._selected=false;},render:function(){var l=this.parent.render();if(this._data.selected){i.addClass(l,'checked');this._selected=true;}return l;}});e.exports=k;});
__d("Popover",["Event","Arbiter","ArbiterMixin","ContextualLayer","ContextualLayerHideOnScroll","CSS","DataStore","DOM","Focus","KeyStatus","LayerHideOnEscape","Toggler","copyProperties"],function(a,b,c,d,e,f){var g=b('Event'),h=b('Arbiter'),i=b('ArbiterMixin'),j=b('ContextualLayer'),k=b('ContextualLayerHideOnScroll'),l=b('CSS'),m=b('DataStore'),n=b('DOM'),o=b('Focus'),p=b('KeyStatus'),q=b('LayerHideOnEscape'),r=b('Toggler'),s=b('copyProperties');r.subscribe(['show','hide'],function(u,v){var w=m.get(v.getActive(),'Popover');if(w)if(u==='show'){w.showLayer();}else w.hideLayer();});function t(u,v,w,x){this._root=u;this._triggerElem=v;this._behaviors=w;this._config=x;if(!(v.nodeName==='A'&&v.rel==='toggle'))g.listen(v,'click',function(){r.bootstrap(v);});v.setAttribute('role','button');m.set(u,'Popover',this);}s(t.prototype,i,{_layer:null,_closeListener:null,ensureInit:function(){if(!this._layer)this._init();},showLayer:function(){this.ensureInit();this._layer.show();r.show(this._root);l.addClass(this._root,'selected');this.inform('show');this._triggerElem.setAttribute('aria-expanded','true');},getLayer:function(){return this._layer;},hideLayer:function(){this._layer.hide();this._triggerElem.setAttribute('aria-expanded','false');},isShown:function(){return this._layer.isShown();},setLayerContent:function(u){this.ensureInit();this._layer.setContent(u);},_init:function(){var u=new j({context:this._triggerElem,position:'below'},n.create('div'));u.enableBehaviors([k,q]);r.createInstance(u.getRoot()).setSticky(false);u.subscribe('hide',this._onLayerHide.bind(this));this._behaviors&&u.enableBehaviors(this._behaviors);this._layer=u;if(this._config.alignh)this._layer.setAlignment(this._config.alignh);if(this._config.layer_content)this._layer.setContent(this._config.layer_content);this.inform('init',null,h.BEHAVIOR_PERSISTENT);},_onLayerHide:function(){r.hide(this._root);l.removeClass(this._root,'selected');this.inform('hide');if(p.isKeyDown())o.set(this._triggerElem);}});e.exports=t;});
__d("PopoverMenu",["Event","Arbiter","ArbiterMixin","ARIA","BehaviorsMixin","Focus","Keys","KeyStatus","copyProperties"],function(a,b,c,d,e,f){var g=b('Event'),h=b('Arbiter'),i=b('ArbiterMixin'),j=b('ARIA'),k=b('BehaviorsMixin'),l=b('Focus'),m=b('Keys'),n=b('KeyStatus'),o=b('copyProperties');function p(q,r,s,t){this._popover=q;this._triggerElem=r;this._initialMenu=s;q.subscribe('init',this._onLayerInit.bind(this));q.subscribe('show',this._onPopoverShow.bind(this));q.subscribe('hide',this._onPopoverHide.bind(this));t&&this.enableBehaviors(t);}o(p.prototype,i,k);o(p.prototype,{_popoverShown:false,setMenu:function(q){this._menu=q;var r=q.getRoot();this._popover.setLayerContent(r);q.subscribe('done',this._onMenuDone.bind(this));if(this._popoverShown)this._menu.onShow();j.owns(this._triggerElem,r);this.inform('setMenu',null,h.BEHAVIOR_PERSISTENT);},getPopover:function(){return this._popover;},getTriggerElem:function(){return this._triggerElem;},getMenu:function(){return this._menu;},_onLayerInit:function(){this.setMenu(this._initialMenu);this._popover.getLayer().subscribe('key',this._handleKeyEvent.bind(this));},_onPopoverShow:function(){if(this._menu){this._menu.onShow();if(n.isKeyDown())this._menu.focusAnItem();}this._popoverShown=true;},_onPopoverHide:function(){if(this._menu)this._menu.onHide();this._popoverShown=false;},_handleKeyEvent:function(q,r){var s=g.getKeyCode(r);switch(s){case m.RETURN:return;case m.UP:case m.DOWN:this._menu.handleKeydown(s);break;default:if(this._menu.handleKeydown(s)===false){this._menu.blur();this._menu.handleKeydown(s);}break;}r.prevent();},_onMenuDone:function(q){this._popover.hideLayer.bind(this._popover).defer();if(n.isKeyDown())l.set(this._triggerElem);}});e.exports=p;});
__d("PopoverAsyncMenu",["Event","AsyncRequest","Class","PopoverMenu","copyProperties"],function(a,b,c,d,e,f){var g=b('Event'),h=b('AsyncRequest'),i=b('Class'),j=b('PopoverMenu'),k=b('copyProperties'),l={},m=0;function n(o,p,q,r,s){this._endpoint=r;this._loadingMenu=q;this._instanceId=m++;l[this._instanceId]=this;this._mouseoverListener=g.listen(p,'mouseover',this._fetchMenu.bind(this));this.parent.construct(this,o,p,null,s);}n.setMenu=function(o,p){l[o].setMenu(p);};i.extend(n,j);k(n.prototype,{_fetched:false,_mouseoverListener:null,_onLayerInit:function(){if(!this._menu)this.setMenu(this._loadingMenu);this._fetchMenu();},_fetchMenu:function(){if(this._fetched)return;new h().setURI(this._endpoint).setData({pmid:this._instanceId}).send();this._fetched=true;if(this._mouseoverListener){this._mouseoverListener.remove();this._mouseoverListener=null;}}});e.exports=n;});
__d("PopoverAsyncMenuLoading",["Class","copyProperties","DOM","PopoverMenuInterface"],function(a,b,c,d,e,f){var g=b('Class'),h=b('copyProperties'),i=b('DOM'),j=b('PopoverMenuInterface');function k(l){this.parent.construct(this);this._className=l||'';}g.extend(k,j);h(k.prototype,{_root:null,getRoot:function(){if(!this._root)this._root=i.create('div',{className:this._className},i.create('div',{className:'uiMenuXBorder'},i.create('div',{className:'uiMenuX uiMenuXLoading'},i.create('span',{className:'spinner'}))));return this._root;}});e.exports=k;});
__d("PopoverMenuOverlappingBorder",["function-extensions","CSS","DOM","Style","copyProperties"],function(a,b,c,d,e,f){b('function-extensions');var g=b('CSS'),h=b('DOM'),i=b('Style'),j=b('copyProperties');function k(l){this._popoverMenu=l;this._popover=l.getPopover();this._triggerElem=l.getTriggerElem();}j(k.prototype,{_shortBorder:null,_setMenuSubscription:null,_showSubscription:null,_menuSubscription:null,enable:function(){this._setMenuSubscription=this._popoverMenu.subscribe('setMenu',this._onSetMenu.bind(this));},disable:function(){this._popoverMenu.unsubscribe(this._setMenuSubscription);this._setMenuSubscription=null;this._removeBorderSubscriptions();this._removeShortBorder();},_onSetMenu:function(){this._removeBorderSubscriptions();this._menu=this._popoverMenu.getMenu();this._renderShortBorder(this._menu.getRoot());this._showSubscription=this._popover.subscribe('show',this._updateBorder.bind(this));this._menuSubscription=this._menu.subscribe(['change','resize'],Function.prototype.defer.shield(this._updateBorder.bind(this)));this._updateBorder();},_updateBorder:function(){var l=this._menu.getRoot(),m=this._triggerElem.offsetWidth;i.set(l,'min-width',m+'px');var n=Math.max(l.offsetWidth-m,0);i.set(this._shortBorder,'width',n+'px');},_renderShortBorder:function(l){this._shortBorder=h.create('div',{className:'uiMenuXShortBorder'});h.appendContent(l,this._shortBorder);g.addClass(l,'uiMenuXWithShortBorder');},_removeShortBorder:function(){if(this._shortBorder){h.remove(this._shortBorder);this._shortBorder=null;g.removeClass(this._popoverMenu.getMenu().getRoot(),'uiMenuXShortBorder');}},_removeBorderSubscriptions:function(){if(this._showSubscription){this._popover.unsubscribe(this._showSubscription);this._showSubscription=null;}if(this._menuSubscription){this._menu.unsubscribe(this._menuSubscription);this._menuSubscription=null;}}});e.exports=k;});
__d("SelectorX",["ArbiterMixin","BehaviorsMixin","Button","copyProperties"],function(a,b,c,d,e,f){var g=b('ArbiterMixin'),h=b('BehaviorsMixin'),i=b('Button'),j=b('copyProperties');function k(l,m,n,o){this._button=l;this._menu=m;this._input=n;this.init();o.behaviors&&this.enableBehaviors(o.behaviors);}j(k.prototype,g,h);j(k.prototype,{init:function(){this._menu.subscribe('change',function(l,m){i.setLabel(this._button,m.label);this._input.value=m.value;this.inform('change',m);}.bind(this));},setValue:function(l){this._menu.setValue(l);},getValue:function(){return this._input.value;},getName:function(){return this._input.name;},getButton:function(){return this._button;}});e.exports=k;});
__d("legacy:AudienceSelector",["AudienceSelector"],function(a,b,c,d){b('AudienceSelector');},3);
__d("legacy:ComposerAudienceSelector",["ComposerAudienceSelector"],function(a,b,c,d){a.ComposerAudienceSelector=b('ComposerAudienceSelector');},3);
__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;});
__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="Toutes les personnes identifi\u00e9es";this._label="Moi uniquement"+' (+)';}else{this._tooltip="Vous uniquement";this._label="Moi uniquement";}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;});
__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?"Vos amis, les amis des personnes identifi\u00e9es et les invit\u00e9s\u00a0; sauf\u00a0: Connaissances, Restreint":"Vos amis, les amis des personnes identifi\u00e9es et les invit\u00e9s\u00a0; sauf\u00a0: Connaissances";}else if(p==1){if(this._hasRestricted){this._tooltip=l._("Vos amis, les amis de {user} et les invit\u00e9s\u00a0; sauf\u00a0: Connaissances, Restreint",{user:this._tags[0]});}else this._tooltip=l._("Vos amis, les amis de {user} et les invit\u00e9s\u00a0; sauf\u00a0: Connaissances",{user:this._tags[0]});}else this._tooltip=this._hasRestricted?"Vos amis et les invit\u00e9s\u00a0; sauf\u00a0: Connaissances, Restreint":"Vos amis et les invit\u00e9s\u00a0; sauf\u00a0: Connaissances";}else this._tooltip=this._hasRestricted?"Amis, sauf Connaissances, Restreint":"Amis sauf connaissances";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;});
__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?"Vos amis, les amis des personnes identifi\u00e9es et les invit\u00e9s\u00a0; sauf\u00a0: Restreint":"Vos amis, les amis des personnes identifi\u00e9es et les invit\u00e9s";}else this._tooltip=this._hasRestricted?"Vos amis et les amis des personnes identifi\u00e9es\u00a0; sauf\u00a0: Restreint":"Vos amis et ceux des personnes identifi\u00e9es";}else if(p==2){if(o){if(this._hasRestricted){this._tooltip="Vos amis, les amis des personnes identifi\u00e9es et les invit\u00e9s\u00a0; sauf\u00a0: Restreint";}else this._tooltip="Vos amis, les amis des personnes identifi\u00e9es et les invit\u00e9s";}else if(this._hasRestricted){this._tooltip=m._("Vos amis, les amis de {user} et les amis de {user2}\u00a0; sauf\u00a0: Restreint",{user:this._tags[0],user2:this._tags[1]});}else this._tooltip=m._("Vos amis, ceux de {user} et de {user2}",{user:this._tags[0],user2:this._tags[1]});}else if(p==1){if(o){if(this._hasRestricted){this._tooltip=m._("Vos amis, les amis de {user} et les invit\u00e9s\u00a0; sauf\u00a0: Restreint",{user:this._tags[0]});}else this._tooltip=m._("Vos amis, les amis de {user} et les invit\u00e9s",{user:this._tags[0]});}else if(this._hasRestricted){this._tooltip=m._("Vos amis et les amis de {user}\u00a0; sauf\u00a0: Restreint",{user:this._tags[0]});}else this._tooltip=m._("Vos amis et ceux de {user}",{user:this._tags[0]});}else if(o){this._tooltip=this._hasRestricted?"Vos amis et les invit\u00e9s\u00a0; sauf\u00a0: Restreint":"Vos amis et les invit\u00e9s";}else this._tooltip=this._hasRestricted?"Vos amis\u00a0; sauf\u00a0: Restreint":"Vos amis";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;});
__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;});
__d("legacy:UIPagelet",["UIPagelet"],function(a,b,c,d){a.UIPagelet=b('UIPagelet');},3);
__d("ContextualLayerAsyncRelative",["Event","copyProperties","Parent"],function(a,b,c,d,e,f){var g=b('Event'),h=b('copyProperties'),i=b('Parent');function j(k){this._layer=k;}h(j.prototype,{_layerSubscription:null,_listener:null,enable:function(){this._layerSubscription=this._layer.subscribe('show',this._attachListener.bind(this));if(this._layer.isShown())this._attachListener();},disable:function(){this._layerSubscription.unsubscribe();this._layerSubscription=null;if(this._listener){this._listener.remove();this._listener=null;}},_attachListener:function(){this._listener=g.listen(this._layer.getRoot(),'click',this._onclick.bind(this));},_onclick:function(k){var l=i.byTag(k.getTarget(),'A');if(!l)return;var m=l.getAttribute('ajaxify'),n=l.href,o=m||n;if(l.rel==='async'||l.rel==='async-post'){d(['AsyncRequest'],function(p){p.bootstrap(o,this._layer.getContext(),l.rel==='async-post');}.bind(this));return false;}}});e.exports=j;});
__d("legacy:LegacyContextualDialog",["LegacyContextualDialog"],function(a,b,c,d){a.LegacyContextualDialog=b('LegacyContextualDialog');},3);
__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;});
__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.value);for(var y=0;y<x.mentions.length;y++)this._addToken(x.mentions[y]);}else n.setValue(this._input,'');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;});
__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;});
__d("legacy:MentionsInput",["MentionsInput"],function(a,b,c,d){a.MentionsInput=b('MentionsInput');},3);
__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;});
__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.results=null;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;});
__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;});
__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);