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

__d("TypeaheadFacepileX.react",["React","joinClasses"],(function a(b,c,d,e,f,g){__p&&__p();var h,i;h=babelHelpers.inherits(j,c("React").Component);i=h&&h.prototype;function j(){__p&&__p();var k,l;"use strict";for(var m=arguments.length,n=Array(m),o=0;o<m;o++)n[o]=arguments[o];return l=(k=i.constructor).call.apply(k,[this].concat(n)),this.renderPic=function(p,q){var r="url("+this.props.photos[p]+")";return c("React").createElement("span",{className:c("joinClasses")("splitpic",q),key:p,style:{backgroundImage:r}})}.bind(this),this.renderPics=function(){var p=this.props.size;if(p>=3)return[this.renderPic(0,"leftpic"),this.renderPic(1,"toppic"),this.renderPic(2,"bottompic")];else return[this.renderPic(0,"leftpic"),this.renderPic(1)]}.bind(this),l}j.prototype.render=function(){"use strict";return c("React").createElement("span",babelHelpers["extends"]({},this.props,{className:c("joinClasses")(this.props.className,"splitpics clearfix")}),this.renderPics())};f.exports=j}),null);
__d("FacebarResultStoreUtils",["FacebarGlobalOptions","FacebarJSConstants"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h={getQueryFeatures:function i(j){__p&&__p();var k={};if(c("FacebarGlobalOptions").enableBootstrapRanking){if(j.raw_text)k.FEATURE_QUERY_LENGTH=j.raw_text.length;if(j.tokens){k.FEATURE_QUERY_TOKENS=j.tokens.length;k.FEATURE_QUERY_TOKEN_LENGTH_SUM=0;for(var l=0;l<j.tokens.length;l++)k.FEATURE_QUERY_TOKEN_LENGTH_SUM+=j.tokens[l].length}}return k},addFeatures:function i(j,k,l,m,n,o){__p&&__p();if(!j.features)return;j.features={FEATURE_QUERY_LENGTH:m.FEATURE_QUERY_LENGTH,FEATURE_QUERY_TOKENS:m.FEATURE_QUERY_TOKENS,FEATURE_QUERY_TOKEN_LENGTH_SUM:m.FEATURE_QUERY_TOKEN_LENGTH_SUM};j.features.FEATURE_IS_EXACT_NAME_MATCH=n;j.features.FEATURE_IS_STOP_WORD_MATCH=o;if(k&&k.length>0){var p=k.split(" ").length,q=0;for(var r=0;r<j.termMatches.length;++r)if(k.search(j.termMatches[r])>=0)q++;j.features.FEATURE_TITLE_TOKEN_MATCH_FRACTION=q/p}if(l.tokens&&l.tokens.length>0){var s=k.search(l.tokens[0]);j.features.FEATURE_FIRST_TERM_MATCH_POSITION=s;j.features.FEATURE_FIRST_TERM_MATCH_TOKEN=k.substring(0,s+l.tokens[0].length).split(" ").length;j.termMatches.some(function(t){if(t.search(l.tokens[0])===0){j.features.FEATURE_FIRST_TERM_MATCH_TOKEN_FRACTION=l.tokens[0].length/t.length;return true}return false});j.features.FEATURE_IN_ORDER_MATCH=1;if(l.tokens.length>1){s=k.search(l.tokens[1]);j.features.FEATURE_SECOND_TERM_MATCH_POSITION=s;j.features.FEATURE_SECOND_TERM_MATCH_TOKEN=k.substring(0,s+l.tokens[1].length).split(" ").length;j.termMatches.some(function(t){if(t.search(l.tokens[1])===0){j.features.FEATURE_FIRST_TERM_MATCH_TOKEN_FRACTION=l.tokens[0].length/t.length;return true}return false});if(j.features.FEATURE_SECOND_TERM_MATCH_TOKEN<j.features.FEATURE_FIRST_TERM_MATCH_POSITION)j.features.FEATURE_IN_ORDER_MATCH=0}}return j},processEntityResult:function i(j,k,l,m,n,o,p,q,r){var s={semantic:k.toString(),structure:[{type:j===c("FacebarJSConstants").keywordType?j:"ent:"+j,text:l,uid:k}],type:j,cost:m,cache_id_length:0,features:[]};s.tuid=JSON.stringify({semantic:s.semantic,structure:s.structure});if(c("FacebarGlobalOptions").enableBootstrapRanking){s.termMatches=p[k.toString()];s=this.addFeatures(s,l.toLowerCase(),n,o,q,r)}return s},getRawTextFromStructured:function i(j){var k=j.map(function(l){return l.getText()});return k.join("")},getTextFromResult:function i(j){var k=j.structure,l="";k.forEach(function(m){l+=m.text});return l}};f.exports=h}),null);
__d("HashtagParser",["URLMatcher","getHashtagRegex"],(function a(b,c,d,e,f,g){__p&&__p();var h=100,i=30,j=/@\[([0-9]+):([0-9]+):((?:[^\\\]]*(?:\\.)*)*)\]/g;function k(C){__p&&__p();var D=x(C),E=0,F=0;return m(C).map(function(G){while(E<D.length){var H=D[E],I=H.offset-F;if(I<G.offset){F+=H.token.length-H.name.length;E++}else break}return{marker:G.marker,tag:G.hashtag,rawOffset:G.offset+F,offset:G.offset}})}function l(C){return n(C,s(C))}function m(C){var D=z(C);return n(D,o(C,D))}function n(C,D){return q(C).slice(0,i).filter(function(E){var F=u(E.offset,E.hashtag.length,D);return!F&&E.hashtag.length<=h})}function o(C,D){return t(r(C),s(D))}var p=c("getHashtagRegex")();function q(C){var D=[];C.replace(p,function(E,F,G,H,I){D.push({marker:G,hashtag:H,offset:I+F.length})});return D}function r(C){return A(C).map(function(D){return[D.offset,D.name.length]})}function s(C){var D=[],E,F=0;while(E=c("URLMatcher").permissiveMatch(C)){var G=C.indexOf(E);D.push([F+G,E.length]);C=C.substring(G+E.length);F+=G+E.length}return D}function t(C,D){var E=[],F=0,G=0,H=0;while(F<C.length&&G<D.length)if(C[F][0]>D[G][0])E[H++]=D[G++];else E[H++]=C[F++];return E.concat(C.slice(F),D.slice(G))}function u(C,D,E){if(!E)return false;var F=w(E,C);return v(C,D,E,F)||v(C,D,E,F+1)}function v(C,D,E,F){if(!E[F])return false;var G=E[F][0],H=E[F][1];return!(C+D-1<G||C>G+H-1)}function w(C,D){__p&&__p();var E=0,F=C.length-1;while(E<=F){var G=Math.floor((E+F)/2),H=C[G][0];if(H==D)return G;else if(H<D)E=G+1;else F=G-1}return F}function x(C){var D=[];C.replace(j,function(E,F,G,H,I){D.push({token:E,id:F,type:G,name:H,offset:I})});return D}function y(C){return C?C.replace(/\\([^\\])/g,"$1").replace(/\\\\/g,"\\"):null}function z(C){return C.replace(j,function(D,E,F,G,H){return y(G)})}function A(C){var D=0,E=0;return x(C).map(function(F){var G=C.indexOf(F.token,E);E=G+1;G-=D;var H=y(F.name);D+=F.token.length-H.length;if(G>=0)return{id:F.id,name:H,type:F.type,offset:G}})}var B={};B.parse=k;B.parseWithoutMentions=l;f.exports=B}),null);
__d("HashtagSearchResultUtils",["fbt","FacebarResultStoreUtils","HashtagParser","HashtagSearchResultConfig","URI"],(function a(b,c,d,e,f,g,h){__p&&__p();var i={getHashtagFromQuery:function j(k){var l=c("HashtagParser").parse(k);if(l&&l.length===1&&l[0].offset===0)return l[0].tag;return false},makeTypeaheadResult:function j(k){var l=h._("Hashtag");return{category:l,path:new(c("URI"))("/hashtag/"+k).toString(),photo:c("HashtagSearchResultConfig").image_url,rankType:null,replace_results:c("HashtagSearchResultConfig").boost_result?true:false,scaled_score:1,score:0,text:"#"+k,type:"hashtag_exact",uid:"hashtag:"+k}},makeFacebarEntry:function j(k){var l=h._("Hashtag");return{category:l,path:new(c("URI"))("/hashtag/"+k).toString(),photo:c("HashtagSearchResultConfig").image_url,replace_results:c("HashtagSearchResultConfig").boost_result?true:false,text:"#"+k,type:"hashtag_exact",uid:"hashtag:"+k}},makeFacebarResult:function j(k){var l=c("FacebarResultStoreUtils").processEntityResult("hashtag_exact","hashtag:"+k,"#"+k,c("HashtagSearchResultConfig").hashtag_cost);l.parse={display:[{type:"ent:hashtag_exact",uid:"hashtag:"+k}],remTokens:[],suffix:""};l.tags={hashtag:"hashtag"};return l}};f.exports=i}),null);
__d("FacebarFindPeopleAndPages",["cx","fbt","FacebarGlobalOptions","FacebarJSConstants","FacebarStructuredText","FacebarURI","URI"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j={insertInto:function k(l,m,n){l=this._cleanQuery(l);var o=this._getInsertionIndex(l,m);if(o>-1){var p=this._createFindPeopleAndPagesResult(l,n);m.splice(o,0,p)}},_getInsertionIndex:function k(l,m){__p&&__p();if(!l||!c("FacebarGlobalOptions").findPeopleAndPages)return-1;var n=m.some(this._isUserOrPageSuggestion);if(!n)return-1;var o=-1;for(var p=0;p<m.length;p++)if(this._isEntitySuggestion(m[p]))o=p+1;return o},_isUserOrPageSuggestion:function k(l){return l.type==="user"||l.type==="page"},_isEntitySuggestion:function k(l){return l.type!==c("FacebarJSConstants").keywordType&&l.type!==c("FacebarJSConstants").grammarType},_cleanQuery:function k(l){return String(l).trim().replace(/\s+/g," ").replace(/[\u200E|\u200F|\u202a|\u202b|\u202c]/g,"")},_createFindPeopleAndPagesResult:function k(l,m){var n="str/"+l+"/keywords_entities",o=i._("Find all people and pages named \"{query}\"",[i.param("query",l)]);return{type:"grammar",results_set_type:"browse_type_blended",text:l,id:l,uid:l,query_string:l,icon_class:"_207",isSeeMore:true,isPeopleAndPagesSuggestion:true,structure:c("FacebarStructuredText").fromString(o),semantic:n,uri:c("FacebarURI").getQualifiedURI(new(c("URI"))("/search/"+n)),fromCache:m,tags:{displayedSeeMore:true}}}};f.exports=j}),null);
__d("FacebarGSv2Echo",["cx","fbt","CurrentUser","FacebarGlobalOptions","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarStructuredText"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j={insertInto:function k(l,m,n,o,p,q){__p&&__p();var r=j.normalizeValue(l);if(!this._shouldInsert(l,m))return;var s=m.findIndex(function(w){return w.isSpecialIntent&&this._isKeywordSuggestion(w)&&r===j.normalizeValue(w.text)}.bind(this),this),t=c("FacebarGlobalOptions").showEcho&&(!c("FacebarGlobalOptions").renderKeywordSnippets||s<0);if(!t)return;var u=this._removeExactMatchAndReturnSubtext(l,m),v=this._createEchoResult(l,n,u,o,p,q);if(o){if(v!=null)m.unshift(v)}else if(v!=null)if(c("FacebarGlobalOptions").hasEchoOnTop)m.unshift(v);else m.push(v)},_shouldInsert:function k(l,m){__p&&__p();l=j.normalizeValue(l);if(!l||!c("FacebarGlobalOptions").graphSearchV2)return false;for(var n=0;n<m.length;n++){var o=m[n],p=c("FacebarStructuredText").fromStruct(o.structure).toString().toLowerCase();if((c("FacebarGlobalOptions").hasKeywordOnlyTypeahead&&o.type!==c("FacebarJSConstants").keywordType||o.type===c("FacebarJSConstants").keywordType)&&l.toLowerCase()===p){if(c("FacebarGlobalOptions").hasEchoOnTop)m.unshift(o);return false}}return true},_isKeywordSuggestion:function k(l){return l.type===c("FacebarJSConstants").keywordType||l.type===c("FacebarJSConstants").grammarType},_removeExactMatchAndReturnSubtext:function k(l,m){__p&&__p();var n="";l=j.normalizeValue(l);for(var o=0;o<m.length;o++){var p=m[o];if(this._isKeywordSuggestion(p)&&l===j.normalizeValue(p.text)){if(p.subtext)n=p.subtext;m.splice(o,1);return n}}return n},normalizeValue:function k(l){return String(l).trim().replace(/\s+/g," ").replace(/[\u200E|\u200F|\u202a|\u202b|\u202c]/g,"").toLowerCase()},_createEchoResult:function k(l,m,n,o,p,q){__p&&__p();var r=j.normalizeValue(l),s=o&&p&&c("FacebarGlobalOptions").showLocalPinkKwsSingleState&&l instanceof c("FacebarStructuredText")&&l.getFragment(0)&&l.getFragment(0).isLocal();if(s&&c("FacebarGlobalOptions").singleStateAsyncLocalPlaceEcho)return null;var t=s?c("FacebarKeywordSearchUtils").makeFacebarEntryForLocalPage(l):c("FacebarKeywordSearchUtils").makeFacebarEntry(r),u=s?c("FacebarJSConstants").keywordTypes.local:c("FacebarJSConstants").keywordTypes.keyword,v={};if(c("FacebarGlobalOptions").renderKeywordSnippets)if(s){v.subtext=n||i._("See photos, posts and info about this place");if(q!==null)v.boldedSubtext=i._("{categoryName}",[i.param("categoryName",q)])}else if(o&&c("FacebarGlobalOptions").singleStateClientInjections)v.boldedSubtext=n||i._("Posts");else if(c("CurrentUser").isWorkUser())v.subtext=n||i._("Search Workplace");else v.subtext=n||i._("Search Facebook");return babelHelpers["extends"]({type:c("FacebarJSConstants").keywordType,results_set_type:c("FacebarJSConstants").browseTypes.keyword,text:l,id:r,uid:r,query_string:r,icon_class:"_5b1w",isSingleState:o,isLocal:s,exactMatchKeyword:true,structure:c("FacebarStructuredText").fromString(String(l)),semantic:t.semantic,uri:t.uri,keywordType:u,keywordSource:c("FacebarJSConstants").keywordTypes.echo,fromCache:m,tags:{}},v)}};f.exports=j}),null);
__d("FacebarInviteCoworkers",["cx","fbt","FacebarGlobalOptions","FacebarStructuredText","WorkInviteSource","XWorkInviteCoworkersDialogController"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j={insertInto:function k(l,m,n){l=this._cleanQuery(l);var o=this._getInsertionIndex(l,m);if(o>-1){var p=this._createInviteCoworkersResult(l,n);m.splice(o,0,p)}},_getInsertionIndex:function k(l,m){if(!l||!c("FacebarGlobalOptions").inviteCoworkers)return-1;return m.length},_cleanQuery:function k(l){return String(l).trim().replace(/\s+/g," ").replace(/[\u200E|\u200F|\u202a|\u202b|\u202c]/g,"")},_createInviteCoworkersResult:function k(l,m){var n=i._("Invite \"{query}\" to Workplace",[i.param("query",l)]),o=c("XWorkInviteCoworkersDialogController").getURIBuilder().setEnum("source",c("WorkInviteSource").SEARCH_TYPEAHEAD).getURI();return{uid:l,icon_class:"_5yiv",isAsync:false,isInviteCoworkers:true,structure:c("FacebarStructuredText").fromString(n),asyncURI:o,fromCache:m}}};f.exports=j}),null);
__d("SearchPivotType",[],(function a(b,c,d,e,f,g){f.exports=Object.freeze({PHOTO:"photo",PHOTO_EXPERIMENTAL:"photo_experimental",VIDEO:"video",FEED_SEARCH_KEYWORDS:"feed_search_keywords",SEARCH_AWARENESS_KEYWORDS:"search_awareness_keywords",ARTICLE_CLICK_ACTION:"ARTICLE_CLICK_ACTION",STORY_CLICK_ACTION:"STORY_CLICK_ACTION",STORY_LIKE_ACTION:"STORY_LIKE_ACTION",STORY_UNLIKE_ACTION:"STORY_UNLIKE_ACTION",STORY_COMMENT_DELETE_ACTION:"STORY_COMMENT_DELETE_ACTION",COMPOSER_PUBLISH_ACTION:"COMPOSER_PUBLISH_ACTION",FAN_PAGE_ACTION:"FAN_PAGE_ACTION",TRENDING_SERP_LOAD:"TRENDING_SERP_LOAD",PHOTOS_SERP_LOAD:"PHOTOS_SERP_LOAD",STORY_COMMENT_ACTION:"STORY_COMMENT_ACTION",SCROLL_ACTION:"SCROLL_ACTION",NEWS_FEED:"NEWS_FEED",PAGE:"PAGE",GROUP:"GROUP",NEWS_FEED_SECONDARY:"NEWS_FEED_SECONDARY",POST_SEARCH_SERP:"POST_SEARCH_SERP",LEARNING_NUX:"LEARNING_NUX",LEARNING_NUX_SECOND_STEP:"LEARNING_NUX_SECOND_STEP",MOBILE_STORY_LIKE_ACTION:"MOBILE_STORY_LIKE_ACTION",MOBILE_STORY_COMMENT_ACTION:"MOBILE_STORY_COMMENT_ACTION",MOBILE_COMMENT_LIKE_ACTION:"MOBILE_COMMENT_LIKE_ACTION",TIMELINE:"TIMELINE",NEXT_TRENDING:"NEXT_TRENDING",LEARNING_NUX_STANDALONE:"LEARNING_NUX_STANDALONE",TUTORIAL_NUX:"TUTORIAL_NUX",FEED_READ_ACTION:"FEED_READ_ACTION",NON_TRIGGERED_LEARNING_NUX:"NON_TRIGGERED_LEARNING_NUX",TYPEAHEAD_TOOLTIP:"TYPEAHEAD_TOOLTIP",TRIGGERED_LEARNING_NUX:"TRIGGERED_LEARNING_NUX",S19N_NUX:"S19N_NUX"})}),null);
__d("FacebarResultStore",["cx","fbt","Arbiter","FacebarGlobalOptions","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarResultStoreUtils","FacebarStructuredText","KeywordsSearchResultConfig","SearchI18nMatch","SearchPivotType","TokenizeUtil","concatMap"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j=3;function k(o,p,q,r){__p&&__p();this._extractStructure=function(s){__p&&__p();function t(w,x,y,z,A){return{type:w==="ent:extend_string"?"text":w,text:x,uid:y||null,isLocal:z?z:false,categoryName:A?A:null}}function u(w,x){w.split(" ").forEach(function(y){if(y!==""){if(x)s.chunks.push(s.structure.length);s.structure.push(t("text",y))}s.structure.push(t("text"," "))});s.structure.pop()}function v(w){if(s.structure.length!==0||c("FacebarJSConstants").nonGrammarTypes[s.type])return w;return w.charAt(0).toUpperCase()+w.substr(1)}s.structure=[];s.chunks=[];s.parse.display.forEach(function(w){__p&&__p();if(typeof w==="string")u(v(w),true);else if(w.type==="ent:extend_string")u(w.text,true);else if(w.uid){var x=this.getEntry(w.uid,w.fetchType);s.chunks.push(s.structure.length);if(x==null)throw new Error('No entry found for uid "'+w.uid+'", type "'+w.fetchType+'" and piece text "'+w.text+'"');if(x.grammar_like)u(v(x.text),false);else{var y=w.type;if(w.fetchType)y+=":"+w.fetchType;s.structure.push(t(y,x.text,w.uid,s.isLocal,s.categoryName))}}else if(w.type=="blank"){s.chunks.push(s.structure.length);s.structure.push(t(w.type,"..."))}},this);return s}.bind(this);this._processBackendResult=function(s){__p&&__p();if(s.semantic==null)throw new Error("Facebar can't process empty semantic "+JSON.stringify(s));s.semantic=s.semantic.toString();s.backendCost=s.cost;this._extractStructure(s);if(s.type.match(/^\{.*\}$/))s.useExtendedIndex=true;if(s.alternateSemantic)s.alternateSemantic=s.alternateSemantic.toLowerCase().replace(/\[(\d*)\]/g,"$1");if(s.semantic.match(/\[\d*\]/)){var t=s.parse,u=t.pos;if(u===undefined)s.semantic=s.semantic.replace(/\[(\d*)\]/g,"$1");else{var v=t.remTokens[t.remTokens.length-1];if(t.remTokens.length&&s.structure[s.chunks[v]]&&s.structure[s.chunks[v]].uid){u=t.remTokens[t.remTokens.length-1];s.completed=true}var w=s.structure[s.chunks[u]].uid;if(w===null)s.semantic=s.semantic.replace(/\[(\d*)\]/g,"$1");else{var x=new RegExp("\\["+w+"\\]","g");s.unsubstituted_semantic=s.semantic;s.semantic=s.semantic.replace(x,w);if(t&&t.disambiguation&&t.disambiguation.length>0){t.disambiguation=t.disambiguation.filter(function(y){return y.indexOf("["+w+"]")!==-1});t.unsubstituted_disambiguation=t.disambiguation.splice(0);t.disambiguation=t.disambiguation.map(function(y){return y.replace(x,w)})}}}}s.semantic=s.semantic.replace(/\[(.*)\]/g,"$1");s.tuid=JSON.stringify({semantic:s.semantic,structure:s.structure});return s}.bind(this);this.facebarConfig=o;this.facebarConfig.grammar_stop_words_penalty=this.facebarConfig.grammar_stop_words_penalty||2;this.facebarConfig.grammar_stop_words=this.facebarConfig.grammar_stop_words||{};this.facebarConfig.options=r;this.injectedSuggestionCount=0;this.tokenize=p;this.getEntry=q;this.typeaheadTypeMap=this.facebarConfig.mapped_types;this.facebarConfig.typeahead_types.forEach(function(s){this.typeaheadTypeMap[s]=s},this);this.unicodeMatch=new(c("SearchI18nMatch"))({prefix_hangul_conjoining_jamo:true});this.resetCaches()}k.prototype.transformStructured=function(o){__p&&__p();var p=[],q=[],r="",s="";o.forEach(function(x,y){__p&&__p();if(x.isType("text")){r+=x.getText();s=s==null?null:s+x.getText()}else{var z=r.match(/\"/g);if(z&&z.length%2)r=r.replace(/\s+$/,"")+'"';if(r.length){Array.prototype.push.apply(p,this.tokenize(r));q.push(r);r=""}p.push(x.toStruct());q.push({uid:String(x.getUID()),type:this._getFBObjectType(x.getTypePart(1)),text:x.getText()});s=null}},this);var t=false,u=r;if(r.length){if(r[r.length-1]=="'")r=r.substr(0,r.length-1);if(r.length>0&&r[0]==="#")Array.prototype.push.call(p,r);else if(r.length>0&&r[0]==="@"){t=true;u=this._convertToAliasKey(r.substring(1));Array.prototype.push.call(p,u)}else{u=this._convertToAliasKey(r);Array.prototype.push.apply(p,this.tokenize(r))}q.push(r);if(r[r.length-1]==" ")p.push("")}var v=JSON.stringify(q),w=v.replace(/\]$/,"").replace(/\"$/,"");w=w.replace(/\s{2,}/g," ");return{tokens:p,text_form:v,is_empty:!!v.match(/^\[(\"\s*\")?\]$/),raw_text:s,cache_id:w,is_alias_search:t,potential_alias_term:u}};k.prototype.resetCaches=function(){this.resetBootstrapCache();this.resetQueryCache()};k.prototype.resetBootstrapCache=function(){this.bootstrapCache={}};k.prototype.resetQueryCache=function(){this.queryCache={"":{tokens:[],results:[]}}};k.prototype.setNullState=function(o){this.facebarConfig.null_state=o.map(this._extractStructure,this)};k.prototype.addEntryToNullState=function(o){if(this.facebarConfig.null_state){var p=this.facebarConfig.entity_cost+o.grammar_costs["{"+o.type+"}"],q=c("FacebarResultStoreUtils").processEntityResult(o.type,o.uid,o.text,p);this.facebarConfig.null_state.unshift(q)}};k.prototype.addRecentEntryToNullState=function(o){__p&&__p();if(!this.facebarConfig.null_state||c("FacebarGlobalOptions").hasKeywordOnlyTypeahead)return;this.removeDuplicateInNullstateIfAvailable(o);var p=babelHelpers["extends"]({},o,{isRecent:true,isNullState:true,type:c("FacebarJSConstants").keywordType,structure:c("FacebarStructuredText").fromString(o.text.toString()),tuid:JSON.stringify({semantic:o.semantic,structure:o.structure}),keyword_type:o.keywordType});if(o.icon_class)p.iconClass=o.icon_class;if(o.keywordBootstrapType===c("FacebarJSConstants").keywordBootstrapTypes.recent){p.iconClass="_5b1w";delete p.keywordBootstrapType}if(o.results_set_type)p.resultsSetType=o.results_set_type;p.isInjectedSuggestion=false;this.insertEntryIntoRightPosition(p,true)};k.prototype.addSuggestionEntryToNullState=function(o,p){__p&&__p();if(!this.facebarConfig.null_state||this.injectedSuggestionCount===j)return;var q=this.removeDuplicateInNullstateIfAvailable(o);switch(p){case c("SearchPivotType").STORY_LIKE_ACTION:this.category=i._("Based on posts you liked");break;case c("SearchPivotType").STORY_COMMENT_ACTION:this.category=i._("Based on posts you commented on");break;default:this.category=i._("Based on posts you interacted with")}var r=babelHelpers["extends"]({},o,{isRecent:false,isSuggestion:true,isTrending:false,isNullState:true,type:c("FacebarJSConstants").keywordType,structure:[{text:o.text,type:"keyword"}],tuid:JSON.stringify({semantic:o.semantic,structure:o.text}),isInjectedSuggestion:true,category:this.category});if(!c("FacebarGlobalOptions").hasRecentOnTopNullState)r.null_state_position="top";this.insertEntryIntoRightPosition(r,false);if(!q){c("Arbiter").inform("FacebarTypeahead.injectedSuggestion");++this.injectedSuggestionCount}};k.prototype.removeDuplicateInNullstateIfAvailable=function(o){__p&&__p();var p,q=false;if(o.isInjectedSuggestion)p=o.semantic;else p=decodeURIComponent(o.semantic);for(var r=0;r<this.facebarConfig.null_state.length;r++){var s=this.facebarConfig.null_state[r];if(s.semantic===p){this.facebarConfig.null_state.splice(r,1);q=true;break}}return q};k.prototype.clearRecentSearches=function(){if(!this.facebarConfig.null_state)return;this.facebarConfig.null_state=this.facebarConfig.null_state.filter(function(o){return!o.isRecent})};k.prototype.insertEntryIntoRightPosition=function(o,p){__p&&__p();var q=p?this.facebarConfig.null_state.findIndex(function(s){return s.isRecent}):this.facebarConfig.null_state.findIndex(function(s){return s.isSuggestion}),r=p?c("FacebarGlobalOptions").hasRecentOnTopNullState:!c("FacebarGlobalOptions").hasRecentOnTopNullState;if(q<0){if(r)this.facebarConfig.null_state.unshift(o);else{if(this.facebarConfig.null_state.length>=c("FacebarGlobalOptions").maxResultCount)this.facebarConfig.null_state.shift();this.facebarConfig.null_state.push(o)}return}this.facebarConfig.null_state.splice(q,0,o)};k.prototype.setSortFunction=function(o){this._sortFunction=o};k.prototype.addBootstrap=function(o){__p&&__p();var p=this.bootstrapCache;o.forEach(function(q){__p&&__p();var r=this.getEntry(q);r.bootstrapped=true;var s=this.tokenize(r.textToIndex,true);if(r.tokens)Array.prototype.push.apply(s,r.tokens.split(" "));Array.prototype.push.apply(s,this.getExtraTokensToIndex(r));s.forEach(function(t){if(!Object.prototype.hasOwnProperty.call(p,t))p[t]={};p[t][q]=true})},this)};k.prototype._convertToAliasKey=function(o){return o.replace(/\./g,"").toLowerCase()};k.prototype.getExtraTokensToIndex=function(o){var p=[];if(o.alias!=null&&!c("FacebarGlobalOptions").disableAliasMatches){var q=this._convertToAliasKey(o.alias);if(q.length>0)p.push(q)}return p};k.prototype.addNullStateToQueryCache=function(o){this.saveResults(this.facebarConfig.null_state,o,true)};k.prototype.getResults=function(o,p){__p&&__p();if(o.tokens.length===0||o.tokens.length==1&&o.tokens[0]==="")return{results:this.facebarConfig.null_state||[],null_state:true};var q=this._getBestQueryCache(o.cache_id),r=q.results.filter(function(C){return!C.isRecent}),s={},t=this._getBootstrapMatchByType(o,s),u=this._addMatchingBootstrapResults(o,t[0]||{},s,[]);if(c("FacebarGlobalOptions").limitBootstrapResult)u=u.slice(0,c("FacebarGlobalOptions").limitBootstrapResultNum);var v=[],w=[],x=void 0;if(c("FacebarGlobalOptions").disableBootstrapQueryNormalization&&o.raw_text!=null)x=o.raw_text.toLowerCase();else x=o.tokens.map(function(C){return C.text!=null?C.text:C}).join(" ").toLowerCase();if(c("FacebarGlobalOptions").hasKeywordBootstrap){v=u.filter(function(C){return C.type===c("FacebarJSConstants").keywordType&&this.unicodeMatch.prefixMatch(C.structure[0].text.toLowerCase(),x)}.bind(this));v.sort(this._sortFunction(o.raw_text));w=u.filter(function(C){return C.type!==c("FacebarJSConstants").keywordType&&this.unicodeMatch.prefixMatch(C.structure[0].text.toLowerCase(),x)}.bind(this));w.sort(this._sortFunction(o.raw_text));u=w.concat(v)}Array.prototype.push.apply(u,c("concatMap")(this._getResultsFromCache.bind(this,t,o),r));if(!c("FacebarGlobalOptions").hasKeywordBootstrap){u.sort(this._sortFunction(o.raw_text));if(!c("FacebarGlobalOptions").graphSearchV2&&c("FacebarGlobalOptions").keywordSearchEnabled)c("FacebarKeywordSearchUtils").addExactMatch(o,u,p)}var y={},z=[],A=false,B=0;u.forEach(function(C){__p&&__p();var D=c("FacebarStructuredText").fromStruct(C.structure);if(D.hasType("blank")){z.push(C);return}C.semantic=C.semantic.toLowerCase();if(!C.termMatches)C.termMatches=s[C.semantic];var E=n(C,C.semantic),F=n(C,C.alternateSemantic);if(!E)return;var G=y[E]||F!=null&&y[F];if(G){if(C.isJSBootstrapMatch){G.isJSBootstrapMatch=true;G.bootstrapCost=C.bootstrapCost}else if(G.isJSBootstrapMatch&&C.backendCost!==undefined&&G.backendCost===undefined)G.backendCost=C.backendCost;if(C.tags!=null)Object.assign(G.tags||{},C.tags);if(c("FacebarGlobalOptions").dedupeLocalResults&&l(C)&&G.keyword_type==="keyword")Object.assign(G,C);return}if(A&&C.blankFilled)return;if(C.type.indexOf("browse_type")>=0){B+=1;if(this.facebarConfig.maxGrammarResults!==undefined&&B>this.facebarConfig.maxGrammarResults)return}A=A||!!C.blankFilled;y[E]=C;if(F)y[F]=C;z.push(C)},this);return{results:z}};k.prototype.saveResults=function(o,p,q,r){__p&&__p();o=o.map(this._processBackendResult,this);var s=[],t={},u={};o.forEach(function(w){u[w.semantic]=true});var v=this._getBestQueryCache(p.cache_id);v.results.forEach(function(w){__p&&__p();if(w.type==="websuggestion")return;if(w.exactMatchKeyword)return;if(w.semantic in t)return;var x=this._getDifferenceArrayTokens(w.tokens,p.tokens),y=this._getNumTokensMatching(x,w);y=this._tryMatchingFinalInsertedEntity(x,y,w);if(y>0&&y==x.length||(w.type==="shortcut"&&w.termMatches.indexOf(p.tokens[p.tokens.length-1]))>=0){w.cacheOnlyResult=!u[w.semantic];s.push(w)}},this);if(c("FacebarGlobalOptions").limitCacheResult)s=s.slice(0,c("FacebarGlobalOptions").limitCacheResultNum);o.forEach(function(w){w.tokens=p.tokens;w.cache_id_length=p.cache_id.length;if(!!w.isTypeNamedXBootstrap)++w.cache_id_length;s.push(w)},this);if(this.queryCache[p.cache_id]===undefined)this.queryCache[p.cache_id]={};Object.assign(this.queryCache[p.cache_id],{tokens:p.tokens,results:s,incomplete:q},r)};k.prototype.alreadyKnown=function(o){return!!this.queryCache[o]&&!this.queryCache[o].incomplete};k.prototype.stripBrackets=function(o){return o.replace(/^[\[\{]/,"").replace(/[\]\}]$/,"")};k.prototype._getDifferenceArrayTokens=function(o,p){__p&&__p();if(!o.length)return[""].concat(p);var q=o.length-1,r=o[q];if(r==="")r=o[--q];var s="";if(typeof r=="string"&&q<p.length)s=p[q].substr(r.length);if(!c("FacebarGlobalOptions").matchTrailingWhitespace)if(s===""&&q+1<p.length&&p[q+1]==="")return[""];return[s].concat(p.slice(q+1))};k.prototype._sortFunction=function(o){return function(p,q){return(p.cost||0)-(q.cost||0)}};k.prototype._getResultsFromCache=function(o,p,q){var r=p.tokens,s=this._getDifferenceArrayTokens(q.tokens,r),t=[],u=this._getNumTokensMatching(s,q),v=this._tryMatchingFinalInsertedEntity(s,u,q);if(v>0&&v==s.length&&!(q.type===c("KeywordsSearchResultConfig").result_type&&s.length===1&&s[0]==='"'))t.push(q);if(q.type==="shortcut"&&q.termMatches.indexOf(p.tokens[r-1])>=0)t.push(q);return t};k.prototype._addMatchingBootstrapResults=function(o,p,q,r){__p&&__p();var s=o.tokens;return c("concatMap")(function(t){__p&&__p();var u=p[t];if(u===undefined)return[];var v=[],w=c("FacebarResultStoreUtils").getQueryFeatures(o);u.forEach(function(x){__p&&__p();var y=this.getEntry(x,t);if(o.is_alias_search){if(!this._isAliasMatch(o,y,false))return}else if(!this._isTitleTermMatch(s,y)&&!this._isAliasMatch(o,y,false)&&!r.includes(x))return;var z=this._isExactNameMatch(s,y)||this._isAliasMatch(o,y,true),A=z?0:this.facebarConfig.non_title_term_match_penalty,B=this._isNonGrammarTermMatch(s,y),C=y.grammar_costs?y.grammar_costs["{"+t+"}"]:0,D=t===c("FacebarJSConstants").keywordType?y.cost:0,E=D+C+A+this.facebarConfig.entity_cost+this.facebarConfig.grammar_stop_words_penalty*!B,F=c("FacebarResultStoreUtils").processEntityResult(t,x,y.text,E,o,w,q,z,!B);F.bootstrapCost=E;F.isJSBootstrapMatch=true;if(t===c("FacebarJSConstants").keywordType){F.iconClass=y.iconClass;F.keywordBootstrapType=y.keywordBootstrapType;F.parse=y.parse;F.subtext=y.subtext;F.boldedSubtext=y.boldedSubtext;F.semantic=y.semantic;F.popularSearchScore=y.popularSearchScore;F.trendingTopicID=y.trendingTopicID;F.photo=y.photo;F.keyword_type=y.keyword_type;F.keywordSource=y.keywordSource;F.item_logging_info=y.item_logging_info;F.item_logging_id=y.item_loggind_id}v.push(F)},this);return v}.bind(this),this.facebarConfig.bootstrap_types)};k.prototype._isTitleTermMatch=function(o,p){var q=o[0]||{};if(typeof q=="object")return false;var r=p.titleToIndex;return o.length===1?this._isTokenizePrefixMatch(q,r):c("TokenizeUtil").isExactMatch(q,r)};k.prototype._isExactNameMatch=function(o,p){var q=o[0]||{};if(typeof q=="object")return false;var r=p.text;for(var s=0;s<o.length-1;++s)if(o[s]!==""&&!c("TokenizeUtil").isExactMatch(o[s],r))return false;return o.length>0&&this._isTokenizePrefixMatch(o[o.length-1],r)};k.prototype._isAliasMatch=function(o,p,q){if(p.alias==null||o.potential_alias_term==null)return false;var r=this._convertToAliasKey(p.alias);if(q||!o.is_alias_search)return c("TokenizeUtil").isExactMatch(o.potential_alias_term,r);else return c("TokenizeUtil").isPrefixMatch(o.potential_alias_term,r)};k.prototype._isNonGrammarTermMatch=function(o,p){__p&&__p();var q=c("TokenizeUtil").parse(p.titleToIndex.toLowerCase()),r=q.tokens.filter(function(u){return u!==""&&!this.facebarConfig.grammar_stop_words[u]},this);r=r.join(" ");for(var s=0;s<o.length;++s){if(typeof o[s]=="object")return true;var t=s===o.length-1?this._isTokenizePrefixMatch(o[s],r):c("TokenizeUtil").isQueryMatch(o[s],r);if(t)return true}return false};k.prototype._getBootstrapMatchByType=function(o,p){__p&&__p();var q=arguments.length<=2||arguments[2]===undefined?[]:arguments[2],r=o.tokens.slice();if(r.length===0)return[];var s=r.map(function(){return{}}),t=r[r.length-1]==="",u={},v,w=t?r.length-1:r.length,x=r[w-1];if(w&&x.uid){this._pushBootstrapEntryAtPosition(s,w-1,x.uid,o.is_alias_search);return s}for(var y in this.bootstrapCache)if(w&&this.unicodeMatch.prefixMatch(y,x)&&(!t||y===x))for(v in this.bootstrapCache[y]){this._addMatchedTerm(v,y,p);if(!u[v]){u[v]=1;this._pushBootstrapEntryAtPosition(s,w-1,v,o.is_alias_search)}}for(var z=w-2;z>=0;z--){if(typeof r[z]=="object")break;if(r[z].length&&r[z][0]=='"')break;for(v in this.bootstrapCache[r[z]]){if(!u[v])u[v]=0;if(u[v]+z==w-1){++u[v];this._addMatchedTerm(v,r[z],p);this._pushBootstrapEntryAtPosition(s,z,v,o.is_alias_search)}}}if(!o.is_alias_search&&o.potential_alias_term)for(v in this.bootstrapCache[o.potential_alias_term]){this._addMatchedTerm(v,o.potential_alias_term,p);if(!u[v]){u[v]=1;this._pushBootstrapEntryAtPosition(s,0,v,o.is_alias_search)}}for(var A=q,B=Array.isArray(A),C=0,A=B?A:A[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var D;if(B){if(C>=A.length)break;D=A[C++]}else{C=A.next();if(C.done)break;D=C.value}var E=D;if(this.getEntry(E)&&!u[E]){u[E]=1;this._pushBootstrapEntryAtPosition(s,0,E,o.is_alias_search)}}return s};k.prototype._addMatchedTerm=function(o,p,q){(q[o]=q[o]||[]).push(p);return q};k.prototype._pushBootstrapEntryAtPosition=function(o,p,q,r){__p&&__p();var s=this.getEntry(q);if(!s)return;var t=[];if(!c("FacebarGlobalOptions").ignoreGrammarCostsForBootstrap&&s.grammar_costs)t=Object.keys(s.grammar_costs).map(function(w){return this.stripBrackets(w)},this);else t=[s.type];for(var u=0;u<t.length;u++){var v=t[u];if(r&&v!=="user"&&v!=="page")continue;if(o[p][v]===undefined)o[p][v]=[];o[p][v].push(q)}};k.prototype._getNumTokensMatching=function(o,p){__p&&__p();var q=0,r=p.parse,s=o.length,t=null,u=null;if(r.pos!==undefined){var v=p.structure[p.chunks[r.pos]];if(v){t=v.uid;u=v.type.split(":")[2]}}p.outputTokensUsed=[];p.termMatches=[];if(t){q=this._prefixMatchEntity(o,r,t,p.outputTokensUsed,u,!!p.useExtendedIndex,p.termMatches);if(q===0||q===s)return q}else if(r.suffix&&s==1&&r.suffix.indexOf(o[0])===0)return s;else if(r.suffix==o[0])++q;else return 0;var w=[];r.remTokens=r.remTokens||[];for(var x=0;x<r.remTokens.length;x++){if(typeof o[q]!="string"||p.chunks.length<=r.remTokens[x]||p.structure.length<=p.chunks[r.remTokens[x]]||p.structure[p.chunks[r.remTokens[x]]].uid)break;var y=p.structure[p.chunks[r.remTokens[x]]].text;w.push(y.toLowerCase())}q=this._greedyMatchText(w,o,q,r.remTokens,p.outputTokensUsed,p.isNullState);if(q==s-1&&o[q]==="")return s;return q};k.prototype._prefixMatchEntity=function(o,p,q,r,s,t,u){__p&&__p();p.entTokens=p.entTokens||[];if(p.entTokens.length===0){if(o[0]!=="")return 0;if(p.possessive&&o.length>1&&o[1]=="'s"){r.push([p.pos+1]);return 2}else return 1}var v=false,w=this.getEntry(q,s);if(s!==undefined&&s!==w.fetchType)return 0;var x=this.tokenize(t?w.textToIndex:w.text,true),y=[];for(var z=0;z<o.length+p.entTokens.length-1;z++)if(z<p.entTokens.length-1)y.push(p.entTokens[z]);else if(z==p.entTokens.length-1)y.push(p.entTokens[z]+o[0]);else y.push(o[z-p.entTokens.length+1]);var A=-p.entTokens.length+1;for(var B=0;B<y.length;++B){var C=y[B];if(typeof C!="string")break;if(C===""){A++;continue}var D=false;for(var E=0;E<x.length;E++)if(x[E]==C||B===y.length-1&&x[E].indexOf(C)===0){if(u)u.push(x[E]);x[E]="";D=true;++A;break}if(D)continue;if(!p.possessive||C.length<=2||C.substr(C.length-2)!="'s")break;var F=C.substr(0,C.length-2);for(E=0;E<x.length;E++)if(x[E]==F){++A;if(r)v=true;break}break}if(A>0){if(v)r.push([p.pos+1]);return A}if(r===undefined)return 0;var G=o[0],H=G;if(p.possessive&&G.length>=2&&G.substr(G.length-2)=="'s")H=G.substr(0,G.length-2);p.suffix=p.suffix||"";if(o.length==1&&p.suffix.indexOf(G)===0||p.suffix==H||p.suffix==G){if(H!=G&&p.suffix==H)r.push([p.pos+1]);return 1}return 0};k.prototype._tryMatchingFinalInsertedEntity=function(o,p,q){if(!q.completed||p<0)return p;var r=q.parse,s=r.remTokens[r.remTokens.length-1],t=q.structure[q.chunks[s]],u=this.getEntry(t.uid,t.type),v=this.tokenize(u.text,true);p=this._greedyMatchText(v,o,p);if(p==o.length-1&&o[p]==="")return o.length;return p};k.prototype._greedyMatchText=function(o,p,q,r,s,t){__p&&__p();for(var u=0;u<o.length;u++){var v=o[u];if(v==p[q]){if(s!==undefined)s.push(r[u]);++q;continue}if(q===p.length-1&&v.indexOf(p[q])===0){if(s!==undefined)if(v==p[q])s.push([r[u]]);else s.push([r[u],p[q].length]);return p.length}if(t)break}return q};k.prototype._getBestQueryCache=function(o){for(var p=o.length;p>=0;p--){var q=this.queryCache[o.slice(0,p)];if(q)return q}};k.prototype._getFBObjectType=function(o){if(this.typeaheadTypeMap[o])return this.typeaheadTypeMap[o];else return"page"};k.prototype._isTokenizePrefixMatch=function(o,p){return c("TokenizeUtil").isPrefixMatch(this.unicodeMatch.prefixMatchPrepare(o),this.unicodeMatch.prefixMatchPrepare(p))};k.prototype.getBootstrapMatches=function(o){var p=arguments.length<=1||arguments[1]===undefined?[]:arguments[1],q={},r=this._getBootstrapMatchByType(o,q,p?p:[]);return this._addMatchingBootstrapResults(o,r[0]||{},q,p?p:[])};k.EPSILON=1e-5;k.getUniqueSemantic=function(o){__p&&__p();if(!o)return;var p=[],q=[],r=[];o="("+o+")";var s=o,t=false;o.replace(/[\(\),]/g,function(u,v){__p&&__p();var w;switch(u){case",":var x=r.length-1;w=s.substr(r[x],v-r[x]);p[x].push(w);r[x]=v+1;break;case"(":r.push(v+1);p.push([]);q.push(v+1);break;case")":if(r.length===0)throw new Error(o+" is not a valid semantic string");var y=r.pop();w=s.substr(y,v-y);w=decodeURI(w.replace(/%/g,"%25").replace(/\s/g,"+").trim());var z=p.pop();z.push(w);var A=z.sort();for(var B=1;B<A.length;B++)if(A[B]==A[B-1])t=true;var C=A.join(",");s=s.substr(0,q.pop())+C+s.substr(v);break}return u});if(t)return"";return s.replace(/\((.*)\)/,"$1")};var l=function l(o){return o.keyword_type==="local"&&o.semantic.match(/[0-9]+\/local/)!=null},m=function m(o){if(!c("FacebarGlobalOptions").dedupeLocalResults||!l(o))return null;var p=encodeURIComponent(o.name.replace(/\s+/g,"+"));return"str/"+p+"/keywords_search"},n=function n(o,p){if(c("FacebarGlobalOptions").hasKeywordOnlyTypeahead)return c("FacebarStructuredText").fromStruct(o.structure).toString().toLowerCase();var q=m(o),r=q!=null?q:k.getUniqueSemantic(p);return r!=null?r.toLowerCase():null};f.exports=k}),null);
__d("FacebarSimplifiedNoFlickerResults",["cx","fbt","CurrentUser","FacebarGlobalOptions","FacebarGSv2Echo","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarStructuredText"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j=2,k={insertInto:function l(m){var n=m.filter(function(o){return o.type!=="keyword"});n.slice(0,j).forEach(function(o){return this._maybeAddResultFromEntity(m,o)}.bind(this))},_maybeAddResultFromEntity:function l(m,n){var o=this._createResult(n.text.toLowerCase());if(!this._resultsContainKeywordResult(m,o))m.push(o)},_createResult:function l(m){m=c("FacebarGSv2Echo").normalizeValue(m);var n=c("FacebarKeywordSearchUtils").makeFacebarEntry(m),o=void 0;if(c("FacebarGlobalOptions").renderKeywordSnippets)if(c("CurrentUser").isWorkUser())o=i._("Search Workplace");else o=i._("Search Facebook");return{type:c("FacebarJSConstants").keywordType,results_set_type:c("FacebarJSConstants").browseTypes.keyword,text:m,id:m,uid:m,query_string:m,icon_class:"_5b1w",exactMatchKeyword:true,structure:c("FacebarStructuredText").fromString(String(m)),semantic:n.semantic,uri:n.uri,subtext:o,tags:{}}},_resultsContainKeywordResult:function l(m,n){return m.some(function(o){return o.type==="keyword"&&c("FacebarGSv2Echo").normalizeValue(o.text)===c("FacebarGSv2Echo").normalizeValue(n.text)})}};f.exports=k}),null);
__d("FacebarTimerUtils",[],(function a(b,c,d,e,f,g){"use strict";var h={getTimestamp:function i(){return Date.now()}};f.exports=h}),null);
__d("FacebarTokenizer",["TokenizeUtil"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h='[^"]',i=["\\s's","'s",'"'+h+'*"?'],j=[[/\s+$/,""],[/\"\s+/,'"'],[/\s+\"/,'"'],[/\"\"/,""],[/^\"$/,""],[/\s+/," "]],k={tokenize:function l(m,n){__p&&__p();var o=[],p=0;m=m.replace(/\s/g," ").toLowerCase();m.replace(new RegExp(i.join("|"),"g"),function(r,s){__p&&__p();if(s>p){var t=m.substr(p,s-p);Array.prototype.push.apply(o,c("TokenizeUtil").parse(t).tokens.slice(0))}var u=r;for(var v=0;v<j.length;v++){var w=j[v];u=u.replace(w[0],w[1])}if(o.length&&u=="'s")o[o.length-1]+=u;else if(u!=="")o.push(u);if(n)Array.prototype.push.apply(o,c("TokenizeUtil").parse(r).tokens);p=s+r.length});if(p<m.length){var q=m.substr(p,m.length-p);Array.prototype.push.apply(o,c("TokenizeUtil").parse(q).tokens.slice(0))}return o}};f.exports=k}),null);
__d("ResultsBucketizer",["FacebarGlobalOptions","FacebarJSConstants"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i,j){this.$ResultsBucketizer1=i;this.$ResultsBucketizer2=j}h.trimResults=function(i,j,k){var l=[];i.forEach(function(m,n){if(m.indexBeforeBuckets>j)l.push({index:n,originalIndex:m.indexBeforeBuckets})});l.sort(function(m,n){return m.originalIndex-n.originalIndex}).slice(k).sort(function(m,n){return n.index-m.index}).forEach(function(m){i.splice(m.index,1)})};h.mergeBuckets=function(i,j){__p&&__p();var k=[];for(var l in j)if(!j[l].rule.hidden&&(!j[l].rule.xor||!j[j[l].rule.xor]))k.push(j[l]);k.sort(function(m,n){var o=(m.rule.position||0)-(n.rule.position||0);if(o!==0)return o;return m.results[0].indexBeforeBuckets-n.results[0].indexBeforeBuckets});i.length=0;k.forEach(function(m,n){if(m.rule.maxPromotions!=null&&n<k.length-1)h.trimResults(m.results,k[n+1].results[0].indexBeforeBuckets,m.rule.maxPromotions);Array.prototype.push.apply(i,m.results)}.bind(this))};h.prototype.$ResultsBucketizer3=function(i,j){if(j.propertyName==null)return j.bucketName||"default";var k=this.$ResultsBucketizer2(i,j.propertyName);if(k==null||j.propertyValue!=null&&""+k!==j.propertyValue)return false;return j.bucketName||j.propertyName+"."+k};h.prototype.$ResultsBucketizer4=function(i,j,k){__p&&__p();var l={},m=false;if(c("FacebarGlobalOptions").renderKeywordsFirst)m=true;else m=i[0]!=null&&i[0].type===c("FacebarJSConstants").keywordType;if(m&&k==null)k=c("FacebarGlobalOptions").default_num_top_results_to_show;i.forEach(function(n,o){__p&&__p();j.some(function(p){__p&&__p();var q=this.$ResultsBucketizer3(n,p);if(q===false)return false;if(l[q]==null)l[q]={results:[],rule:p};if(m&&q===c("FacebarJSConstants").keywordType&&l[q].results.length>=k)return true;if(!!p.maxResults&&l[q].results.length>=p.maxResults)return true;n.bucketLineage.push({bucketName:q,bucketIndex:l[q].results.length});l[q].results.push(n);return true}.bind(this))}.bind(this));return l};h.prototype.$ResultsBucketizer5=function(i,j,k){__p&&__p();var l=this.$ResultsBucketizer1[j];if(!l)return{};var m=this.$ResultsBucketizer4(i,l,k);for(var n in m){var o=m[n].rule.subBucketRules;if(!!o)this.$ResultsBucketizer5(m[n].results,o,k)}h.mergeBuckets(i,m);return m};h.prototype.$ResultsBucketizer6=function(i,j,k){if(j.length<=k)return j.slice();var l=j.map(function(n){return n.indexBeforeBuckets}),m=l.sort(function(n,o){return n-o})[k];if(m==null)return j;return j.filter(function(n){return n.indexBeforeBuckets<m})};h.prototype.bucketize=function(i,j,k,l){i.forEach(function(n,o){n.bucketLineage=[];n.indexBeforeBuckets=o});k=k||{};Object.assign(k,this.$ResultsBucketizer5(i,"main",l));var m=this.$ResultsBucketizer6(k,i,j);return m};f.exports=h}),null);
__d("SearchBootstrapCache",["AsyncRequest","AsyncResponse","CacheStorage","SearchBootstrapCacheConstants"],(function a(b,c,d,e,f,g){__p&&__p();var h=1,i={get:function j(k,l,m,n,o){var p=this.getKey(k,l,m),q=this.getStorage(),r=q.get(p),s=c("SearchBootstrapCacheConstants")[l.type]||36e5;if(r==null||Date.now()-r.timestamp>s)o(m,k,l);else{var t=new(c("AsyncRequest"))();t.getData=function(){return r.requestData};var u=new(c("AsyncResponse"))(t,r.payload);n(u,l)}},set:function j(k,l,m){var n=k.getRequest().getData();this.getStorage().set(this.getKey(n,l,m),{timestamp:Date.now(),payload:k.payload,requestData:n})},getKey:function j(k,l,m){return JSON.stringify({filter:k.filter,context:k.context,viewer:k.viewer,lazy:k.lazy,token:k.token,type:l.type,bootstrapEndpoint:m})},getStorage:function j(){return new(c("CacheStorage"))("localstorage","_SearchBootstrapCache_"+h)}};f.exports=i}),null);
__d("SearchSingleState",["fbt"],(function a(b,c,d,e,f,g,h){__p&&__p();function i(k,l,m,n){return{classNames:"grammar",groupIndex:0,indexInGroup:k,path:l,text:m,type:"grammar",uid:n}}var j={getSuggestions:function k(l,m,n){if(n==="ent:user")return this.getSuggestionsForUser(l,m);else if(n==="ent:page")return this.getSuggestionsForPage(l,m);else if(n==="ent:app")return this.getSuggestionsForApp(l,m);else if(n==="ent:group")return this.getSuggestionsForGroup(l,m)},getSuggestionsForUser:function k(l,m){return[i(0,"/search/"+l+"/photos-of",h._("photos of {full name}",[h.param("full name",m)]),"photos_of_user"),i(1,"/search/"+l+"/friends",h._("friends of {full name}",[h.param("full name",m)]),"friends_of_user"),i(2,"/search/"+l+"/pages-liked",h._("favorite pages of {full name}",[h.param("full name",m)]),"pages_liked_user"),i(3,"/search/str/"+m+"/users-named",h._("find all people named \"{full name}\"",[h.param("full name",m)]),"people_named_text")]},getSuggestionsForPage:function k(l,m){return[i(0,"/search/"+l+"/photos-of",h._("photos of {name of page}",[h.param("name of page",m)]),"photos_of_page"),i(1,"/search/"+l+"/likers",h._("people who like {name of page}",[h.param("name of page",m)]),"page_likers"),i(2,"/search/str/"+m+"/pages-named",h._("find all pages named \"{name of page}\"",[h.param("name of page",m)]),"pages_named_text")]},getSuggestionsForGroup:function k(l,m){return[i(0,"/search/"+l+"/members",h._("{name of group} members",[h.param("name of group",m)]),"members_of_group"),i(1,"/search/"+l+"/photos-in",h._("photos in {name of groups}",[h.param("name of groups",m)]),"photos_in_group"),i(2,"/search/"+l+"/creators",h._("{name of group} creators",[h.param("name of group",m)]),"creators_of_group"),i(3,"/search/"+l+"/admins",h._("{name of group} administrators",[h.param("name of group",m)]),"admins_of_group")]},getSuggestionsForApp:function k(l,m){return[i(0,"/search/"+l+"/apps-similar-to",h._("apps similar to {name of app}",[h.param("name of app",m)]),"similar_apps"),i(1,"/search/"+l+"/app-users",h._("people who use {name of app}",[h.param("name of app",m)]),"app_users"),i(2,"/search/str/"+m+"/pages-named",h._("find all apps named \"{name of page}\"",[h.param("name of page",m)]),"apps_named_text")]}};f.exports=j}),null);
__d("SearchDataSource",["errorCode","Arbiter","AsyncResponse","CSRFGuard","CurrentUserInitialData","DataSource","Event","FacebarJSConstants","HashtagSearchResultUtils","Map","PageTransitionsRegistrar","SearchBootstrapCache","SearchRegion","SearchSingleState","UnicodeCJK","XHRRequest","createArrayFromMixed","debounce"],(function a(b,c,d,e,f,g,h){__p&&__p();var i,j,k=100,l="/typeahead/search/facebar/nullstate/";i=babelHelpers.inherits(m,c("DataSource"));j=i&&i.prototype;function m(n){"use strict";__p&&__p();n.headerflags=new(c("Map"))();if(c("SearchRegion").sgp_fork_ss_at_proxygen||c("SearchRegion").sgp_fork_gs_at_proxygen)n.headerflags.set("X-FB-ForkingType","edge-sgp-search");j.constructor.call(this,n);this._updateMaxResults=function(){var p=window.innerHeight||document.documentElement.clientHeight;this.setMaxResults(Math.max(this._numResults.min,Math.min(this._numResults.max,Math.ceil(2+(p-370)/56))))}.bind(this);this._token=n.token||"";this._lazyonload=n.lazyonload===false?false:true;this._extraTypes=n.extraTypes;this._buckets=n.buckets;this._noMultiFetch=n.noMultiFetch||false;this._nullStateConfig=n.nullStateConfig||{};var o=n.maxResults||8;this._numResults={min:3,max:o};this.recordingRoute=n.recordingRoute||"non_banzai";this._enabledHashtag=n.enabledHashtag||false;this.logBackendQueriesWindow=n.logBackendQueriesWindow||25;this._genTime=n.genTime;this._bootstrapError=false;this._hasKeywordBootstrap=n.hasKeywordBootstrap||false;this._addJoinedTermsMatching=n.addJoinedTermsMatching||false;this._useBootstrapCache=n.useBootstrapCache||false;this._useBrowserCache=n.useBrowserCache||false;this.cacheUnicodeMatch.setConfigs({prefix_hangul_conjoining_jamo:true,prefix_kana_drop_trailing_latin:n.cjkDropLatinInCjTokens,prefix_kana_hiragana_to_katakana:n.cjkUiCacheHiraganaToKatakana,search_i18n_prefix_arabic_normalization:n.arabicNormalization});this.backendUnicodeMatch.setConfigs({prefix_kana_drop_trailing_latin:n.cjkDropLatinInCjTokens})}m.prototype.init=function(){"use strict";__p&&__p();j.init.call(this);this._leanPayload=null;this._bootstrapRequestsPending=0;this._criticalOnly=true;this._updateMaxResults();var n=c("debounce")(this._updateMaxResults,k,this,true);c("Event").listen(window,"resize",n);if(this._nullStateConfig.prefetchNullState)this.fetchNullState("");if(this._nullStateConfig.singleState)c("Arbiter").subscribe("page_transition",this.handlePageTransition.bind(this));if(this._nullStateConfig.prefetchNullState||this._nullStateConfig.singleState)c("Arbiter").subscribe("search/updateNullState",this.updateNullState.bind(this));if(this._nullStateConfig.recent)c("Arbiter").subscribe("search/refreshRecentSearchesNullstate",this.refreshRecentSearches.bind(this))};m.prototype.refreshRecentSearches=function(){"use strict";this.nullStateData=null};m.prototype.handlePageTransition=function(){"use strict";this.nullStateParams={}};m.prototype.updateNullState=function(event,n){"use strict";this.nullStateParams=n;this.fetchNullState()};m.prototype.markResultsAsNullState=function(n){"use strict";__p&&__p();if(n)for(var o=n,p=Array.isArray(o),q=0,o=p?o:o[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var r;if(p){if(q>=o.length)break;r=o[q++]}else{q=o.next();if(q.done)break;r=q.value}var s=r;s.isNullState=true}};m.prototype.markResultsAsSingleState=function(n){"use strict";__p&&__p();if(n)for(var o=n,p=Array.isArray(o),q=0,o=p?o:o[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var r;if(p){if(q>=o.length)break;r=o[q++]}else{q=o.next();if(q.done)break;r=q.value}var s=r;s.isSingleState=true}};m.prototype.fetchNullState=function(n){"use strict";__p&&__p();this.lastNullOrSingleStateFetchStartTime=Date.now();if(!this._nullStateConfig.hasNullState)return;var o=null;if(this.nullStateParams&&this.nullStateParams.uid){this.nullStateParams.query=n||"";o=this._fetchDataForSingleState();this.markResultsAsNullState(o)}else{o=this._fetchDataForNullState();this.markResultsAsSingleState(o)}if(o)this.inform("respond",{value:this.nullStateParams?this.nullStateParams.query:"",results:o,isAsync:false,nullState:true})};m.prototype._fetchDataForSingleState=function(){"use strict";__p&&__p();if(this.nullStateDataWithProfile&&this.nullStateParams.uid===this.nullStateDataWithProfile.profileID)return this.nullStateDataWithProfile.data;if(this.nullStateParams.type==="ent:app"||this.nullStateParams.type==="ent:group"||this.nullStateParams.type==="ent:page"){this.fetch(l,{profile_id:this.nullStateParams.uid,ent_type:this.nullStateParams.type},{singleState:true});this.nullStateDataWithProfile={profileID:this.nullStateParams.uid};return}var n=c("SearchSingleState").getSuggestions(this.nullStateParams.uid,this.nullStateParams.text,this.nullStateParams.type);if(!n)return this._fetchDataForNullState();this.nullStateDataWithProfile={data:n,profileID:this.nullStateParams.uid};return n};m.prototype._shouldRefreshNullState=function(){"use strict";if(!this._nullStateConfig.recent)return false;var n=window.location.href;if(!n)return false;if(n.contains("allactivity")&&n.contains("log_filter=search"))return true;return false};m.prototype._fetchDataForNullState=function(){"use strict";__p&&__p();if(this.nullStateData&&!this._shouldRefreshNullState()){this.markResultsAsNullState(this.nullStateData);setTimeout(function(){this.inform("respond",{value:"",results:this.nullStateData,isAsync:true,nullState:true})}.bind(this),0);return}if(!this.fetchingNullState){this.fetchingNullState=true;this.fetch(l,{value:""},{nullState:true,value:""})}return null};m.prototype.dirty=function(){"use strict";j.dirty.call(this);this._bootstrapError=false;this._fetchOnUseRequests=[]};m.prototype.asyncErrorHandler=function(n,o){"use strict";if(o.nullState)this.fetchingNullState=false;if(o.bootstrap)this._bootstrapError=true;this.inform("fetchError",{response:n,fetch_context:o})};m.prototype.fetch=function(n,o,p){"use strict";p=p||{};p.fetch_start=Date.now();var q=c("PageTransitionsRegistrar").getMostRecentURI().path;o=babelHelpers["extends"]({},o,{path:q});j.fetch.call(this,n,o,p)};m.prototype.xhrFetchHandler=function(n,o,p){"use strict";n=c("CSRFGuard").clean(n);var q=JSON.parse(n);return this.fetchHandler(new(c("AsyncResponse"))(null,q.payload),p,o)};m.prototype.fetchHandler=function(n,o){__p&&__p();var p=arguments.length<=2||arguments[2]===undefined?null:arguments[2];"use strict";if(o.nullState){this.fetchingNullState=false;this.nullStateData=n.getPayload().entries;this.markResultsAsNullState(this.nullStateData);this.inform("respond",{value:"",results:this.nullStateData,isAsync:true,nullState:true});return}if(o.singleState){this.nullStateDataWithProfile.data=n.getPayload().entries;this.markResultsAsSingleState(this.nullStateDataWithProfile.data);this.inform("respond",{results:this.nullStateDataWithProfile.data,isAsync:true,value:this.nullStateParams?this.nullStateParams.query:"",nullState:true});return}var q=n.getPayload(),r=babelHelpers["extends"]({fetch_end:Date.now()},o),s=r.value?c("Arbiter").BEHAVIOR_EVENT:c("Arbiter").BEHAVIOR_PERSISTENT;this.inform("beginFetchHandler",{response:n});if(o.bootstrap)this._bootstrapError=false;var t=p===null?n.getRequest().uri.getPath():p.getURI().getPath();if(t===this.bootstrapEndpoint&&this._useBootstrapCache)c("SearchBootstrapCache").set(n,o,this.bootstrapEndpoint);if(o.type=="lean"){this._leanPayload=q;this._processLean()}else{if(q.coeff2_ts)r.coeff2_ts=q.coeff2_ts;j.fetchHandler.call(this,n,o);var u=p===null?n.getRequest().getData():p.getData();if(o.bootstrap&&!u.no_cache)r.browserCacheHit=q.timestamp<this._genTime;if(o.bootstrap&&!q.no_data&&this._bootstrapRequestsPending>0){o.bootstrap=false;--this._bootstrapRequestsPending;!this._bootstrapRequestsPending&&this._bootstrapPostProcess()}if(q.no_data||q.stale||q.token!==this._token){var v=babelHelpers["extends"]({},u);if(v.lazy){delete v.lazy;v.token=this._token;this._fetchOnUse(v,o)}}}this.inform("endpointStats",{info:r,response:n},s);if(o&&!!o.value)this.inform("completeFetch",{response:n,stats:r});var w=this.getResponseHeaderValue("X-FB-ForkingPoolID");if(w.length>0)this.inform("logProxygenForkPoolId",{field:"fork_pool_id",value:w})};m.prototype.respond=function(n,o,p){"use strict";this.inform("respondValidUids",o);this.inform("reorderResults",o);var q=this.buildData(o,n);q.forEach(function(r,s){r.origIndex=s;r.fromCache=!p});this.inform("respond",{value:n,results:q,isAsync:!!p});return q};m.prototype.buildData=function(n,o){"use strict";if(!n||n.length===0)return[];var p=n.map(this.getEntry,this);p.length=Math.min(p.length,this._maxResults);return p};m.prototype.fetchLean=function(){"use strict";this._fetchLean()};m.prototype._isQueryTooShort=function(n){"use strict";return n.length<this._minQueryLength&&!this._performShortQuery&&!c("UnicodeCJK").hasIdeoOrSyll(n)};m.prototype.shouldFetchMoreResults=function(n){"use strict";return n.length<this._maxResults};m.prototype._bootstrapPostProcess=function(){"use strict";var n=0;for(var o in this._data)if(Object.prototype.hasOwnProperty.call(this._data,o))n++;this.inform("bootstrapped",{time:Date.now(),size:n},c("Arbiter").BEHAVIOR_PERSISTENT);this._processLean()};m.prototype._processLean=function(){"use strict";__p&&__p();if(this._leanPayload){var n,o=this._leanPayload.entries;for(var p in o){n=this.getEntry(p);if(n)n.index=o[p]}this.setExclusions(this._leanPayload.blocked);this._leanPayload=null}};m.prototype._bootstrapFetch=function(n,o){"use strict";var p=babelHelpers["extends"]({},o,this.bootstrapData);if(this._criticalOnly&&this._lazyonload)p.lazy=1;var q={bootstrap:true,type:n};this._fetchBootstrapMaybeCache(p,q);++this._bootstrapRequestsPending};m.prototype._fetchBootstrapMaybeCache=function(n,o){__p&&__p();var p,q=this;"use strict";if(this._useBootstrapCache)c("SearchBootstrapCache").get(n,o,this.bootstrapEndpoint,this.fetchHandler.bind(this),this.fetch.bind(this));else if(this._useBrowserCache)(function(){var r=new(c("XHRRequest"))(q.bootstrapEndpoint).setData(babelHelpers["extends"]({},n,{__user:c("CurrentUserInitialData").USER_ID,__a:1})).setMethod("GET").setResponseHandler(function(s){return this.xhrFetchHandler(s,r,o||{})}.bind(q)).setErrorHandler(function(s){return this.asyncErrorHandler(s,o)}.bind(q));q.inform("beforeFetch",{request:r,fetch_context:o});r.send()})();else this.fetch(this.bootstrapEndpoint,n,o)};m.prototype._fetchOnUse=function(n,o){"use strict";for(var p in this.bootstrapData)!Object.prototype.hasOwnProperty.call(n,p)&&(n[p]=this.bootstrapData[p]);if(this._criticalOnly)this._fetchOnUseRequests.push({args:n,ctx:o});else this._fetchBootstrapMaybeCache(n,o)};m.prototype._fetchLean=function(){"use strict";var n={no_cache:1};n.options=c("createArrayFromMixed")(n.options);n.options.push("lean");this._fetchOnUse(n,{type:"lean"})};m.prototype.bootstrap=function(n){"use strict";__p&&__p();if(!n){this._criticalOnly=false;this._flushFetchOnUseRequests()}if(this._bootstrapped)return;var o={filter:["event"]};this._fetchOnUse(o,{type:"event"});var p=["app","page","group","friendlist"];p=p.concat(this._extraTypes||[]);var q=[];if(this._hasKeywordBootstrap)q.push(c("FacebarJSConstants").keywordType);if(this._noMultiFetch){p.push("user");p=p.concat(q);this._bootstrapFetch("user",{filter:p})}else{this._bootstrapFetch("other",{filter:p});if(this._buckets)for(var r=0;r<this._buckets.length;++r){var s={filter:["user"],buckets:this._buckets[r]};this._bootstrapFetch("user",s)}else this._bootstrapFetch("user",{filter:["user"]});if(q.length>0)this._bootstrapFetch("keyword",{filter:q})}this._fetchLean();this._bootstrapped=true};m.prototype.getBootstrapError=function(){"use strict";return this._bootstrapError};m.prototype._flushFetchOnUseRequests=function(){"use strict";var n=this._fetchOnUseRequests.length;for(var o=0;o<n;++o){var p=this._fetchOnUseRequests[o];this._fetchBootstrapMaybeCache(p.args,p.ctx)}if(n>0)this.inform("extra_bootstrap",{time:Date.now()},c("Arbiter").BEHAVIOR_PERSISTENT);this._fetchOnUseRequests=[]};m.prototype.onLoad=function(n,o){"use strict";this.inform("onload",{time:Date.now()},c("Arbiter").BEHAVIOR_PERSISTENT);if(n)setTimeout(this.bootstrap.bind(this,o),0)};m.prototype.mergeUids=function(n,o,p,q){"use strict";__p&&__p();var r=this.getDynamicHashtagResult(q);if(q&&r&&o.indexOf(r)<=0)o.unshift(r);var s=p[0]?this.getEntry(p[0]):null,t=o[0]?this.getEntry(o[0]):null,u=s&&s.replace_results?s:null;u=!u&&t&&t.replace_results?t:u;var v=j.mergeUids.call(this,n,o,p,q);if(u){this.inform("backend_topreplace",{});return this.deduplicateByKey([u.uid].concat(v))}return v};m.prototype.getTextToIndexFromFields=function(n,o){"use strict";__p&&__p();var p=[],q=n.tokenVersion==="v2";for(var r=0;r<o.length;++r){if(q&&(o[r]==="text"||o[r]==="alias"))continue;var s=n[o[r]];if(s){s=s.join?s.join(" "):s;p.push(s);if(o[r]=="text"&&this._addJoinedTermsMatching){s=s.toLowerCase();s=s.replace(/ /g,"");p.push(s)}}}return p.join(" ")};m.prototype.getDynamicHashtagResult=function(n){"use strict";__p&&__p();if(!n||!this._enabledHashtag)return;var o=c("HashtagSearchResultUtils").getHashtagFromQuery(n);if(!o)return;var p="hashtag:"+o,q=this.getEntry(p);if(!q)this.processEntries([c("HashtagSearchResultUtils").makeTypeaheadResult(o)],n);return p};m.prototype.tokenizeCache=function(n,o){"use strict";n=this.cacheUnicodeMatch.prefixMatchPrepare(n);var p=this._tokenize(n,o),q=p.tokens;if(q.length>0&&p.value.startsWith("@"))q[0]="@"+q[0];return p};f.exports=m}),null);
__d("FacebarDataSource",["invariant","Arbiter","AsyncRequest","AsyncResponse","CSRFGuard","CurrentUser","FacebarFindPeopleAndPages","FacebarGlobalOptions","FacebarGSv2Echo","FacebarInviteCoworkers","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarResultStore","FacebarResultStoreUtils","FacebarSimplifiedNoFlickerResults","FacebarStructuredText","FacebarTimerUtils","FacebarTokenizer","FacebarURI","Map","ResultsBucketizer","ResultsBucketizerConfig","SearchDataSource","Vector","ViewportBounds","XHRRequest","gkx","queryThenMutateDOM","setTimeoutAcrossTransitions","throttle"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j,k=50,l={};i=babelHelpers.inherits(m,c("SearchDataSource"));j=i&&i.prototype;function m(n){__p&&__p();j.constructor.call(this,n);this.executeQuery=function(o,p,q){__p&&__p();var r,s=this;this._curQueryId++;if(q!=null){q.queryId=this._curQueryId;q.startCacheQuery=c("FacebarTimerUtils").getTimestamp()}var t=this.getMaxResults();this.setQueryData({qid:this._curQueryId,max_results:t});this.inform("beforeQuery",{value:o,queryId:this._curQueryId});this.value=o;var u=this.buildUids(o,[]);if(q!=null)q.endCacheQuery=c("FacebarTimerUtils").getTimestamp();if(p&&u.length===0)u.push(p);if(c("FacebarGlobalOptions").sendExistingIDs)(function(){var v=[];u.forEach(function(w){var x=this.getEntry(w);if(x&&x.type in c("FacebarJSConstants").entityTypes)v.push(x.uid)},s);if(v.length>0)s.setQueryData({qid:s._curQueryID,existing_ids:JSON.stringify(v),max_results:t})})();this.inform("query",{value:o,results:u,queryId:this._curQueryId});if(this.resultStore)this.respond(o,u,false,false,q)}.bind(this);this.sendRemoteQuery=function(o,p,q,r,s,t){__p&&__p();var u=this.getQueryData(o.text_form),v=q!=null?q.queryId:0;if(t){var w=this.globallyCachedKeywordsTTL*60,x=new(c("XHRRequest"))(this.globalKeywordsEndpoint).setData({value:u.value,platform:"desktop",ttl:this.globallyCachedKeywordsTTL,global:this.globallyCachedKeywordsUseCDN,use_dt:this.globallyCachedKeywordsUseDT}).setMethod("GET").setRequestHeader("Cache-Control","max-age="+w).setResponseHandler(function(G,H){H=c("CSRFGuard").clean(H);var I=JSON.parse(H);this.handleQueryResponse(new(c("AsyncResponse"))(null,I),G,o,p,q,r,t);this.activityEnd()}.bind(this,v)).setErrorHandler(function(G){return this.activityEnd()}.bind(this));this.inform("sending_global_request",x);this._maxRemoteQueryId=v;if(q!=null){q.waitingQueries=this._waitingQueries;q.inflightRequests=c("AsyncRequest").getInflightCount();q.startRemoteQuery=c("FacebarTimerUtils").getTimestamp()}x.send();this.activityStart()}else{u.gs_prefetch_mode=r;if(s)u.max_results=s;if(this.globallyCachedKeywordsUseCDN&&!this._single_state){u.log_global_hit=true;u.log_global_ttl=this.globallyCachedKeywordsTTL;u.log_global_platform="desktop";u.log_dt=this.globallyCachedKeywordsUseDT}var y=new(c("AsyncRequest"))().setURI(this.queryEndpoint).setData(u).setMethod("GET").setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(G,H){this.handleQueryResponse(H,G,o,p,q,r,t)}.bind(this,v)).setFinallyHandler(function(){this.activityEnd()}.bind(this));for(var z=this._headerflags,A=Array.isArray(z),B=0,z=A?z:z[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var C;if(A){if(B>=z.length)break;C=z[B++]}else{B=z.next();if(B.done)break;C=B.value}var D=C,E=D[0],F=D[1];y.setRequestHeader(E,F)}this.inform("sending_request",y);this._maxRemoteQueryId=v;if(q!=null){q.waitingQueries=this._waitingQueries;q.inflightRequests=c("AsyncRequest").getInflightCount();q.startRemoteQuery=c("FacebarTimerUtils").getTimestamp()}y.send();this.activityStart()}}.bind(this);this.renderResults=function(o,p,q,r,s,t){__p&&__p();if(s!=null)l[String(o)]=s;else s=l[String(o)];c("FacebarGSv2Echo").insertInto(o,p,!q,this._single_state,this._is_local,this._categoryName);if(c("FacebarGlobalOptions").graphSearchV2&&c("FacebarGlobalOptions").renderKeywordsFirst&&o!=null&&c("FacebarGSv2Echo").normalizeValue(o).length>0&&this._single_state!==true&&!c("FacebarGlobalOptions").hasKeywordOnlyTypeahead&&(!c("CurrentUser").isWorkUser()||!c("gkx")("AT7z9jFl-OuVwbqHVG4yUmKP7RD-BfFMVtbTeMxJgJDwti-hDvt8aHlAV4th5WbeKLi4MS0pOq_K62ykg2lVy_QmWQM_F1QXRACJT7ZVjnw9pw")))c("FacebarSimplifiedNoFlickerResults").insertInto(p);if(!!o&&o instanceof c("FacebarStructuredText")&&!o.isEmptyOrWhitespace()&&!this._bypassBucketizer)p=this._bucketizeResults(o,p,s);p.length=Math.min(p.length,this.getMaxResults());this.injectExtraResults(o,p);r=q&&p.length===0;this.inform("respond",{value:o,results:p,isAsync:!!q,isEmptyResults:r})}.bind(this);this._fetched_null_state=null;this._initialQueryData=null;this._curQueryId=-1;this._maxRemoteQueryId=-1;this._single_state=false;this._is_local=false;this._categoryName=null;this._waitingQueries=0;this.mixGrammarAndEntity=n.mixGrammarAndEntity!==undefined?n.mixGrammarAndEntity:true;this._isInjectedSuggestionFlow=false;this.grammarVersion=n.grammarVersion||"";if(!n.grammarOptions)n.grammarOptions={};this._headerflags=n.headerflags||new(c("Map"))();this.recordingRoute="banzai_vital";this._maxGrammarResults=n.grammarOptions.maxGrammarResults;this.nullStateEndpoint=n.nullStateEndpoint||"/ajax/browse/null_state.php";this.setNullStateData(n.nullStateData||{},true);this._minQueryLength=n.minQueryLength||-1;this._performShortQuery=n.performShortQuery||false;this._fixProcessLean=n.grammarOptions.fixProcessLean||false;this.hasGSPreload=c("FacebarGlobalOptions").hasGSPreload;this.gsPreloadOptions=c("FacebarGlobalOptions").gsPreloadParams;this.useGloballyCachedKeywords=c("FacebarGlobalOptions").useGloballyCachedKeywords;this.globallyCachedKeywordsTTL=c("FacebarGlobalOptions").globallyCachedKeywordsTTL;this.globallyCachedKeywordsUseCDN=c("FacebarGlobalOptions").globallyCachedKeywordsUseCDN;this.globallyCachedKeywordsUseDT=c("FacebarGlobalOptions").globallyCachedKeywordsUseDT;this.throttleExecuteQuery();this.throttleSendRemoteQuery();this.throttleRenderResults();this.resultStoreOptions=n.grammarOptions||{};this.resultStoreOptions.useNewExactNameMatch=n.grammarOptions.useNewExactNameMatch==="true";this.defaultQuery=null;this._bypassBucketizer=false;this._resultsBucketizer=new(c("ResultsBucketizer"))(c("ResultsBucketizerConfig").rules,function(o,p){switch(p){case"isSeeMore":return o.isSeeMore;case"objectType":return o.type;case"resultSetType":return o.results_set_type;case"renderType":return o.render_type||o.type;case"cacheOnlyResult":return o.cacheOnlyResult;case"closeEntity":return o.bootstrapped||(!!o.tags?o.tags[p]:undefined);default:return!!o.tags?o.tags[p]:undefined}});this.fetchNullState();this.initWithConfig(c("FacebarGlobalOptions").grammarConfig);c("Arbiter").subscribe("FacebarTypeahead.injectSuggestion",function(o,p){return this.addSearchSuggestionToNullState(p)}.bind(this));this.subscribe("bootstrapped",function(){c("Arbiter").subscribe("FacebarDataSource.getBootstrapMatches",function(o,n){n.callback.call(null,this.getBootstrapMatches(n.query,n.whitelistedEntIds))}.bind(this))}.bind(this))}m.prototype.addSearchSuggestionToNullState=function(n){if(!n.query)return;var o=c("FacebarKeywordSearchUtils").makeFacebarEntry(n.query);this.resultStore.addSuggestionEntryToNullState(o,n.interaction);this._isInjectedSuggestionFlow=true;this.inform("reloadNullstate",true);this._isInjectedSuggestionFlow=false};m.prototype.initWithConfig=function(n){this.facebarConfig=n;this.createResultStore();if(this._fetched_null_state){this.setNullState(this._fetched_null_state);this._fetched_null_state=null}};m.prototype.throttleExecuteQuery=function(){var n=c("FacebarGlobalOptions").executeQueryThrottleTime;this.executeQueryThrottled=c("throttle").withBlocking(this.executeQuery,n,this)};m.prototype.throttleSendRemoteQuery=function(){__p&&__p();var n,o=this,p=c("FacebarGlobalOptions").sendRemoteQueryThrottleTime;if(p===0)this.sendRemoteQueryThrottled=this.sendRemoteQuery;else if(c("FacebarGlobalOptions").lazyThrottleRemoteQuery)(function(){__p&&__p();var q=Date.now(),r=c("FacebarGlobalOptions").enableSendRemoteQueryDelay,s=c("FacebarGlobalOptions").sendRemoteQueryDelayTime;o.sendRemoteQueryThrottled=function(){__p&&__p();for(var t=arguments.length,u=Array(t),v=0;v<t;v++)u[v]=arguments[v];var w=Date.now();if(q+p<w){q=w;if(r)c("setTimeoutAcrossTransitions")(function(){this.sendRemoteQuery.apply(this,u)}.bind(this),s);else this.sendRemoteQuery.apply(this,u)}}.bind(o)})();else{if(c("FacebarGlobalOptions").typingSpeedThrottleTime>0)p=c("FacebarGlobalOptions").typingSpeedThrottleTime;this.sendRemoteQueryThrottled=c("throttle").withBlocking(this.sendRemoteQuery,p,this)}};m.prototype.throttleRenderResults=function(){__p&&__p();var n=c("FacebarGlobalOptions").renderThrottleTime;if(n===0){this.renderResultsThrottled=this.renderResults;return}var o=Date.now();this.renderResultsThrottled=function(p,q,r,s,t,u){var v=Date.now();if(r||o+n<v){o=v;this.renderResults(p,q,r,s,t,u)}}.bind(this)};m.prototype.createResultStore=function(){this.facebarConfig.maxGrammarResults=this._maxGrammarResults;this.resultStore=new(c("FacebarResultStore"))(this.facebarConfig,c("FacebarTokenizer").tokenize,this.getEntry.bind(this),this.resultStoreOptions);if(this._fixProcessLean)this._processLean();this.subscribe("setSortFunction",function(n,o){this.resultStore.setSortFunction(o)}.bind(this))};m.prototype.dirty=function(){this._nullStateFetched=false;this.resultStore.resetCaches();j.dirty.call(this)};m.prototype.refreshNullstate=function(){this._nullStateFetched=false;this.fetchNullState()};m.prototype.addEntries=function(n){this.resultStore.addBootstrap(this.processEntries(n))};m.prototype._processLean=function(){__p&&__p();if(this._fixProcessLean){if(this._leanPayload&&this.resultStore){var n=void 0,o=this._leanPayload.entries;for(var p in o){n=this.getEntry(p);if(!n)continue;for(var q in o[p]){if(!n.grammar_costs)n.grammar_costs={};n.grammar_costs["{"+q+"}"]=o[p][q]}}this.setExclusions(this._leanPayload.blocked);this._leanPayload=null}}else j._processLean.call(this)};m.prototype.setNullStateData=function(n,o){if(o)this.nullStateData={grammar_version:this.grammarVersion};Object.assign(this.nullStateData,n);return this};m.prototype.setNullState=function(n){__p&&__p();var o;if(c("FacebarGlobalOptions").hasKeywordOnlyTypeahead)(function(){var p={};n.queries=n.queries.filter(function(q){var r=q.parse.display.join(" ").toLowerCase();if(!p[r]){p[r]=true;return true}return false})})();this._null_state=n;this.processEntries(this._null_state.entities);this.resultStore.setNullState(this._null_state.queries);this.resultStore.addNullStateToQueryCache(this.getRawStructure(c("FacebarStructuredText").fromString("")))};m.prototype.getNullStateTrending=function(){return this._null_state.trending};m.prototype.setSingleState=function(n){this._single_state=n};m.prototype.getSingleState=function(){return this._single_state};m.prototype.setLocal=function(n){this._is_local=n};m.prototype.setCategoryName=function(n){this._categoryName=n};m.prototype.overrideNullState=function(n){this._null_state!=null||h(0);this._original_null_state=this._original_null_state||this._null_state;this.setNullState(n)};m.prototype.restoreNullState=function(){if(this._original_null_state)this.setNullState(this._original_null_state)};m.prototype.fetchNullState=function(){__p&&__p();if(this._nullStateFetched){this.activityStart();setTimeout(this.activityEnd.bind(this),0);return}var n=new(c("AsyncRequest"))().setURI(this.nullStateEndpoint).setData(this.nullStateData).setMethod("GET").setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(o){if(this.resultStore){this.setNullState(o.payload);this.inform("nullstateReady",true)}else this._fetched_null_state=o.payload;this._nullStateFetched=true}.bind(this)).setFinallyHandler(this.activityEnd.bind(this));this.activityStart();n.send()};m.prototype.toTypeaheadEntryUid=function(n,o){__p&&__p();var p=void 0,q=c("FacebarStructuredText").fromStruct(o.structure),r=q.getFragment(0);if(q.getCount()==1&&r.isType("ent")){var s=r.getType().split(":")[2];p=this.getEntry(r.getUID(),s);p.type=this.resultStore.stripBrackets(o.type)}else{p=this.getEntry(o.tuid);if(!p){p={dynamic_cost:o.dynamic_cost,extra_uri_params:o.extra_uri_params,memcache:o.fromMemcache,photo:o.photo,results_set_type:o.resultsSetType,tuid:o.tuid,type:o.type,uid:o.tuid,tags:o.tags};this.processEntries([p]);p=this.getEntry(o.tuid)}p.icon_class=o.iconClass;p.unseen_posts=o.unseen_posts;if(c("FacebarGlobalOptions").renderKeywordSnippets){p.category=o.category;p.subtext=o.subtext;p.boldedSubtext=o.boldedSubtext}}p.error_info=o.errorInfo;p.logInfo=o.logInfo;p.itemLoggingInfo=o.item_logging_info;p.itemLoggingId=o.item_logging_id;p.structure=q;p.text=p.structure.toString();p.queryTypeText=o.queryTypeText;p.semantic=!!o.isSingleState&&o.singleStateSemantic?o.singleStateSemantic:o.semantic;p.alternateSemantic=o.alternateSemantic;p.tree=o.tree;p.cost=o.cost;p.isSeeMore=!!o.isSeeMore;p.isNullState=!!o.isNullState;p.isSingleState=!!o.isSingleState;p.keywordSource=o.keywordSource;p.keyword=o.keyword;var t=o.keyword_type;p.keywordType=t;p.isTrending=!!o.isTrending||o.keywordBootstrapType===c("FacebarJSConstants").keywordBootstrapTypes.trending||t===c("FacebarJSConstants").keywordTypes.trending;p.isCelebrity=t===c("FacebarJSConstants").keywordTypes.celebrity;p.isFootball=t===c("FacebarJSConstants").keywordTypes.football;p.isPhotos=t===c("FacebarJSConstants").keywordTypes.photos;p.isVideos=t===c("FacebarJSConstants").keywordTypes.videos;p.isHashtag=t===c("FacebarJSConstants").keywordTypes.hashtag;p.isLocal=t===c("FacebarJSConstants").keywordTypes.local||t===c("FacebarJSConstants").keywordTypes.local_category;p.isCompany=t===c("FacebarJSConstants").keywordTypes.company;p.isMovie=t===c("FacebarJSConstants").keywordTypes.movie;p.isHappeningNow=t===c("FacebarJSConstants").keywordTypes.happeningNow;p.isSpecialIntentGeneric=t===c("FacebarJSConstants").keywordTypes.specialIntentGeneric;p.isLink=t===c("FacebarJSConstants").keywordTypes.link;c("FacebarJSConstants").intentKeys.map(function(w){p.isSpecialIntent=p.isSpecialIntent||p[w]});p.isRecent=!!o.isRecent;p.isPrefetched=!!o.isPrefetched;p.isSuggestion=!!o.isSuggestion;p.isInjectedSuggestion=!!o.isInjectedSuggestion;p.isFromGSEF=!!o.isFromGSEF;p.isGloballyCachedKeyword=!!o.isGloballyCachedKeyword;p.entityInfo=o.entityInfo;p.cacheOnlyResult=o.cacheOnlyResult||false;if(c("FacebarGlobalOptions").hasKeywordOnlyTypeahead&&(!c("FacebarGlobalOptions").logSERPClickAsRecentSearch||!o.isNullState)){var u=c("FacebarStructuredText").fromStruct(o.structure).toString().toLowerCase(),v=c("FacebarKeywordSearchUtils").makeFacebarEntry(u);p.uri=v.uri;p.semantic=v.semantic;p.structure=v.structure}else p.uri=p.uri||c("FacebarURI").getURI(this.facebarConfig,p);p.parse=o.parse;p.tags=o.tags||{};p.isKeywordL2=o.isKeywordL2||false;p.exactMatchKeyword=o.exactMatchKeyword||false;p.qid=o.qid;p.templateID=o.templateID;if(o.isJSBootstrapMatch){p.isJSBootstrapMatch=o.isJSBootstrapMatch;p.backendCost=o.backendCost;p.bootstrapCost=o.bootstrapCost;p.keywordBootstrapType=o.keywordBootstrapType}this._replaceCategoryWithTermMatches(n,p,o);return p.tuid};m.prototype._replaceCategoryWithTermMatches=function(n,o,p){__p&&__p();if(o.type!=="user"&&o.type!=="page")return;if(!o.term_to_subtitle||!p.termMatches)return;var q=o.alias,r=q==null?"":this.resultStore._convertToAliasKey(q),s=[];p.termMatches.forEach(function(u){var v=o.term_to_subtitle[u];if(!n.is_alias_search&&u===r&&u!==n.potential_alias_term)v=null;if(v)s.push(v)},this);if(o.category===undefined)o.category="";if(o.original_category!==undefined)o.category=o.original_category;if(!s||s.length===0)return;if(o.original_category===undefined)o.original_category=o.category;if(!o.original_category)return;var t=o.original_category.length>0?o.original_category.split(" \xb7 "):[];t.unshift.apply(t,s);t=t.filter(function(u,v,w){return v==w.indexOf(u)});o.category=t.splice(0,2).join(" \xb7 ")};m.prototype.getRawStructure=function(n){if(typeof n=="string")n=c("FacebarStructuredText").fromString(n);if(this.resultStore)return this.resultStore.transformStructured(n.toArray())};m.prototype.saveResult=function(n){this._initialQueryData=this.getUID(n.uid,n.fetchType)};m.prototype.isDefaultKeywordQuery=function(n){return n.type===c("FacebarJSConstants").keywordType&&c("FacebarResultStoreUtils").getTextFromResult(n).toLowerCase()===this.value.getHash().trim().toLowerCase()};m.prototype.buildUids=function(n){__p&&__p();if(!n||!this.resultStore)return[];if(typeof n==="string")n=c("FacebarStructuredText").fromString(n);var o=this.getRawStructure(n),p=this.resultStore.getResults(o,this.getMaxResults()),q=p.results;if(q===undefined)return[];var r=p.null_state===true,s=0;q=q.filter(function(w,x){if(!c("FacebarGlobalOptions").allowGrammar&&w.type=="grammar")return false;return w.semantic!="<blank>"&&(w.type!="unimplemented"||s++===0)},this);var t=[],u=[],v=[];q.forEach(function(w){if(w.forcedPosition>0)v.push(w);else if(w.isSeeMore)t.push(w);else u.push(w)});if(r)q=this.orderNullState(q,c("FacebarGlobalOptions").maxNullstateResultCount?c("FacebarGlobalOptions").maxNullstateResultCount:this.getMaxResults());else q=u;if(v.length>0){v.sort(function(w,x){return w.forcedPosition-x.forcedPosition});v.forEach(function(w){q.splice(w.forcedPosition,0,w)})}if(t.length>0)q.push.apply(q,t);return q.map(function(w){return this.toTypeaheadEntryUid(o,w)}.bind(this))};m.prototype.orderNullState=function(n,o){__p&&__p();var p={top:[],bottom:[],middle:[]},q=function q(t){var u=t.null_state_position;return Object.prototype.hasOwnProperty.call(p,u)?u:"middle"},r=function r(t,u){return t.original_cost-u.original_cost};n&&n.forEach(function(t){p[q(t)].push(t)},this);for(var s in p){p[s]=p[s].sort(r).slice(0,o);o-=p[s].length}return[].concat(p.top,p.middle,p.bottom)};m.prototype.isEntity=function(n){if(!n)return false;return/^\d+$/.test(n)};m.prototype.handleResponse=function(n,o){__p&&__p();if(!n.payload.errors){this.processEntries(n.payload.entities);n.payload.results.forEach(function(p){p.qid=n.queryId;if(!p.parse)p.parse={};p.parse.entTokens=p.parse.entTokens||[];p.parse.remTokens=p.parse.remTokens||[];p.parse.suffix=p.parse.suffix||"";if(this.isEntity(p.semantic))p=this._buildCommonEntityFields(p,o.tokens)}.bind(this));this.saveResults(n,o)}};m.prototype.saveResults=function(n,o){if(n.payload.prefetched)this.processPrefetched(n.payload.prefetched);this.resultStore.saveResults(n.payload.results,o,n.payload.incomplete,{},[])};m.prototype.processPrefetched=function(n){__p&&__p();var o,p=this,q=function q(r){var t=c("FacebarStructuredText").fromString(r),u=p.getRawStructure(t);s=n[r];p.processEntries(s.entities);s.results.forEach(function(v){if(this.isEntity(v.semantic))v=this._buildCommonEntityFields(v,u.tokens)}.bind(p));p.resultStore.saveResults(s.results,u,s.incomplete)};for(var r in n){var s;q(r)}};m.prototype.processEntries=function(n){__p&&__p();return n.map(function(o,p){__p&&__p();var q=o.uid+="";o.textToIndex=this.getTitleTerms(o);o.titleToIndex=this.getTitleTerms(o);q=this.getUID(q,o.fetchType);var r=this.getEntry(q);if(!r){this.setEntry(q,{});r=this.getEntry(q)}else delete o.photo;Object.assign(r,o);r.tuid=q;r.index===undefined&&(r.index=p);return q},this)};m.prototype.getUID=function(n,o){n+="";if(o!==undefined){o=/([^:]+:)?([^:]+)(:.*)?/.exec(o)[2];return JSON.stringify([n,o])}return n};m.prototype.getEntry=function(n,o){var p=void 0;n=""+n;p=o!=null?j.getEntry.call(this,this.getUID(n,o))||j.getEntry.call(this,n):j.getEntry.call(this,n);return p};m.prototype.getEntryForFragment=function(n){return this.getEntry(n.getUID(),n.getTypePart(2))};m.prototype.getMaxResults=function(){return this._numResults.max};m.prototype.query=function(n,o,p){this.executeQueryThrottled(n,this._initialQueryData,{keyPress:c("FacebarTimerUtils").getTimestamp()});this._initialQueryData=null};m.prototype.shouldFetchMore=function(n,o){__p&&__p();if(!n.is_empty&&c("FacebarGlobalOptions").fetchMoreKeywords){var p=o.filter(function(q){return q.type===c("FacebarJSConstants").keywordType}).length;if(p<c("FacebarGlobalOptions").default_num_top_results_to_show)return true}if(n.is_empty)return false;if(this.resultStore.alreadyKnown(n.cache_id))return false;if(n.raw_text&&this._isQueryTooShort(n.raw_text))return false;if(c("FacebarGlobalOptions").alwaysFetchMore)return true;if(o.length<this.getMaxResults()||this._performShortQuery)return true;return this.countValidResults(o)<this.getMaxResults()||this._performShortQuery};m.prototype.countValidResults=function(n){var o=0;n.forEach(function(p){if(p&&!p.isNullState&&!p.isSeeMore)o++},this);return o};m.prototype.handleQueryResponse=function(n,o,p,q,r,s,t){__p&&__p();var u=s||t;if(u&&n.payload.is_user)return;var v=n.payload;n.queryId=o;n.inputQuery=p.text_form;if(v.results!=null)v.results.forEach(function(y){y.isSingleState=this._single_state;y.isFromGSEF=s;y.isGloballyCachedKeyword=t}.bind(this));if(r!=null)r.endRemoteQuery=c("FacebarTimerUtils").getTimestamp();this.inform("response_received",n);this.handleResponse(n,p);var w=[];if(v.abandon_cache)w=v.results.map(function(y){return this.toTypeaheadEntryUid(p,y)}.bind(this));var x=v.num_topresults_to_show;if(c("FacebarGlobalOptions").hasSimplifiedFlickerFix&&(x==null||x<3))x=3;this.respond(q,w,true,v&&(!v.results||v.results.length===0),r,x,u);this.inform("backend_response",n)};m.prototype.activityStart=function(){if(!this._waitingQueries)this.inform("activity",{activity:true},c("Arbiter").BEHAVIOR_STATE);this._waitingQueries++};m.prototype.activityEnd=function(){this._waitingQueries--;if(!this._waitingQueries)this.inform("activity",{activity:false},c("Arbiter").BEHAVIOR_STATE)};m.prototype._bucketizeResults=function(n,o,p){o=this._tagKeywordsSuggestions(o);return this._resultsBucketizer.bucketize(o,k,null,p)};m.prototype._tagKeywordsSuggestions=function(n){__p&&__p();if(!n||n.length===0)return n;var o=n[0];if(o.bootstrapped)return n;if(o.type==="grammar"||o.cost<c("FacebarGlobalOptions").closeEntityThreshold&&o.type==="user")return n;return n.map(function(p){if(p.type!==c("FacebarJSConstants").keywordType)return p;p=babelHelpers["extends"]({},p);p.tags.topBucket=true;return p})};m.prototype._buildCommonEntityFields=function(n,o){__p&&__p();if(n.queryTypeText)return n;if(c("FacebarGlobalOptions").unbreakParseDisplay)n.parse.display=[{type:"ent:"+n.type,uid:n.semantic}];else n.parse.display=[{type:"ent:"+n.type,uid:parseInt(n.semantic,10)}];if(n.parse.fetchType)n.parse.display[0].fetchType=n.parse.fetchType;n.parse.entTokens=o;n.parse.pos=0;n.resultsSetType="{"+n.type+"}";n.queryTypeText=c("FacebarJSConstants").defaultQueryTypeText;return n};m.prototype.setBypassBucketizer=function(n){this._bypassBucketizer=n};m.prototype.respond=function(n,o,p,q,r,s,t){__p&&__p();if(p&&this.value){if(typeof this.value==="string")this.value=c("FacebarStructuredText").fromString(this.value);this.inform("remote_query_match",{isMatch:this.value.matches(n),queryId:r!=null?r.queryId:0});n=this.value;if(!o||o.length===0)o=this.buildUids(n)}this.inform("reorderResults",o);this.inform("respondValidUids",o);var u=o.map(this.getEntry,this);u.forEach(function(w,x){w.fromCache=!p;w.isSingleState=this._single_state},this);if(!p&&(n.getHash().length<512||n.getHash().startsWith("http://")||n.getHash().startsWith("https://"))){var v=this.getRawStructure(n);if(this.shouldFetchMore(v,u)){if(r!=null)r.dispatchRemoteQuery=c("FacebarTimerUtils").getTimestamp();if(this.useGloballyCachedKeywords&&!this._single_state){this.sendRemoteQueryThrottled(v,n,r,false,null,true);this.sendRemoteQueryThrottled(v,n,r)}else if(this.hasGSPreload){this.sendRemoteQueryThrottled(v,n,r,true,this.gsPreloadOptions.max_entities_to_fetch);this.sendRemoteQueryThrottled(v,n,r)}else this.sendRemoteQueryThrottled(v,n,r)}}if(!p||r==null||r.queryId===this._maxRemoteQueryId)this.renderResultsThrottled(n,u,p,q,s,t);if(r!=null)this.logLatencies(p,r)};m.prototype.injectExtraResults=function(n,o,p){c("FacebarFindPeopleAndPages").insertInto(n,o,!p,this._single_state);c("FacebarInviteCoworkers").insertInto(n,o,!p,this._single_state)};m.prototype.logLatencies=function(n,o){var p=c("FacebarTimerUtils").getTimestamp();if(n)this.inform("remote_query_latency",{queryId:o.queryId,latencies:{queryStart:Math.max(o.startRemoteQuery-o.dispatchRemoteQuery,0),queryEnd:Math.max(o.endRemoteQuery-o.startRemoteQuery,0),keyPressToQueryDispatch:Math.max(o.dispatchRemoteQuery-o.keyPress,0),keyPressToQueryStart:Math.max(o.startRemoteQuery-o.keyPress,0),keyPressToQueryEnd:Math.max(o.endRemoteQuery-o.keyPress,0),render:Math.max(p-o.endRemoteQuery,0),inflightRequests:o.inflightRequests,waitingQueries:o.waitingQueries,keyPressToRender:Math.max(p-o.keyPress,0)}});else this.inform("cache_query_latency",{queryId:o.queryId,latencies:{queryStart:Math.max(o.startCacheQuery-o.keyPress,0),queryEnd:Math.max(o.endCacheQuery-o.startCacheQuery,0),keyPressToQueryEnd:Math.max(o.endCacheQuery-o.keyPress,0),render:Math.max(p-o.endCacheQuery,0),keyPressToRender:Math.max(p-o.keyPress,0)}})};m.prototype._updateMaxResults=function(){c("queryThenMutateDOM")(function(){var n=c("Vector").getViewportDimensions().y,o=c("ViewportBounds").getTop()||42,p=56,q=48,r=n-o-q-25;this._maxResults=Math.max(this._numResults.min,Math.min(this._numResults.max,Math.floor(r/p)-1));this.value&&this.query(this.value)}.bind(this))};m.prototype.getCurQueryId=function(){return this._curQueryId};m.prototype.setMinQueryLength=function(n){this._minQueryLength=n};m.prototype.setGrammarOption=function(n){c("FacebarGlobalOptions").allowGrammar=n};m.prototype.getBootstrapMatches=function(n){var o=arguments.length<=1||arguments[1]===undefined?[]:arguments[1],p=this.getRawStructure(c("FacebarStructuredText").fromString(n)),q=this.resultStore.getBootstrapMatches(p,o);return q.map(function(r){return this.getEntry(this.toTypeaheadEntryUid(p,r))}.bind(this))};Object.assign(m.prototype,{events:["query","respond","bootstrapped","activity","ready"]});f.exports=m}),null);
__d("FacebarTypeahead",["Arbiter","Typeahead","emptyFunction"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i;h=babelHelpers.inherits(j,c("Typeahead"));i=h&&h.prototype;function j(k,l,m,n,o,p){__p&&__p();i.constructor.call(this,k,l,m,n);this.getCore();this.proxyEvents();this.initBehaviors(o||[]);var q=this.core.subscribe("focus",function(){if(p)p.init(this);this.core.unsubscribe(q);this.data.bootstrap(false);this.core.input.focus()}.bind(this));this.data.bootstrap(true);this.inform("init",this,c("Arbiter").BEHAVIOR_PERSISTENT);c("Arbiter").inform("Facebar/init",this,c("Arbiter").BEHAVIOR_PERSISTENT)}j.prototype.proxyEvents=function(){var k,l=[],m=null,n=function(){while(k=l.shift())this.inform(k[0],k[1]);m=null}.bind(this);[this.data,this.view,this.core].forEach(function(o){o.subscribe(o.events,function(p,q){l.push([p,q]);m=m||setTimeout(n,0)}.bind(this))},this)};Object.assign(j.prototype,{init:c("emptyFunction")});f.exports=j}),null);
__d("StructuredInputDOM",["cx","CSS","DOM","FacebarGlobalOptions","createArrayFromMixed","getElementText","isElementNode","isTextNode"],(function a(b,c,d,e,f,g,h){__p&&__p();var i=function i(){return c("FacebarGlobalOptions").graphSearchV2?"_4v1s":"_586o"},j={ENTITY_CLASS:i(),encodeText:function k(l){return l.replace(/ /g,"\xa0")},decodeText:function k(l){return l.replace(/\u00a0/g," ")},createIconNode:function k(l){if(l&&typeof l=="object"){var m=c("DOM").create("i",{className:l.className,style:l.uri&&{backgroundImage:'url("'+l.uri+'")'}});m.setAttribute("data-select","ignore");return m}},createTextNode:function k(l){return c("DOM").create("span",{"data-si":true},j.encodeText(l||""))},createEntityNode:function k(l,m){var n=j.encodeText(l.text),o=j.createIconNode(m.icon),p=c("DOM").create("span",{},o?[o,n]:n),q=(m.className||"").split(/\s+/);q.push(j.ENTITY_CLASS);q.forEach(c("CSS").addClass.bind(c("CSS"),p));var r={si:true,uid:l.uid,type:l.type,text:n,"is-local":l.isLocal,"category-name":l.categoryName,fulltext:n,group:m.group,select:m.select,icon:JSON.stringify(m.icon||null)};for(var s in r)if(r[s]!=null)p.setAttribute("data-"+s,r[s]);return p},convertToTextNode:function k(l){__p&&__p();l.className="";l.setAttribute("data-type","text");l.removeAttribute("data-group");l.removeAttribute("data-select");l.removeAttribute("data-icon");l.removeAttribute("data-uid");l.removeAttribute("data-is-local");l.removeAttribute("data-category-name");for(var m=l.firstChild;m;m=m.nextSibling)if(!c("isTextNode")(m))c("DOM").remove(m)},isEntityNode:function k(l){return c("isElementNode")(l)&&c("CSS").hasClass(l,j.ENTITY_CLASS)},containsOnlyText:function k(l,m){m=c("createArrayFromMixed")(m);for(var n=l.firstChild;n;n=n.nextSibling)if(!(c("isTextNode")(n)||l.nodeName in m))return false;return true},getText:function k(l){return c("getElementText")(l).replace(/ /g,"\xa0")},getDecodedText:function k(l){return j.decodeText(c("getElementText")(l))},getLength:function k(l){return c("getElementText")(l).length},getMarker:function k(l,m,n){__p&&__p();var o=l.firstChild;while(o){var p=j.getLength(o);if(p>m||!o.nextSibling)if(c("isTextNode")(o)||!n)return{node:o,offset:Math.min(m,p)};else return j.getMarker(o,m);else m-=p;o=o.nextSibling}}};f.exports=j}),null);
__d("StructuredInputUtil",["StructuredInputDOM"],(function a(b,c,d,e,f,g){__p&&__p();function h(n,o,p){var q=n.substr(0,o).lastIndexOf(p);return q!==-1?q+1:0}function i(n,o,p){var q=n.indexOf(p,o);return q!==-1?q:n.length}function j(n,o,p){return o===0||o===n.length||n.substr(o,p.length)==p}function k(n,o,p,q){switch(o){case"none":return p;case"all":return q?n.length:0;case"word":if(j(n,p,"\xa0"))return p;else if(q)return i(n,p,"\xa0");else return h(n,p,"\xa0")}}function l(n,o){return o&&c("StructuredInputDOM").isEntityNode(n)&&!c("StructuredInputDOM").isEntityNode(o)}var m={getMarkerAtOffset:function n(o,p){var q=o.firstChild,r=0,s=0;while(q){r+=s;s=c("StructuredInputDOM").getLength(q);if(r+s>p)break;else q=q.nextSibling}return{node:q||o.lastChild,offset:p-r}},validateEntityText:function n(o){__p&&__p();var p=c("StructuredInputDOM").getText(o),q=o.getAttribute("data-fulltext"),r=o.getAttribute("data-group");if(r=="hashtag"){var s=p.match(/#[^\s]+/);q=s&&s[0]}var t=p.indexOf(q),u={prefix:null,entity:null,suffix:null};switch(r){case"none":u.entity=p;break;case"hashtag":case"all":if(t!=-1){u.prefix=p.substr(0,t);u.entity=p.substr(t,q.length);u.suffix=p.substr(t+q.length)}else u.suffix=p;break;case"word":if(t!=-1){u.prefix=p.substr(0,t);p=p.substr(t)}var v=0,w=0;while(v<q.length){w=i(q,v+1,"\xa0");if(p.substr(0,w)!=q.substr(0,w))break;else v=w}u.entity=p.substr(0,v)||null;u.suffix=p.substr(v)||null}return u},getGrouping:function n(o,p){var q=o.getAttribute("data-group"),r=o.getAttribute("data-select");if(p=="select")return r=="group"?q:"none";else return q},snapMarkerToText:function n(o,p){__p&&__p();var q=o.node;if(c("StructuredInputDOM").isEntityNode(q)){var r=o.offset,s=m.getGrouping(q,p);if(s!="none")if(r===0){var t=q.previousSibling;if(l(q,t))return{node:t,offset:c("StructuredInputDOM").getLength(t)}}else if(r==c("StructuredInputDOM").getLength(q)){var u=q.nextSibling;if(l(q,u))return{node:u,offset:0}}}return o},nextMarkerBoundary:function n(o,p,q){var r=o.node;if(c("StructuredInputDOM").isEntityNode(r)&&(!p||o.offset!==0)){var s=m.getGrouping(r,q);if(s!="none")return{node:o.node,offset:k(c("StructuredInputDOM").getText(r),s,o.offset,p)}}return o}};f.exports=m}),null);
__d("StructuredInputCleaner",["DOM","StructuredInputDOM","StructuredInputUtil","UserAgent_DEPRECATED","createArrayFromMixed","getElementText","isTextNode"],(function a(b,c,d,e,f,g){__p&&__p();function h(i,j,k){"use strict";this._node=i;this._selection=j;this._wrapText=k}h.prototype._cleanEntityNode=function(i){"use strict";__p&&__p();var j=i.getAttribute("data-text"),k=c("StructuredInputDOM").getText(i);i.style.cssText="";if(j==k&&c("StructuredInputDOM").containsOnlyText(i,{I:true}))return null;var l=[],m=c("StructuredInputUtil").validateEntityText(i),n=c("StructuredInputDOM").createIconNode(JSON.parse(i.getAttribute("data-icon")));if(!m.entity&&(m.suffix&&!m.prefix||m.prefix&&!m.suffix)){c("StructuredInputDOM").convertToTextNode(i);i.setAttribute("data-text",k);return null}if(m.prefix)l.push(this._createTextNode(m.prefix));if(m.entity){if(this._selection&&c("getElementText")(i)!==m.entity)this._selection.markDirty(i);c("DOM").setContent(i,n?[n,m.entity]:m.entity);i.setAttribute("data-text",m.entity);l.push(i)}if(m.suffix)l.push(this._createTextNode(m.suffix));return l};h.prototype._removeSpecialNodes=function(){"use strict";var i=c("createArrayFromMixed")(this._node.getElementsByTagName("script")),j=c("createArrayFromMixed")(this._node.getElementsByTagName("style"));i.forEach(c("DOM").remove);j.forEach(c("DOM").remove)};h.prototype._collapseNodes=function(){"use strict";for(var i,j=this._node.firstChild;j;j=i){i=j.nextSibling;if(!c("isTextNode")(j)&&!c("StructuredInputDOM").isEntityNode(j)&&!c("StructuredInputDOM").containsOnlyText(j))for(var k=j.lastChild;k;k=j.lastChild){this._node.insertBefore(k,i);i=k}}};h.prototype._createTextNode=function(i){"use strict";if(this._wrapText)return c("StructuredInputDOM").createTextNode(i);else return document.createTextNode(i)};h.prototype.replaceNodes=function(i,j){"use strict";__p&&__p();if(j==null)return;var k=i.length?i[i.length-1].nextSibling:null;i.forEach(function(l){if(j.indexOf(l)===-1)c("DOM").remove(l)},this);j.reverse().forEach(function(l){if(i.indexOf(l)===-1)this._node.insertBefore(l,k);k=l},this)};h.prototype.clean=function(){"use strict";__p&&__p();this._removeSpecialNodes();this._collapseNodes();var i=[],j=function(){if(i.length){this.replaceNodes(i,this._cleanTextNodes(i));i.length=0}}.bind(this);Array.from(this._node.childNodes).forEach(function(k){if(c("StructuredInputDOM").isEntityNode(k)){this.replaceNodes([k],this._cleanEntityNode(k));j(i)}else i.push(k)}.bind(this));j();if(!this._node.firstChild&&c("UserAgent_DEPRECATED").firefox())this._node.appendChild(this._createTextNode())};h.prototype.endOnText=function(){"use strict";var i=function(j,k){if(c("StructuredInputDOM").isEntityNode(j))this._node.insertBefore(this._createTextNode(),k?j:null)}.bind(this);i(this._node.firstChild,true);i(this._node.lastChild,false)};Object.assign(h.prototype,{_cleanTextNodes:function(){__p&&__p();var i=function i(k){return k.nodeName==="BR"||k.nodeName==="SPAN"&&j(k)},j=function j(k){return k.getAttribute("data-si")&&c("StructuredInputDOM").containsOnlyText(k)&&c("StructuredInputDOM").getLength(k)>0};return function(k){if(k.length!=1||!i(k[0])){var l=k.map(c("StructuredInputDOM").getText).join("").replace(/\s+/g," ");return l?[this._createTextNode(l)]:[]}else{k[0].style.cssText="";return}}}()});f.exports=h}),null);
__d("DOMSelection",[],(function a(b,c,d,e,f,g){__p&&__p();(function(){__p&&__p();var h=this,i={isPreceding:function(o,p){return p.compareDocumentPosition(o)&2},contains:function(o,p){if(o.compareDocumentPosition!=null)return o.compareDocumentPosition(p)&16;else return o.contains(p)},isCursorPreceding:function(o,p,q,s){__p&&__p();if(o===q)return p<=s;if(i.isText(o)&&i.isText(q))return i.isPreceding(o,q);if(i.isText(o)&&!i.isText(q))return!i.isCursorPreceding(q,s,o,p);if(!i.contains(o,q))return i.isPreceding(o,q);if(o.childNodes.length<=p)return false;if(o.childNodes[p]===q)return 0<=s;return i.isPreceding(o.childNodes[p],q)},isText:function(o){return o!=null?o.nodeType==3:false},getChildIndex:function(o){var p=0;while(o=o.previousSibling)p++;return p}},j=h.Selection=function(){__p&&__p();function j(o){this.win=o}j.prototype.hasSelection=function(){return j.hasSelection(this.win)};j.prototype.isBidirectional=function(){return j.isBidirectional(this.win)};j.prototype.getOrigin=function(){return j.getOrigin(this.win)};j.prototype.getFocus=function(){return j.getFocus(this.win)};j.prototype.getStart=function(){return j.getStart(this.win)};j.prototype.getEnd=function(){return j.getEnd(this.win)};j.prototype.trySelection=function(o,p,q,s){return j.trySelection(this.win,o,p,q,s)};j.prototype.setSelection=function(o,p,q,s){return j.setSelection(this.win,o,p,q,s)};j.prototype.clearSelection=function(){return j.clearSelection(this.win)};return j}();function k(){if(h.document.selection&&/MSIE 9\./.test(navigator.userAgent))return false;else return!!h.getSelection}if(k()){j.supported=true;j.hasSelection=function(o){var p;return(p=o.getSelection())&&p.focusNode!=null&&p.anchorNode!=null};j.isBidirectional=function(o){return true};j.getOrigin=function(o){var p;if(!((p=o.getSelection())&&p.anchorNode!=null))return null;return[p.anchorNode,p.anchorOffset]};j.getFocus=function(o){var p;if(!((p=o.getSelection())&&p.focusNode!=null))return null;return[p.focusNode,p.focusOffset]};j.getStart=function(o){var p,q,s,t,u,v;if(!j.hasSelection(o))return null;u=j.getOrigin(o),p=u[0],s=u[1];v=j.getFocus(o),q=v[0],t=v[1];if(i.isCursorPreceding(p,s,q,t))return[p,s];return[q,t]};j.getEnd=function(o){var p,q,s,t,u,v;if(!j.hasSelection(o))return null;u=j.getOrigin(o),p=u[0],s=u[1];v=j.getFocus(o),q=v[0],t=v[1];if(i.isCursorPreceding(p,s,q,t))return[q,t];return[p,s]};var l=function(o,p,q,s,t,u){__p&&__p();var v=p.getSelection();if(!v)return;if(t==null)t=q;if(u==null)u=s;if(v.collapse&&v.extend){v.collapse(q,s);v.extend(t,u)}else{r=p.document.createRange();r.setStart(q,s);r.setEnd(t,u);if(o||!j.hasSelection(p)||r.endContainer===t&&r.endOffset===u&&r.startContainer===q&&r.startOffset===s){try{v.removeAllRanges()}catch(w){}v.addRange(r)}}};j.setSelection=l.bind(j,true);j.trySelection=l.bind(j,false);j.clearSelection=function(o){try{var p=o.getSelection();if(!p)return;p.removeAllRanges()}catch(q){}};j.getText=function(o){var p=o.getSelection();if(!p)return;return p.toString()}}else if(h.document.selection){var m=function(o,p,q){__p&&__p();var s,t,u,v,w;t=o.createElement("a");s=p.duplicate();s.collapse(q);w=s.parentElement();while(true){w.insertBefore(t,t.previousSibling);s.moveToElementText(t);if(!(s.compareEndPoints(q?"StartToStart":"StartToEnd",p)>0&&t.previousSibling!=null))break}if(s.compareEndPoints(q?"StartToStart":"StartToEnd",p)===-1&&t.nextSibling){s.setEndPoint(q?"EndToStart":"EndToEnd",p);u=t.nextSibling;v=s.text.length}else{u=t.parentNode;v=i.getChildIndex(t)}t.parentNode.removeChild(t);return[u,v]},n=function(o,p,q,s,t){__p&&__p();var u,v,w,r,x;x=0;u=i.isText(s)?s:s.childNodes[t];v=i.isText(s)?s.parentNode:s;if(i.isText(s))x=t;r=o.createElement("a");v.insertBefore(r,u||null);w=o.body.createTextRange();w.moveToElementText(r);r.parentNode.removeChild(r);p.setEndPoint(q?"StartToStart":"EndToEnd",w);return p[q?"moveStart":"moveEnd"]("character",x)};j.supported=true;j.hasSelection=function(o){var p;if(!o.document.selection)return false;p=o.document.selection.createRange();return p&&p.parentElement().document===o.document};j.getStart=function(o){var p;if(!j.hasSelection(o))return null;p=o.document.selection.createRange();return m(o.document,p,true)};j.getEnd=function(o){var p;if(!j.hasSelection(o))return null;p=o.document.selection.createRange();return m(o.document,p,false)};j.isBidirectional=function(o){return false};j.getOrigin=function(o){return j.getStart(o)};j.getFocus=function(o){return j.getEnd(o)};var l=function(o,p,q,s,t,u){if(t==null)t=q;if(u==null)u=s;var v=p.document.body.createTextRange();n(p.document,v,false,t,u);n(p.document,v,true,q,s);return v.select()};j.setSelection=l.bind(j,true);j.trySelection=l.bind(j,false);j.clearSelection=function(o){return o.document.selection.empty()};j.getText=function(o){if(!j.hasSelection(o))return null;var p=o.document.selection.createRange();return p&&p.text}}else j.supported=false}).call(this);f.exports=Selection}),null);
__d("StructuredInputSelection",["DOM","DOMSelection","Scroll","StructuredInputDOM","StructuredInputUtil","Vector"],(function a(b,c,d,e,f,g){__p&&__p();function h(j){"use strict";var k=j.ownerDocument;this.window=k.defaultView||k.parentWindow;this.root=j;this.selection=false;this.start=new i(this,[]);this.end=new i(this,[]);this.update()}h.prototype.isSupported=function(){"use strict";return!!(c("DOMSelection")&&c("DOMSelection").hasSelection)};h.prototype.update=function(){"use strict";__p&&__p();this.selection=false;if(this.isSupported()&&this.root==document.activeElement)if(c("DOMSelection").hasSelection(this.window)){var j=c("DOMSelection").getStart(this.window),k=c("DOMSelection").getEnd(this.window),l=c("DOMSelection").getFocus(this.window);this.start=this.makeMarker(j);this.end=this.makeMarker(k);this.backward=j[0]==l[0]&&j[1]==l[1];this.selection=this.start.node&&this.end.node}};h.prototype.makeMarker=function(j){"use strict";if(j[0]===this.root)return new i(this,[this.root.childNodes[j[1]],0]);else return new i(this,j)};h.prototype.getFocus=function(){"use strict";return this.backward?this.start:this.end};h.prototype.getOrigin=function(){"use strict";return this.backward?this.end:this.start};h.prototype.move=function(j){"use strict";if(this.selection){this.start.move(j);this.start.snap();this.end.setPosition(this.start);return this.apply()}};h.prototype.expand=function(j){"use strict";__p&&__p();if(this.selection){if(c("DOMSelection").isBidirectional()){this.start.move(!j);this.start.snap();this.end.move(j);this.end.snap()}return this.apply()}};h.prototype.getText=function(){"use strict";if(this.selection&&this.isSupported()){var j=c("DOMSelection").getText(this.window);return j}};h.prototype.getOffset=function(){"use strict";if(this.selection)return this.start.rootOffset};h.prototype.getLength=function(){"use strict";return(this.getText()||"").length};h.prototype.setPosition=function(j,k){"use strict";__p&&__p();this.backward=false;this.selection=true;this.start.setPosition(c("StructuredInputUtil").getMarkerAtOffset(this.root,j));this.start.snap();if(k>0){this.end.setPosition(c("StructuredInputUtil").getMarkerAtOffset(this.root,j+k));this.end.snap()}else this.end.setPosition(this.start);return this.apply()};h.prototype.hasRange=function(){"use strict";return this.selection&&(this.start.node!=this.end.node||this.start.offset!=this.end.offset)};h.prototype.scrollToFocus=function(){"use strict";var j=5,k=this.getFocus();if(k.node){var l=c("Vector").getElementDimensions(this.root).x,m=c("Scroll").getLeft(this.root),n=k.node.offsetLeft+k.node.offsetWidth;if(n-m<j)c("Scroll").setLeft(this.root,n-j);else if(n-m>l-j)c("Scroll").setLeft(this.root,n-l+j)}};h.prototype.apply=function(){"use strict";__p&&__p();if(this.start.hasChanged()||this.end.hasChanged()){var j=this.getOrigin().getMarker(true),k=this.getFocus().getMarker(true);this.selection=this.selection&&j&&j.node&&k&&k.node;if(this.selection&&this.isSupported()){this.start.changed=false;this.end.changed=false;c("DOMSelection").trySelection(this.window,j.node,j.offset,k.node,k.offset);return true}}};h.prototype.markDirty=function(j){"use strict";if(c("DOM").contains(j,this.start.node,j))this.start.changed=true;if(c("DOM").contains(j,this.end.node,j))this.end.changed=true};function i(j,k){"use strict";this.selection=j;this.node=k[0];this.offset=k[1];this.rootOffset=this.getRootOffset(k[0],k[1]);this.sibling=this.node&&this.node.previousSibling;this.changed=false}i.prototype.hasChanged=function(){"use strict";return this.changed||!this.isNodeValid()};i.prototype.isNodeValid=function(){"use strict";if(c("StructuredInputDOM").getLength(this.node)>this.offset){var j=this.node;while(j=j.parentNode)if(j==this.selection.root)return true}};i.prototype.getMarker=function(j){"use strict";if(this.isNodeValid()&&(j&&!this.node.firstChild||!j&&this.node.parentNode==this.selection.root))return this;else return c("StructuredInputDOM").getMarker(this.selection.root,this.rootOffset,j)};i.prototype.move=function(j){"use strict";this.node&&this.setPosition(c("StructuredInputUtil").nextMarkerBoundary(this.getMarker(false),j,"select"))};i.prototype.snap=function(){"use strict";this.node&&this.setPosition(c("StructuredInputUtil").snapMarkerToText(this.getMarker(false),"select"))};i.prototype.setPosition=function(j){"use strict";if(j.offset!=this.offset||j.node!=this.node){this.changed=true;this.node=j.node;this.offset=j.offset;this.rootOffset=this.getRootOffset(this.node,this.offset)}};i.prototype.getRootOffset=function(j,k){"use strict";__p&&__p();var l=0,m=5;while(j&&l++<m)if(j===this.selection.root)return k;else{var n=j;while(n=n.previousSibling)k+=c("StructuredInputDOM").getLength(n);j=j.parentNode}};f.exports=h}),null);
__d("StructuredInput",["csx","cx","fbt","Arbiter","ArbiterMixin","CSS","DataStore","DOM","Event","Input","InputSelection","JSLogger","Keys","Locale","Parent","Scroll","StructuredInputCleaner","StructuredInputDOM","StructuredInputSelection","StructuredInputUtil","Style","UserAgent_DEPRECATED","createArrayFromMixed","createObjectFrom","emptyFunction","getActiveElement","isElementNode","isTextNode","mixin","setTimeoutAcrossTransitions"],(function a(b,c,d,e,f,g,h,i,j){__p&&__p();var k,l,m=229,n=c("createObjectFrom")([c("Keys").UP,c("Keys").DOWN,c("Keys").LEFT,c("Keys").RIGHT,c("Keys").HOME,c("Keys").END]),o=c("createObjectFrom")([c("Keys").BACKSPACE,c("Keys").DELETE]),p=c("createObjectFrom")([c("Keys").SPACE,c("Keys").RETURN]),q=c("createObjectFrom")("IUB".split("").map(function(v){return v.charCodeAt(0)})),r=c("UserAgent_DEPRECATED").firefox(),s=c("UserAgent_DEPRECATED").ie(),t=c("UserAgent_DEPRECATED").webkit();k=babelHelpers.inherits(u,c("mixin")(c("ArbiterMixin")));l=k&&k.prototype;function u(v){"use strict";__p&&__p();l.constructor.call(this);c("DataStore").set(v,"StructuredInput",this);this._root=v;this._richInput=c("DOM").find(v,"._586i");this._textInput=c("DOM").find(v,"._586f");this._placeholderText=c("DOM").scry(v,"._586j")[0];this._hintText=c("DOM").find(v,"._586k");this._contentWidth=null;this._richWidth=null;this._hintNodes=[];c("Arbiter").subscribe(c("JSLogger").DUMP_EVENT,function(w,x){x.structuredInputState={initInputsFinished:!!this._initInputsFinished,initEventsFinished:!!this._initEventsFinished,cleanInputPreTogglesFinished:!!this._cleanInputPreTogglesFinished,cleanInputFinished:!!this._cleanInputFinished,elements:{richInput:!!this._richInput,textInput:!!this._textInput,placeholderText:!!this._placeholderText,hintText:!!this._hintText}}}.bind(this));this.init()}u.prototype.init=function(){"use strict";__p&&__p();this.init=c("emptyFunction");this._initSelection();this._initCleaner();this._initInputs();this._initInputsFinished=true;this._initEvents();this._initEventsFinished=true;this._scheduledCleanInput=false;this._richChanged=false;this._textChanged=false;this._selectionChanged=false;this._selectionIgnore=false;this._imeMode=false;this.cleanInput();this.inform("init",null,c("Arbiter").BEHAVIOR_PERSISTENT)};u.prototype._initInputs=function(){"use strict";__p&&__p();this._richInput.contentEditable=true;this._richInput.spellcheck=false;this._richInput.tabIndex=0;this._richInput.setAttribute("aria-label",j._("Search Facebook"));this._textInput.tabIndex=-1;this._multiline=this._textInput.nodeName=="TEXTAREA";if(!c("CSS").shown(this._richInput)){var v=c("InputSelection").get(this._textInput),w=c("getActiveElement")()===this._textInput;c("DOM").setContent(this._richInput,c("StructuredInputDOM").encodeText(c("Input").getValue(this._textInput)));c("CSS").hide(this._textInput);c("CSS").show(this._richInput);this.cleanInput();if(w){this._richInput.focus();this.setSelection({offset:v.start,length:v.end-v.start})}}this.togglePlaceholder();this._toggleHint()};u.prototype._initEvents=function(){"use strict";__p&&__p();var v=null,w=false,x=function(){this._richChanged=true;w||this.scheduleCleanInput(true)}.bind(this),y=function(){this._textChanged=true;w||this.scheduleCleanInput(false)}.bind(this),z=function(){this._selectionChanged=true;this.scheduleCleanInput(false)}.bind(this),A=function(){this._imeMode=true;this._placeholderText&&c("CSS").hide(this._placeholderText);c("CSS").hide(this._hintText)}.bind(this),B=function(){this._imeMode=false;this._richChanged=true;this.cleanInput()}.bind(this);c("Event").listen(this._richInput,"keydown",function(C){__p&&__p();v=C.keyCode;if(C.ctrlKey&&C.keyCode in q)return C.kill();else if(C.keyCode in n)z();else if(C.keyCode===c("Keys").BACKSPACE&&this._deleteTrailingChunk()){this._richChanged=true;this.cleanInput();return C.kill()}else if(C.keyCode in o)x();else if(C.keyCode==m)A()}.bind(this));c("Event").listen(this._richInput,"keypress",function(C){if(C.keyCode==c("Keys").RETURN){this._multiline&&this._insertText("\n");return C.kill()}else if(!this._selectionChanged&&this._selectionIsText())y();else x()}.bind(this));if(!w){c("Event").listen(this._richInput,"keyup",function(C){if((this._imeMode||C.keyCode!=v)&&C.keyCode in p){B();return C.kill()}else if(this._imeMode){this._textChanged=true;this.cleanInput()}}.bind(this));if(r)c("Event").listen(this._richInput,"input",function(){this._textChanged=true;this.cleanInput()}.bind(this))}else{c("Event").listen(this._richInput,"compositionstart",A);c("Event").listen(this._richInput,"compositionend",function(){setTimeout(B,0)});c("Event").listen(this._richInput,"input",function(){this._textChanged=true;if(!this._imeMode)if(!this._richChanged)this.cleanInput();else this.scheduleCleanInput()}.bind(this))}c("Event").listen(document,"selectionchange",function(){if(this._selectionIgnore)this._selectionIgnore=false;else this._selectionChanged=true}.bind(this));c("Event").listen(this._richInput,"mousedown",function(){this._selectionChanged=true;this._selectionLength=0;this._selectionOffset=0}.bind(this));c("Event").listen(this._richInput,"mouseup",function(){this._selectionChanged=true;this.scheduleCleanInput()}.bind(this));c("Event").listen(this._richInput,"cut",function(){this._richChanged=true;this.scheduleCleanInput(false)}.bind(this));c("Event").listen(this._richInput,"paste",function(C){this._richChanged=true;this.scheduleCleanInput(true)}.bind(this));c("Event").listen(this._richInput,"drop",function(C){this.focus();this.selectAll();this._insertClipboard(C&&C.dataTransfer);return C.kill()}.bind(this));c("Event").listen(this._richInput,"dragover",function(C){C.dataTransfer.dropEffect="move";C.dataTransfer.effectAllowed="move";return C.kill()});c("Event").listen(this._richInput,"focus",function(C){this._toggleHint();this.inform("focus")}.bind(this));c("Event").listen(this._richInput,"blur",function(C){c("CSS").hide(this._hintText);this._imeMode=false;this._richChanged=true;this.scheduleCleanInput(false);this.inform("blur")}.bind(this))};u.prototype._initCleaner=function(){"use strict";this._cleaner=new(c("StructuredInputCleaner"))(this._richInput,this._selection,true)};u.prototype._initSelection=function(){"use strict";this._selection=new(c("StructuredInputSelection"))(this._richInput);this._selectionLength=0;this._selectionOffset=0};u.prototype._insertClipboard=function(v){"use strict";if(v&&typeof v.getData==="function"){var w=v.getData("Text");this._insertText(w)}};u.prototype._deleteTrailingChunk=function(v){"use strict";__p&&__p();var w=this.getSelection();if(w.length>0||w.offset===0)return false;var x=this.getSelection().offset-1,y=c("StructuredInputUtil").getMarkerAtOffset(this._richInput,x);if(y&&c("StructuredInputDOM").isEntityNode(y.node)&&c("StructuredInputUtil").getGrouping(y.node,"select")!=="none"){c("DOM").remove(y.node);return true}return false};u.prototype._selectionIsText=function(){"use strict";var v=this._selection.start.node,w=this._selection.end.node;return v&&v===w&&!c("StructuredInputDOM").isEntityNode(v)&&!c("StructuredInputDOM").isEntityNode(v.parentNode)};u.prototype._insertText=function(v){"use strict";if(v){var w=c("DOM").create("div",{},v);return this._insertNodes(w)}};u.prototype._insertHTML=function(v){"use strict";if(v){var w=c("DOM").create("div"),x=new(c("StructuredInputCleaner"))(w,null,false);w.innerHTML=v;x.clean();return this._insertNodes(w)}};u.prototype._insertNodes=function(v){"use strict";if(document.selection)document.selection.createRange().pasteHTML(v.innerHTML);else document.execCommand("insertHTML",false,v.innerHTML);this._richChanged=true;this.cleanInput()};u.prototype.togglePlaceholder=function(v){"use strict";if(!this._placeholderText)return;var w=c("StructuredInputDOM").getLength(this._richInput)===0;if(v&&w)c("CSS").show(this._placeholderText);else c("CSS").conditionShow(this._placeholderText,w&&!this._imeMode)};u.prototype._toggleHint=function(){"use strict";__p&&__p();var v=c("createArrayFromMixed")(this._hintNodes),w=null,x="",y=c("StructuredInputDOM").getText(this._richInput).toLowerCase();if(!this.hasFocus())return;if(this._contentOverflows()){c("CSS").hide(this._hintText);return}while(v.length&&x.length<y.length){w=v.shift();x+=c("StructuredInputDOM").getText(w)}if(y.length&&x.substr(0,y.length).toLowerCase()==y.toLowerCase()){c("DOM").setContent(this._hintText,Array.from(this._richInput.cloneNode(true).childNodes).filter(function(A){return A.tagName!=="BR"}));var z=c("StructuredInputDOM").createTextNode(x.substr(y.length));v.unshift(z);c("DOM").appendContent(this._hintText,c("DOM").create("span",{className:"_586h"},v));c("CSS").show(this._hintText);c("CSS").hide(this._placeholderText)}else c("CSS").hide(this._hintText)};u.prototype._contentOverflows=function(){"use strict";if(this._richWidth===null)this._richWidth=this._richInput.clientWidth;if(this._contentWidth===null){var v=this._richInput.lastChild;this._contentWidth=c("isElementNode")(v)?v.offsetLeft+v.offsetWidth:0}return this._contentWidth>this._richWidth};u.prototype._forceTop=function(){"use strict";if(!this._multiline)c("Scroll").setTop(this._richInput,0);c("Scroll").setTop(this._root,0)};u.prototype._createStructureNodes=function(v){"use strict";return v.map(function(w){return w.uid||w.type&&w.type!="text"?c("StructuredInputDOM").createEntityNode(w,w.display||{}):c("StructuredInputDOM").createTextNode(w.text)}.bind(this))};u.prototype._suppressInput=function(){"use strict";__p&&__p();if(r||s){if(this._richClean)return;this._richClean=this._richInput.cloneNode(true);this._richClean.contentEditable=false;this._root.insertBefore(this._richClean,this._richInput.nextSibling);c("Scroll").setLeft(this._richClean,c("Scroll").getLeft(this._richInput));c("Style").set(this._richInput,"padding",0);c("Style").set(this._richInput,"height",0)}};u.prototype._revealInput=function(){"use strict";if(!this._richClean)return;c("Style").set(this._richInput,"height","");c("Style").set(this._richInput,"padding","");this._root.removeChild(this._richClean);this.focus();this._richClean=null};u.prototype._cleanInput=function(){"use strict";__p&&__p();var v;if(this._textChanged&&!this._richChanged){this._selection.update();v="change"}else if(this._richChanged||this._selectionChanged){this._selection.update();if(this._richChanged){this._contentWidth=null;this._cleaner.clean();this._cleaner.endOnText();this._selection.apply();v="change"}if(this._selectionChanged){this._cleanSelection();if(this._selectionLength||!this._richChanged)v="select"}}this._revealInput();this._forceTop();this._cleanInputPreTogglesFinished=true;if(this._richChanged||this._textChanged){this.togglePlaceholder();this._toggleHint()}this._selectionIgnore=true;this._selectionChanged=false;this._richChanged=false;this._textChanged=false;this._cleanInputFinished=true;v&&this.inform(v)};u.prototype._cleanSelection=function(){"use strict";var v=this._selection.getLength(),w=this._selection.getOffset();if(v){this._selection.expand(v>=this._selectionLength);v=this._selection.getLength();w=this._selection.getOffset()}this._selectionLength=v;this._selectionOffset=w};u.prototype.cleanInput=function(){"use strict";this._scheduledCleanInput||this._cleanInput()};u.prototype.scheduleCleanInput=function(v){"use strict";v&&this._suppressInput();if(!this._scheduledCleanInput){this._scheduledCleanInput=true;c("setTimeoutAcrossTransitions")(function(){this._cleanInput();this._scheduledCleanInput=false}.bind(this),0)}};u.prototype.setEnabled=function(v){"use strict";this._textInput.disabled=!v;this._richInput.contentEditable=v};u.prototype.getRoot=function(){"use strict";return this._root};u.prototype.getRichInput=function(){"use strict";return this._richInput};u.prototype.getEnabled=function(){"use strict";return!this._textInput.disabled};u.prototype.getText=function(){"use strict";return c("StructuredInputDOM").getDecodedText(this._richInput)};u.prototype.setText=function(v){"use strict";c("DOM").setContent(this._richInput,c("StructuredInputDOM").createTextNode(v));this._richChanged=false;this._selectionChanged=false;this.inform("change")};u.prototype.setHint=function(v){"use strict";this._hintNodes=this._createStructureNodes(v);this._toggleHint()};u.prototype.getStructure=function(){"use strict";var v=[];Array.from(this._richInput.childNodes).forEach(function(w){var x=!c("isTextNode")(w),y=c("StructuredInputDOM").getDecodedText(w);y.length&&v.push({text:y,uid:x?w.getAttribute("data-uid"):null,type:x&&w.getAttribute("data-type")||"text",isLocal:x&&w.getAttribute("data-is-local"),categoryName:x?w.getAttribute("data-category-name"):null})});return v};u.prototype.setStructure=function(v){"use strict";c("DOM").setContent(this._richInput,this._createStructureNodes(v));this._cleaner.clean();this._cleaner.endOnText();this.togglePlaceholder();this._toggleHint();this._richChanged=false;this._selectionChanged=false;this.inform("change")};u.prototype.getContentDimensions=function(){"use strict";var v=this._richInput.lastChild;return{width:v?v.offsetLeft+v.offsetWidth:0,height:v?v.offsetTop+v.offsetHeight:0}};u.prototype.getSelection=function(){"use strict";if(this._selection)return{offset:this._selection.getOffset(),length:this._selection.getLength()}};u.prototype.setSelection=function(v){"use strict";if(this.hasFocus()&&this._selection){this._selection.update();this._selection.setPosition(v.offset,v.length);this._selection.scrollToFocus();this._selectionChanged=false;this.inform("select")}};u.prototype.moveSelectionToEnd=function(){"use strict";this.setSelection({length:0,offset:c("StructuredInputDOM").getLength(this._richInput)})};u.prototype.isSelectionAtEnd=function(){"use strict";var v=this.getSelection().offset,w=c("StructuredInputDOM").getLength(this._richInput);return v>=w};u.prototype.selectAll=function(){"use strict";this.setSelection({offset:0,length:c("StructuredInputDOM").getLength(this._richInput)})};u.prototype.hasFocus=function(){"use strict";return c("DOM").contains(this._root,document.activeElement)};u.prototype.focus=function(){"use strict";this._richInput.focus()};u.prototype.blur=function(){"use strict";__p&&__p();var v={position:"absolute",top:0,width:"1px",height:"1px"};if(c("Locale").isRTL())v.right="-100px";else v.left="-100px";var w=c("DOM").create("input",{type:"text",tabIndex:-1,style:v});c("DOM").appendContent(this._root,w);var x=function x(){if(this.hasFocus()||t&&document.activeElement===document.body){w.focus();w.blur()}};this.blur=x;this.blur()};u.getInstance=function(v){var w=c("Parent").bySelector(v,"._586g");if(!w)throw new Error("No DOMElement structured input found using "+v);return c("DataStore").get(w,"StructuredInput")||new u(w)};f.exports=u}),null);
__d("FacebarTypeaheadInput",["csx","ArbiterMixin","DOM","FacebarStructuredText","Locale","SimpleStructuredInput","StructuredInput","Vector","mixin"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j,k={text:{className:"text",group:"all",select:"none"},ent:{className:"entity",group:"all",select:"group"},"ent:hashtag_exact":{className:"entity",group:"hashtag",select:"none"}};function l(n){return Object.assign(n.toStruct(),{display:k[n.getType()]||k[n.getTypePart(0)]})}i=babelHelpers.inherits(m,c("mixin")(c("ArbiterMixin")));j=i&&i.prototype;function m(n){__p&&__p();j.constructor.call(this);this.root=n;var o=c("DOM").scry(this.root,"._586i")[0];if(o)this.input=c("StructuredInput").getInstance(n);else this.input=c("SimpleStructuredInput").getInstance(n);this.value=null;this.selection={offset:0,length:0};this.resetOnChange=true;this.initEvents()}m.prototype.initEvents=function(){var n=function(o,p){this.inform(o,p)}.bind(this);this.input.subscribe("blur",n);this.input.subscribe("focus",n);this.input.subscribe("change",function(o,p){if(this.resetOnChange)this.value=null;this.inform("change",p)}.bind(this))};m.prototype.togglePlaceholder=function(n){if(this.input instanceof c("StructuredInput"))return this.input.togglePlaceholder(n);return null};m.prototype.focus=function(){this.input.focus()};m.prototype.blur=function(){this.input.blur()};m.prototype.getElement=function(){return this.root};m.prototype.getRawInputElement=function(){var n=c("DOM").scry(this.root,"._586i")[0];if(n==null)return c("DOM").scry(this.root,"._1frb")[0];return n};m.prototype.getValue=function(){if(this.value==null)this.value=c("FacebarStructuredText").fromStruct(this.input.getStructure());return this.value};m.prototype.getLength=function(){return this.getValue().getLength()};m.prototype.resetPlaceholder=function(){this.input.resetPlaceholder()};m.prototype.setValue=function(n,o){this.value=n;this.resetOnChange=!!o;var p=n.toArray().map(l);this.input.setStructure(p);this.input.setSelection({offset:n.getLength(),length:0});this.resetOnChange=true};m.prototype.storeSelection=function(){this.selection=this.input.getSelection()};m.prototype.restoreSelection=function(){if(this.selection)this.input.setSelection(this.selection)};m.prototype.clearSelection=function(){this.input.setSelection({offset:this.getLength(),length:0})};m.prototype.setHint=function(n){var o=n&&!n.hasRTL()&&!c("Locale").isRTL()?n.toArray().map(l):[];this.input.setHint(o)};m.prototype.isSelectionAtEnd=function(){return this.input.isSelectionAtEnd()};m.prototype.selectInput=function(n){this.input.setSelection({offset:n||0,length:this.getLength()})};Object.assign(m.prototype,{events:["change","focus","blur"]});f.exports=m}),null);
__d("FacebarTypeaheadCore",["csx","cx","invariant","Arbiter","ArbiterMixin","Base64","CSS","DOM","Event","FacebarGlobalOptions","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarResultStoreUtils","FacebarStructuredText","FacebarTypeaheadInput","immutable","Keys","KeywordsSearchResultConfig","Parent","Random","URI","generateBrowseSessionID","getActiveElement","mixin"],(function a(b,c,d,e,f,g,h,i,j){"use strict";__p&&__p();var k,l;k=babelHelpers.inherits(m,c("mixin")(c("ArbiterMixin")));l=k&&k.prototype;function m(n){l.constructor.call(this);this.events=["session","focus","select","change","execute","blur","focusStartTime","open"];this._squashedEntityIDsByQuery=c("immutable").Map();Object.assign(this,n)}m.prototype.init=function(n,o,p){__p&&__p();if(window.getSelection===null)throw new Error("Facebar: window.getSelection is null!");this.init=function(){};this.data=n;this.view=o;this.root=p;this.facebarRoot=c("Parent").bySelector(p,"._585-");this.button=c("DOM").find(this.facebarRoot,"._4w98");this.windowFocused=true;this.isFocused=false;this.hoverAnimation=null;this.stickyQuery=null;this.settedQuery=null;this.selectedQuery=null;this.currentQuery=null;this.isSuggestionBagdeVisible=false;this.initSubcomponents();this.initEvents();this.checkValue();this.checkSingleState();this.checkLocal();this.checkCategoryName()};m.prototype.initSubcomponents=function(){var n=c("DOM").find(this.root,"._5861");this.input=new(c("FacebarTypeaheadInput"))(n);this.view.setInputElement(this.input.getRawInputElement())};m.prototype.initEvents=function(){__p&&__p();c("Event").listen(this.root,"keydown",this.keydown.bind(this));c("Event").listen(this.root,"keyup",this.keyup.bind(this));c("Event").listen(this.root.parentNode,"mousedown",this.mousedown.bind(this));c("Event").listen(this.view.getElement(),"mousedown",this.mousedown.bind(this));c("Event").listen(window,"focus",this.focusWindow.bind(this));c("Event").listen(window,"blur",this.blurWindow.bind(this));this.view.subscribe("select",this.selectView.bind(this));this.view.subscribe("highlight",this.highlightView.bind(this));this.view.subscribe("render",this.highlightView.bind(this));this.view.subscribe("hideHelp",this.performQuery.bind(this));this.input.subscribe("focus",this.focusInput.bind(this));this.input.subscribe("blur",this.blurInput.bind(this));this.input.subscribe("change",this.changeInput.bind(this));this.data.subscribe("activity",this.typeaheadActivity.bind(this));this.data.subscribe("respond",this.completeData.bind(this));this.data.subscribe("nullstateReady",this.performQueryIfVisible.bind(this));this.data.subscribe("reloadNullstate",this.performQuery.bind(this));c("Arbiter").subscribe("FacebarTypeahead.clearRecentSearches",function(){return this.clearRecentSearches()}.bind(this));c("Arbiter").subscribe("FacebarTypeahead.focus",function(){this.input.focus();setTimeout(function(){this.input.clearSelection()}.bind(this),0)}.bind(this));c("Event").listen(this.button,"click",this.buttonDownOrClick.bind(this));c("Event").listen(this.button,"mousedown",this.buttonDownOrClick.bind(this));c("Event").listen(this.button,"mouseup",this.buttonUp.bind(this));setTimeout(this.initFocus.bind(this),0)};m.prototype.initFocus=function(){if(!this.lazyFocused&&c("DOM").contains(this.input.root,c("getActiveElement")())){this.lazyFocused=true;this.isFocused=true;this._newSession();this.inform("focus",{catchup:true});this.open(true)}};m.prototype.setStartTime=function(n){this.inform("focusStartTime",{time:n})};m.prototype.cleanQuery=function(n){n=babelHelpers["extends"]({},n)||{};if(!n.structure)n.structure=new(c("FacebarStructuredText"))();if(!c("FacebarGlobalOptions").allowGrammar||c("FacebarJSConstants").nonGrammarTypes[n.type])n.structure=c("FacebarStructuredText").fromString(n.structure.toString());n.structure instanceof c("FacebarStructuredText")||j(0);return n};m.prototype._unlockQuery=function(){var n=this.input.getValue();if(n.hasType("ent")&&n.trim().getCount()===1){this.input.storeSelection();this.input.setValue(c("FacebarStructuredText").fromString(n.toString()));this.input.restoreSelection()}};m.prototype.setPageQuery=function(n){n=this.cleanQuery(n);var o=this.input.getValue(),p=n.structure,q=!p.isEmptyOrWhitespace()&&(o.isEmptyOrWhitespace()||!o.matches(p));return this.selectQuery(n,q)};m.prototype.selectQuery=function(n,o){o=o!==false;n=this.cleanQuery(n);if(o||!this.selectedQuery){if(o||this.getValue().isEmptyOrWhitespace())this.setQuery(n);this.selectedQuery=n}return n};m.prototype.completeSelection=function(){var n=this.view.getSelection();if(n&&!n.search){this.data.saveResult(n);n.structure=n.structure.pad();this.setQuery(n);return true}return false};m.prototype.setQuery=function(n){__p&&__p();var o=arguments.length<=1||arguments[1]===undefined?true:arguments[1];n=this.cleanQuery(n);if(n.structure.hasType("blank"))n.structure=new(c("FacebarStructuredText"))(n.structure.toArray().filter(function(p){return p.getType()!="blank"}));this.input.setValue(n.structure);this.settedQuery=n;this.stickyQuery=o===false?this.stickyQuery:n;this.checkValue();this.checkSingleState();this.checkLocal();this.checkCategoryName()};m.prototype.checkValue=function(){var n=arguments.length<=0||arguments[0]===undefined?false:arguments[0];if(!n&&this.value&&this.value.getHash()===this.input.getValue().getHash())return;this.performQueryIfVisible();this.showSearchSuggestionBadgeIfPossible()};m.prototype.showSearchSuggestionBadgeIfPossible=function(){__p&&__p();if(this.isNullState()){if(!this.isSuggestionBagdeVisible&&this.data.resultStore.injectedSuggestionCount){c("Arbiter").inform("FacebarTypeahead.showSuggestionBadge");this.isSuggestionBagdeVisible=true}}else if(this.isSuggestionBagdeVisible){c("Arbiter").inform("FacebarTypeahead.hideSuggestionBadge");this.isSuggestionBagdeVisible=false}};m.prototype.checkSingleState=function(){var n=this.input.getValue();this.data.setSingleState(n.getCount()===1&&n.hasType("ent"))};m.prototype.checkLocal=function(){var n=this.input.getValue();this.data.setLocal(n.getCount()===1&&n.isLocal())};m.prototype.checkCategoryName=function(){var n=this.input.getValue();if(n.getCategoryName()!==null)this.data.setCategoryName(n.getCategoryName())};m.prototype.isNullState=function(){return this.input.getValue().getHash()===""};m.prototype.performQueryIfVisible=function(){if(!this.view.visible)return;this.performQuery()};m.prototype.performQuery=function(){this.value=this.nextQuery=this.getValue();if(c("FacebarGlobalOptions").graphSearchV2)this.view.resetIndex();this.data.query(this.nextQuery);this.currentQuery=this.nextQuery};m.prototype.requery=function(){if(this.currentQuery)this.data.query(this.currentQuery)};m.prototype.executeQuery=function(n){__p&&__p();this._browseSessionID=c("generateBrowseSessionID")({appName:"www",edge:"keywords_search"});var o=this.isNullState();n=this.cleanQuery(n);this._setSquashedEntityIDsFromQuery(n);if(c("FacebarGlobalOptions").facebar_use_js_session_id)n.csid=String(c("Random").uint32())+String(c("Random").uint32());var p=this.inform("execute",n),q=this.getSessionID();this.close();if(c("FacebarGlobalOptions").allowGrammar)this.selectQuery(n);else this.selectQuery();if(c("FacebarGlobalOptions").hasRecentSearchNullState&&n.type!=="shortcut"&&(!o||n.isInjectedSuggestion)){this.data.resultStore.addRecentEntryToNullState(n);if(n.isInjectedSuggestion){c("Arbiter").inform("FacebarTypeahead.removeInjectedSuggestion");--this.data.resultStore.injectedSuggestionCount;this.performQuery()}}if(!p)this._navigateToQuery(n,q,n.csid)};m.prototype.getSearchType=function(){return"facebar"};m.prototype._newSession=function(){if(this._sessionID!=null)return;this._sessionID=Math.random().toString();this.inform("session",this._sessionID,c("Arbiter").BEHAVIOR_STATE)};m.prototype._closeSession=function(){this._sessionID=null;this.inform("session",null,c("Arbiter").BEHAVIOR_STATE)};m.prototype.getSessionID=function(){return this._sessionID};m.prototype.getBrowseSessionID=function(){return this._browseSessionID};m.prototype._navigateToQuery=function(n,o,p){__p&&__p();var q=this.data.facebarConfig;if(n.uri){n.uri.addQueryData(n.extra_uri_params);n.uri.addQueryData({ref:"br_tf"});var r=n.uid!=null&&n.uid.match(/^[0-9]+$/)!=null;if(n.structure&&(n.type=="websuggestion"||n.type==c("KeywordsSearchResultConfig").result_type||n.type=="grammar"&&(!q||String(n.uri.getPath()).startsWith(q.search_path))||c("FacebarGlobalOptions").hasKeywordOnlyTypeahead&&r)){var s=this.data.getRawStructure(n.structure).text_form,t=c("Base64").encode(encodeURIComponent(s)).replace(/\=+$/,""),u={sid:o,qs:t,gv:this.data.getQueryData().grammar_version,ent_ids:this.getSquashedEntityIDsFromQueryString(String(n)),bsid:this._browseSessionID};if(p)u.csid=p;n.uri.addQueryData({ref:c("FacebarKeywordSearchUtils").encodeFacebarURIParams(u),bs:n.alternateSemantic})}n.uri.go();return}};m.prototype.reset=function(){this.selectQuery();this.inform("reset");this.showSearchSuggestionBadgeIfPossible();c("FacebarKeywordSearchUtils").clearSelectedTabInfo()};m.prototype.open=function(n){__p&&__p();this.inform("open");this.view.show(this.facebarRoot.offsetWidth);this.input.focus({catchup:n});this.checkValue(true);this.checkSingleState();this.checkLocal();this.checkCategoryName();this.highlightButton();if(!this.isFocused){this.isFocused=true;this._newSession();this.inform("focus")}};m.prototype.close=function(){__p&&__p();this._closeSession();if(this.inform("close")===false)return;if((!this.value||this.value.isEmptyOrWhitespace())&&this.selectedQuery)this.input.setValue(this.selectedQuery.structure);else if(this.stickyQuery)this.input.setValue(this.stickyQuery.structure);this.input.setHint(null);this.view.hide();this.view.setAutoSelect(false);this.inform("session",null,c("Arbiter").BEHAVIOR_STATE);this.isFocused=false;this.unlightButton()};m.prototype.getElement=function(){return this.root};m.prototype.getValue=function(){return this.input.getValue()};m.prototype.getText=function(){return this.getValue().toString()};m.prototype.submitQuery=function(n){__p&&__p();if(c("FacebarGlobalOptions").graphSearchV2&&this.view.index<0){var o=this.input.getValue(),p=this.data.getRawStructure(o);if(p&&!p.is_empty){var q=!p.raw_text?c("FacebarResultStoreUtils").getRawTextFromStructured(o.toArray()):p.raw_text,r=c("FacebarKeywordSearchUtils").makeFacebarEntry(q);r.position=n;this.inform("magSearch",r);this.executeQuery(r)}}else this.view.select()};m.prototype.keydown=function(event){__p&&__p();var n=true,o=c("Event").getKeyCode(event);if(event.metaKey===true)this.metaOnKeyDown=true;if(!this.isFocused)this.open();switch(o){case c("Keys").ESC:this.reset();this.close();break;case c("Keys").RIGHT:n=this.input.isSelectionAtEnd()&&this.completeSelection();break;case c("Keys").UP:this.view.prev();break;case c("Keys").DOWN:this.view.next();break;case c("Keys").RETURN:var p=-2;this.submitQuery(p);break;case c("Keys").PAGE_UP:this.view.first();break;case 222:var q=this.input.value.trim();if(!event.getModifierState("shift")&&q.endsOnType("ent"))this.input.setValue(q);n=false;break;default:var r=o<=46&&o!==8&&o!==32,s=o>=112&&o<=126,t=o===144||o===145,u=o===91||o===92||o===93||o===224;if(!r&&!s&&!t&&!event.metaKey&&!u){this.data.setSingleState(false);this.data.setLocal(false);if(c("FacebarGlobalOptions").autohighlight)this.view.setAutoSelect(true)}this.stickyQuery=null;n=false;break}this.input.storeSelection();if(n){event.preventDefault();event.stopPropagation()}};m.prototype.keyup=function(event){var n=c("Event").getKeyCode(event),o=n<=46&&n!==8&&n!==32,p=n>=112&&n<=126,q=n===144||n===145,r=n===91||n===92||n===93||n===224;if(!o&&!p&&!q&&!event.metaKey&&!r&&!this.metaOnKeyDown)this._unlockQuery();if(!r)this.metaOnKeyDown=false};m.prototype.mousedown=function(event){if(c("FacebarGlobalOptions").autohighlight)this.view.setAutoSelect(true);this.input.storeSelection();if(event.target instanceof Element&&c("Parent").bySelector(event.target,"._50c9"))event.preventDefault()};m.prototype.focusWindow=function(){this.windowFocused=true};m.prototype.blurWindow=function(){this.windowFocused=false};m.prototype.selectView=function(n,o){if(!o||!o.selected)return;this.inform("select",o);var p=this.cleanQuery(o.selected);this.executeQuery(p)};m.prototype.highlightView=function(){var n=this.view.getSelection();if(c("FacebarGlobalOptions").graphSearchV2)this.input.setHint(n?n.structure:null);else n&&this.input.setHint(n.structure)};m.prototype.blurInput=function(){setTimeout(function(){if(this.windowFocused||c("URI").getRequestURI().getSubdomain()==="apps"){this.input.togglePlaceholder();this.close()}}.bind(this),0)};m.prototype.changeInput=function(){this.inform("change");this.checkValue();this.checkLocal();this.inform("change_end")};m.prototype.focusInput=function(){this.open();this.input.togglePlaceholder(false)};m.prototype.updateData=function(){this.view.setLoading(this.loading)};m.prototype.completeData=function(n,o){if(o.forceDisplay||this.value&&this.value.matches(o.value)){var p=c("FacebarGlobalOptions").graphSearchV2?!o.results.length:!o.results.length&&!this.loading&&o.isEmptyResults;this.view.render(o.value,o.results,o.isAsync,p);if(this.tabQueued&&this.completeSelection())delete this.tabQueued}};m.prototype.typeaheadActivity=function(n,o){this.fetching=o.activity;if(this.loading!==this.fetching){this.loading=this.fetching;this.updateData()}};m.prototype.getNameTextFromSelected=function(){var n=this.settedQuery&&this.settedQuery.semantic,o=this.data.facebarConfig&&this.data.facebarConfig.name_functions,p=n&&o&&n.match(/[a-z-]+\([^()]+\)/g);if(p)for(var q=0;q<p.length;q++){var r=p[q].match(/([a-z-]+)\(([^()]+)\)/);if(r&&o.includes(r[1]))return r[2]}return this.value.toString()};m.prototype.clearRecentSearches=function(){this.data.resultStore.clearRecentSearches()};m.prototype.highlightButton=function(){c("CSS").addClass(this.button,"_4w97")};m.prototype.unlightButton=function(){if(c("CSS").matchesSelector(this.button,"._4w97"))c("CSS").removeClass(this.button,"_4w97")};m.prototype.buttonDownOrClick=function(event){event.preventDefault()};m.prototype.buttonUp=function(){if(!this.isFocused)this.focusInput();else this.submitQuery(-1)};m.prototype._setSquashedEntityIDsFromQuery=function(n){__p&&__p();var o=[];if(n.itemLoggingInfo){if(n.itemLoggingInfo.kwEntIds)o=n.itemLoggingInfo.kwEntIds;else if(n.itemLoggingInfo.kwEntId)o=[n.itemLoggingInfo.kwEntId]}else if(n.entity_ids)o=n.entity_ids;this._squashedEntityIDsByQuery=this._squashedEntityIDsByQuery.set(n.text,o)};m.prototype.getSquashedEntityIDsFromQueryString=function(n){var o=this._squashedEntityIDsByQuery.get(n);if(o==null)return[];return o};m.clearRecentSearches=function(){c("Arbiter").inform("FacebarTypeahead.clearRecentSearches")};f.exports=m}),null);
__d("SearchTypeaheadRecorder",["AsyncRequest","Banzai","BanzaiNectar","BanzaiScuba","CurrentUser","Event","FacebarGlobalOptions","Keys","TokenizeUtil","Vector","clickRefAction","ge","mapObject","throttle","whitelistObjectKeys"],(function a(b,c,d,e,f,g){__p&&__p();var h={WAITING:"WAITING",SUCCESS:"SUCCESS",NO_RESULTS:"NO_RESULTS",ERROR:"ERROR"};function i(k){"use strict";this.init(k);this.initEvents(k)}i.prototype.init=function(k){"use strict";__p&&__p();this.core=k.getCore();this.data=k.getData();this.view=k.getView();this.element=this.core.getElement();this.initTime=Date.now();this._onloadTime=0;this._extraRecorder=[];this.performanceTimings={};this.allFromSingleState=false;this.allFromNullState=false;var l=c("ge")("search_first_focus");this.initStartTime=l&&l.value;this.bootstrapStats={bootstrapped:0};this.type="legacy_search";this._reset()};i.prototype._reset=function(){"use strict";__p&&__p();this.stats={};this.avgStats={};this.appendStats={};this._backspacing=false;this.backendQueries=[];this.backendQueriesStatus={};this._topreplace=false;this._inflightRequests={};var k=Math.random().toString();this.data.setQueryData({sid:k});this.view.setSid(k);this.recordStat("sid",k);this.recordStat("keypressed",0)};i.prototype.initEvents=function(){"use strict";__p&&__p();this.core.subscribe("focus",function(event){if(!this.stats.session_start_time){this.recordStat("session_start_time",Date.now());var k=new Date(),l=k.getTimezoneOffset(),m=Date.now()-l*60*1e3;this.recordStat("session_start_time_user_timezone",m);this._lastRenderTime=0;this._firstKeypressTime=null}}.bind(this));this.core.subscribe("blur",function(event){var k=Date.now();for(var l in this._inflightRequests){var m=this._inflightRequests[l],n=k-m;this.recordAvgStat("search_endpoint_ms_from_js",n)}this.recordStat("session_end_time",k);this.submit()}.bind(this));this.view.subscribe("select",function(k,l){this.recordStat("time_between_select_and_last_render",Date.now()-this._lastRenderTime);if(this._firstKeypressTime!=null)this.recordStat("keypress_to_select_time",Date.now()-this._firstKeypressTime);this.recordSelectInfo(l)}.bind(this));this.view.subscribe("render",function(k,l){this._lastRenderTime=Date.now();this.recordRender(l)}.bind(this));this.data.subscribe("logPerformanceTiming",function(k,l){this.performanceTimings[l.field]=l.value}.bind(this));this.data.subscribe("logProxygenForkPoolId",function(k,l){this.recordStat(l.field,l.value)}.bind(this));this.data.subscribe("activity",function(k,l){this.recordStat("pending_request",l.activity)}.bind(this));this.data.subscribe("respondValidUids",function(k,l){this.validUids=l.slice(0)}.bind(this));this.data.subscribe("beforeQuery",function(k,l){__p&&__p();if(!l.value){this.query="";this.results=[];this.data.lastNullOrSingleStateFetchStartTime=Date.now();return}if(!this.stats.first_query_time)this.recordStat("first_query_time",Date.now());this.query=l.value;if(!this.queryStartTime)this.queryStartTime=[];this.queryStartTime[this.query]=Date.now();this.recordCountStat("num_queries")}.bind(this));this.data.subscribe("queryEndpoint",function(k,l){this.recordCountStat("num_search_ajax_requests");this.recordAvgStat("endpoint_query_length",l.value.length);this._inflightRequests[l.value]=Date.now()}.bind(this));this.data.subscribe("onload",function(k,l){this._onloadTime=l.time}.bind(this));this.data.subscribe("bootstrapped",function(k,l){this.bootstrapStats.endTime=l.time;this.bootstrapStats.bootstrapped=1}.bind(this));this.core.subscribe("recordFunction",function(k,l){this._extraRecorder.push(l)}.bind(this));this.data.subscribe("endpointStats",function(k,l){__p&&__p();var m=l.info,n=m.fetch_end-m.fetch_start;if(m.value)this.recordAvgStat("search_endpoint_ms_from_js",n);else this.bootstrapStats[m.type]=n;if(m.coeff2_ts)this.bootstrapStats.coeff2_ts=m.coeff2_ts;if(typeof m.browserCacheHit!="undefined")this.recordCountStat(m.browserCacheHit?"bootstrap_cachehits":"bootstrap_cachemisses");if(this._inflightRequests[m.value])delete this._inflightRequests[m.value]}.bind(this));this.data.subscribe("fetchComplete",function(k,l){var m=l.entries,n=l.value;if(n&&this.backendQueriesStatus[n]){this._addDurationForBackendQuery(this.backendQueriesStatus[n]);this.backendQueriesStatus[n].status=m&&m.length>0?h.SUCCESS:h.NO_RESULTS}}.bind(this));this.data.subscribe("fetchError",function(k,l){var m=l.fetch_context,n=m.value;if(m.bootstrap||!n)return;if(this.backendQueriesStatus[n]){this.backendQueriesStatus[n].status=h.ERROR;this._addDurationForBackendQuery(this.backendQueriesStatus[n])}}.bind(this));this.data.subscribe("query",function(k,l){this.recordAvgStat("num_results_from_cache",l.results.length)}.bind(this));this.data.subscribe("backend_topreplace",function(k,l){if(false===this._topreplace){this.recordStat("backend_topreplace",1);this._topreplace=true}}.bind(this));this.data.subscribe("completeFetch",function(k,l){if(this.core.scubaInfo){var m=l.response,n={recv:l.stats.fetch_end-l.stats.fetch_start,render:Date.now()-l.stats.fetch_start,payload_size:JSON.stringify(m).length};if(!m.payload.entities)m.payload.entities=this.buildResults();this.logToScuba(m,n,this.core.scubaInfo,this.query,this.type)}}.bind(this));this.data.subscribe("completeCacheFetch",c("throttle")(function(k,l){if(this.core.scubaInfo)this.logToScuba({},{},this.core.scubaInfo,this.query,this.type)}.bind(this),500));c("Event").listen(this.element,"keydown",function(event){__p&&__p();this.recordStat("keypressed",1);this.recordCountStat("count_keys_pressed");if(c("Event").getKeyCode(event)==c("Keys").BACKSPACE){if(!this._backspacing&&this.query){this._backspacing=true;this.recordAppendStat("before_backspace_queries",this.query)}}else this._backspacing=false;if(this._firstKeypressTime==null)this._firstKeypressTime=Date.now()}.bind(this));this.data.subscribe("beforeFetch",function(k,l){var m=l.request.data?l.request.data.value:null;if(!m)return;this.backendQueries.push(m);this.backendQueriesStatus[m]={status:h.WAITING,start_time:Date.now()}}.bind(this))};i.prototype.recordStat=function(k,l){"use strict";this.stats[k]=l};i.prototype.recordCountStat=function(k){"use strict";var l=this.stats[k];this.stats[k]=l?l+1:1};i.prototype.recordAvgStat=function(k,l){"use strict";if(this.avgStats[k]){this.avgStats[k][0]+=l;++this.avgStats[k][1]}else this.avgStats[k]=[l,1]};i.prototype.recordAppendStat=function(k,l){"use strict";if(!Object.prototype.hasOwnProperty.call(this.appendStats,k))this.appendStats[k]=[];this.appendStats[k].push(l)};i.prototype.recordRender=function(k){"use strict";__p&&__p();this.results=k.filter(function(v){return v.uid!="search"&&v.type!="disabled_result"&&v.type!="header"}).map(function(v){return babelHelpers["extends"]({},v)});var l=null;if(this.queryStartTime)l=this.queryStartTime[this.query];var m=this.results.every(function(v){return v.fromCache||v.isSeeMore}),n=this.results.every(function(v){return v.isFromGSEF||v.fromCache||v.isSeeMore||v.isJSBootstrapMatch})&&this.results.some(function(v){return v.isFromGSEF}),o=this.results.every(function(v){return v.isGloballyCachedKeyword||v.fromCache||v.isSeeMore||v.isJSBootstrapMatch})&&this.results.some(function(v){return v.isGloballyCachedKeyword}),p=this.results.every(function(v){return v.isNullState}),q=this.results.every(function(v){return v.isSingleState}),r=this.results.every(function(v){return v.exactMatchKeyword||v.isSeeMore});this.allFromSingleState=q;this.allFromNullState=p;if(this.results.length&&this.data.lastNullOrSingleStateFetchStartTime&&p){this.recordStat("time_render_null_state",Date.now()-this.data.lastNullOrSingleStateFetchStartTime);this.data.lastNullOrSingleStateFetchStartTime=null}else if(this.data.lastNullOrSingleStateFetchStartTime&&this.results.length&&q)this.recordStat("time_render_single_state",Date.now()-this.data.lastNullOrSingleStateFetchStartTime);else if(l){var s=Date.now()-l;if(r)this.recordAppendStat("times_render_gs_echo",s);else this.recordAppendStat(m?"times_render_local":"times_render_remote",s);if(!m&&n)this.recordAppendStat("time_render_gs_early_fetch",s);if(!m&&o)this.recordAppendStat("time_render_globally_cached_keywords",s);if(!m&&!n&&!o)this.recordAppendStat("time_render_remote_main_call",s)}this.data.lastNullOrSingleStateFetchStartTime=null;var t=c("Vector").getViewportDimensions();this.recordStat("window_size_width",t.x);this.recordStat("window_size_height",t.y);if(this.results.length>0&&!this.stats.first_result_time)this.recordStat("first_result_time",Date.now());var u="typed";if(this.allFromNullState)u="nullstate";else if(this.allFromSingleState)u="singlestate";this.recordStat("last_state",u)};i.prototype.recordSelectInfo=function(k){"use strict";__p&&__p();var l=k.selected,m=k.index;if(l.groupIndex!==undefined)m=k.index-l.groupIndex-1;var n={href:l.path},o=l.dataGT?{gt:JSON.parse(l.dataGT)}:{};c("clickRefAction")("click",n,null,null,o);if(l.uid=="search"||l.uid=="people_search"){this.recordStat("selected_position",this.results!=null?this.results.length:0);this.recordStat("selected_search",1)}else if(l.uid=="invite")this.recordStat("selected_invite",1);else{var p=l.log_type||l.rankType||l.render_type||l.type,q=p=="friend"?"user":p;this.recordStat("selected_"+q,1);this.recordStat("selected_position",m);this.recordStat("selected_type",p);this.recordStat("selected_name_length",l.text.length);this.recordStat("selected_id",l.uid);this.recordStat("selected_degree",l.bootstrapped?1:2);this.recordStat("selected_recent_search",l.recent_search);var r=c("TokenizeUtil").parse(this.data.getTextToIndex(l)).tokens,s=j(r,this.query);if(s)this.recordStat("matched_terms",s);this.recordStat("selected_text",l.text)}var t={};this._extraRecorder.forEach(function(u){u(k,this.results,t)}.bind(this));this.recordStat("extra_select_info",JSON.stringify(t));this.recordStat("selected_with_mouse",k.clicked?1:0)};i.prototype._addDurationForBackendQuery=function(k){"use strict";if(k.start_time){k.duration=Date.now()-k.start_time;delete k.start_time}};i.prototype._dataToSubmit=function(){"use strict";__p&&__p();this.recordStat("candidate_results",this.buildResults());this.recordStat("query",this.query);this.recordStat("init_time",this.initTime);if(this.initStartTime){this.recordStat("init_start_time",this.initStartTime);this.recordStat("onload_time",this._onloadTime);this.initStartTime=0}this.recordStat("bootstrapped",this.bootstrapStats.bootstrapped);if(this.bootstrapStats.endTime){this.recordStat("bootstrapped_time",this.bootstrapStats.endTime);this.recordStat("user_bootstrap_ms",this.bootstrapStats.user);this.recordStat("other_bootstrap_ms",this.bootstrapStats.other);this.bootstrapStats.endTime=0}var k=this.data.getBootstrapError();if(k)this.recordStat("bootstrap_error",1);this.recordStat("coeff2_ts",this.bootstrapStats.coeff2_ts);this.recordStat("max_results",this.data._maxResults);if(this.backendQueries.length>0){if(this.backendQueries.length>this.data.logBackendQueriesWindow)this.backendQueries=this.backendQueries.slice(this.backendQueries.length-this.data.logBackendQueriesWindow);this.recordStat("backend_queries",this.backendQueries);var l=c("whitelistObjectKeys")(this.backendQueriesStatus,this.backendQueries);c("mapObject")(l,this._addDurationForBackendQuery,this);this.recordStat("backend_queries_status",l)}if(c("FacebarGlobalOptions").taSessionLoggingSample){var m=[];this.results.forEach(function(r){m.push([r.text||"",r.category||"",r.subtext||""])});this.recordStat("raw_suggestions_text",m)}var n=this.stats;for(var o in this.avgStats){var p=this.avgStats[o];n[o]=p[0]/p[1]}for(var q in this.appendStats)n[q]=JSON.stringify(this.appendStats[q]);return n};i.prototype.buildResults=function(){"use strict";var k=(this.results||[]).map(function(l,m){var n=c("TokenizeUtil").parse(this.data.getTextToIndex(l)).tokens,o=l.rankType||l.render_type||l.type,p=l.log_type,q=l.bootstrapped?1:0,r=l.s_token||"",s=typeof l.index=="undefined"?100:l.index,t=j(n,this.query)||this.query,u=l.index_rank,v=l.match_type,w=l.l_type,x=l.vertical_type,y=l.prefix_match,z=l.prefix_length,A=l.text,B=l.category,C=l.subtext,D=l.fromCache,E=l.isNullState,F=l.isSingleState,G=l.logInfo;if(typeof l.groupIndex=="number")return[l.groupIndex,l.indexInGroup,l.uid,o,q,r,t,u,v,y,z,l.origIndex,w,x,A,B,C,s,D,E,F,G,p];return[0,m,l.uid,o,q,r,t,u,v,y,z,l.origIndex,w,x,A,B,C,s,D,E,F,G,p]}.bind(this));return JSON.stringify(k)};i.prototype.submit=function(){"use strict";var k=this._dataToSubmit();switch(this.data.recordingRoute){case"banzai_vital":c("Banzai").post(this._banzaiRoute,k,{delay:0,retry:true});break;default:this.submitThroughAsyncRequest(k)}this._reset()};i.prototype.addLatencyToSample=function(k,l,m,n){"use strict";__p&&__p();k.addInteger(n+"query_start",m.queryStart);k.addInteger(n+"query_end",m.queryEnd);k.addInteger(n+"keypress_query_end",m.keyPressToQueryEnd);k.addInteger(n+"render",m.render);k.addInteger(n+"keypress_render",m.keyPressToRender);l[n+"query_start"]=m.queryStart;l[n+"query_end"]=m.queryEnd;l[n+"keypress_query_end"]=m.keyPressToQueryEnd;l[n+"render"]=m.render;l[n+"keypress_render"]=m.keyPressToRender};i.prototype.logToScuba=function(k,l,m,n,o){"use strict";__p&&__p();var p={},q=new(c("BanzaiScuba"))("search_facebar_js",null,{addBrowserFields:true,addPredictedGeographyFields:true,addUser:true,addSearchVersion:true,addGatekeepers:{facebarGKs:true}});q.addInteger("sample_rate",m.sample_rate);p.sample_rate=m.sample_rate;q.addNormal("site",m.site);p.site=m.site;q.addDenorm("query",n);p.query=n;var r=k.payload||{};if(r.entities){q.addInteger("num_entities",r.entities.length);p.num_entities=r.entities.length}Object.keys(this.performanceTimings).forEach(function(t){q.addInteger(t,this.performanceTimings[t]);p[t]=this.performanceTimings[t]}.bind(this),this);if(r.results||r.entries){var s=(r.results||r.entries).length;q.addInteger("num_results",s);p.num_results=s}if(r.gzipped_payload_size!==undefined){q.addInteger("gzipped_payload_size",r.gzipped_payload_size);p.gzipped_payload_size=r.gzipped_payload_size}if(l.recv&&l.render>l.recv){q.addInteger("time_render",l.render-l.recv);p.time_render=l.render-l.recv;q.addInteger("time_js_async",l.recv);p.time_js_async=l.recv}if(l.payload_size){q.addInteger("payload_size",l.payload_size);p.payload_size=l.payload_size}if(this.stats.time_render_null_state&&(!n||n.length===0)){q.addInteger("time_render_null_state",this.stats.time_render_null_state);p.time_render_null_state=this.stats.time_render_null_state}q.addInteger("query_id",k.queryId);p.query_id=k.queryId;q.addDenorm("user_id",c("CurrentUser").getID());p.user_id=c("CurrentUser").getID();q.addDenorm("session_id",this.stats.sid);p.session_id=this.stats.sid;q.addNormal("typeahead_type",o);p.typeahead_type=o;if(l.remoteQueryLatencies){this.addLatencyToSample(q,p,l.remoteQueryLatencies,"remote_");q.addInteger("remote_keypress_query_dispatch",l.remoteQueryLatencies.keyPressToQueryDispatch);p.remote_keypress_query_dispatch=l.remoteQueryLatencies.keyPressToQueryDispatch;q.addInteger("remote_keypress_query_start",l.remoteQueryLatencies.keyPressToQueryStart);p.remote_keypress_query_start=l.remoteQueryLatencies.keyPressToQueryStart;q.addNormal("inflight_requests",l.remoteQueryLatencies.inflightRequests);q.addInteger("inflight_requests",l.remoteQueryLatencies.inflightRequests);p.inflight_requests=l.remoteQueryLatencies.inflightRequests;q.addNormal("waiting_queries",l.remoteQueryLatencies.waitingQueries);q.addInteger("waiting_queries",l.remoteQueryLatencies.waitingQueries);p.waiting_queries=l.remoteQueryLatencies.waitingQueries}if(l.cacheQueryLatencies)this.addLatencyToSample(q,p,l.cacheQueryLatencies,"cache_");q.post();c("BanzaiNectar").log("search_facebar_js","typeahead",p)};i.prototype.submitThroughAsyncRequest=function(k){"use strict";if(Object.keys(k).length>0)new(c("AsyncRequest"))().setURI(this._endPoint).setMethod("POST").setData({stats:k}).setOption("handleErrorAfterUnload",true).setErrorHandler(function(l){k.retry=true;new(c("AsyncRequest"))().setURI(this._endPoint).setMethod("POST").setData({stats:k}).setOption("asynchronous_DEPRECATED",false).send()}.bind(this)).send()};var j=function j(k,l){__p&&__p();if(!k||!l)return;var m=c("TokenizeUtil").parse(l);if(m.flatValue[m.flatValue.length-1]===" ")return m.flatValue;var n=m.tokens[m.tokens.length-1],o={};k.forEach(function(s){o[s]=(o[s]||0)+1});var p={},q=m.tokens.slice(0,m.tokens.length-1);q.forEach(function(s){p[s]=(p[s]||0)+1});for(var r=0;r<k.length;++r){var s=k[r];if(s.indexOf(n)===0&&o[s]-(p[s]||0)>0){q.push(s);return q.join(" ")}}return undefined};Object.assign(i.prototype,{_endPoint:"/ajax/typeahead/record_metrics.php",_banzaiRoute:"search"});f.exports=i}),null);
__d("FacebarTypeaheadRecorder",["Arbiter","Event","FacebarGlobalOptions","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarTimerUtils","Keys","SearchTypeaheadRecorder","URI","clickRefAction"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i;h=babelHelpers.inherits(j,c("SearchTypeaheadRecorder"));i=h&&h.prototype;function j(k){__p&&__p();i.constructor.call(this,k);this.userText="";this.nullStateCandidates=null;this.singleStateCandidates=null;this.queryTimes={};this._sessionDisabled=false;this.type="facebar";this._maxQueryID=0;this._isQueryMatch=true;this._bootstrapSize=null}j.prototype.initEvents=function(k){__p&&__p();k.getCore().subscribe("session",function(l,m){if(m===null)this.sessionEnd();else this.sessionStart(m)}.bind(this));k.getCore().subscribe("select",function(l,m){this.recordStat("time_between_select_and_last_render",Date.now()-this._lastRenderTime);if(this._firstKeypressTime!=null)this.recordStat("keypress_to_select_time",Date.now()-this._firstKeypressTime);this.recordSelectInfo(m)}.bind(this));k.getCore().subscribe("magSearch",function(l,m){this.recordMagSearch(m)}.bind(this));k.getCore().input.subscribe("shortcut",function(l,m){this.recordShortcut(m)}.bind(this));k.getCore().subscribe("quickSelectRedirect",function(l,m){this.recordQuickSelectInfo(m)}.bind(this));k.getView().subscribe("render",function(l,m){if(this.data._isInjectedSuggestionFlow)return;this.recordRender(m);if(this.allFromNullState)this.nullStateCandidates=this.buildListTypeaheadRecords();else if(this.allFromSingleState)this.singleStateCandidates=this.buildListTypeaheadRecords();this._lastRenderTime=Date.now()}.bind(this));k.getView().subscribe("show",function(l,m){if(!this.data.lastNullOrSingleStateFetchStartTime)return;this.recordStat("time_render_null_state",Date.now()-this.data.lastNullOrSingleStateFetchStartTime);this.data.lastNullOrSingleStateFetchStartTime=null}.bind(this));k.getView().subscribe("logPerformanceTiming",function(l,m){this.performanceTimings[m.field]=m.value}.bind(this));k.data.subscribe("query",function(l,m){if(!m.value.isEmpty())this.recordCountStat("num_queries");this.recordAvgStat("num_results_from_cache",m.results.length);this.queryTimes[m.queryId]={send:c("FacebarTimerUtils").getTimestamp()}}.bind(this));k.data.subscribe("sending_global_request",function(l,m){var n=m.getData().value;if(!n)return;this.backendQueries.push(n)}.bind(this));k.data.subscribe("sending_request",function(l,m){var n=m.data.value;if(!n)return;this.backendQueries.push(n)}.bind(this));k.subscribe("navigation",function(l,m){if(m&&m.structure){this.recordStat("navigation_input",JSON.stringify(m.structure.toStruct()));this.recordStat("navigation_text",m.structure.toString())}}.bind(this));k.data.subscribe("response_received",function(l,m,n){if(this.queryTimes[m.queryId]){var o=this.queryTimes[m.queryId];o.recv=c("FacebarTimerUtils").getTimestamp()-o.send;if(m&&m.payload)o.payload_size=JSON.stringify(m.payload).length}}.bind(this));k.data.subscribe("remote_query_latency",function(l,m){if(this.queryTimes[m.queryId]){var n=this.queryTimes[m.queryId];n.remoteQueryLatencies=m.latencies}}.bind(this));k.data.subscribe("cache_query_latency",function(l,m){if(this.queryTimes[m.queryId]){var n=this.queryTimes[m.queryId];n.cacheQueryLatencies=m.latencies}}.bind(this));k.data.subscribe("backend_response",function(l,m){if(this.queryTimes[m.queryId]){var n=this.queryTimes[m.queryId];n.render=c("FacebarTimerUtils").getTimestamp()-n.send;if(m.payload.incomplete)n.incomplete=true;n.backendInfo=m.payload.info;if(this.core.scubaInfo)this.logToScuba(m,n,this.core.scubaInfo,m.inputQuery,this.type)}}.bind(this));k.getCore().subscribe("change",function(l,m){this.userInput(this.core.getText())}.bind(this));k.data.subscribe("remote_query_match",function(l,m){if(this._maxQueryID<m.queryId){this._maxQueryID=m.queryId;this._isQueryMatch=m.isMatch}}.bind(this));c("Arbiter").subscribe("BrowseNUX/typing",this.disableThisSession.bind(this));c("Arbiter").subscribe("TestConsole/typing",this.disableThisSession.bind(this));k.subscribe("clear",function(){this.recordAppendStat("before_clear_queries",this.userText)}.bind(this));c("Event").listen(this.element,"keydown",function(event){__p&&__p();this.recordStat("keypressed",1);this.recordCountStat("count_keys_pressed");if(c("Event").getKeyCode(event)==c("Keys").BACKSPACE){if(!this._backspacing){this._backspacing=true;this.recordAppendStat("before_backspace_queries",this.core.getText())}}else this._backspacing=false;if(this._firstKeypressTime==null)this._firstKeypressTime=Date.now()}.bind(this));this.core.subscribe("open",function(l,m){if(m&&m.catchup)return;this.data.lastNullOrSingleStateFetchStartTime=Date.now()}.bind(this));this.core.subscribe("focusStartTime",function(l,m){this.data.lastNullOrSingleStateFetchStartTime=m.time}.bind(this));this.data.subscribe("beforeQuery",function(l,m){if(!this.queryStartTime)this.queryStartTime=[];var n=m.value;this.query=n!=null?n.toString():n;if(!this.query&&!this.data.lastNullOrSingleStateFetchStartTime)this.data.lastNullOrSingleStateFetchStartTime=Date.now();this.queryStartTime[this.query]=Date.now()}.bind(this));k.subscribe("filter",function(l,m){this._unsupportedGrammarInfo=this.buildUnsupportedGrammarInfo(m)}.bind(this));k.getCore().subscribe("recordFunction",function(l,m){this._extraRecorder.push(m)}.bind(this));this.data.subscribe("bootstrapped",function(l,m){this._bootstrapSize=m.size}.bind(this))};j.prototype._reset=function(k){this.stats={};this.avgStats={};this.appendStats={};this._backspacing=false;this.backendQueries=[];this._topreplace=false;this._inflightRequests={}};j.prototype.sessionStart=function(k){__p&&__p();this._sessionEnded=false;this.data.setQueryData({sid:k});this.recordStat("sid",k);this.recordStat("bootstrap_size",this._bootstrapSize);if(!this.stats.session_start_time){this.recordStat("session_start_time",c("FacebarTimerUtils").getTimestamp());var l=new Date(),m=l.getTimezoneOffset(),n=Date.now()-m*60*1e3;this.recordStat("session_start_time_user_timezone",n)}this.recordStat("keypressed",0);this.queryTimes={};this._lastRenderTime=0;this._firstKeypressTime=null};j.prototype.sessionEnd=function(){__p&&__p();if(this._sessionEnded||this._sessionDisabled){if(this._sessionDisabled){this.reset();this._sessionDisabled=false;this._sessionEnded=true}return}this._sessionEnded=true;var k="typed";if(this.allFromNullState)k="nullstate";else if(this.allFromSingleState)k="singlestate";this.recordStat("last_state",k);this.recordStat("session_end_time",c("FacebarTimerUtils").getTimestamp());this.recordStat("grammar_version",this.data.getQueryData().grammar_version);this.submit();this.nullStateCandidates=null;this.singleStateCandidates=null};j.prototype.disableThisSession=function(){this._sessionDisabled=true};j.prototype.userInput=function(k){this.userText=k};j.prototype.buildUnsupportedGrammarInfo=function(k){var l=k.results?k.results[0]:null;if(!l||l.results_set_type!=="unimplemented")return null;return{unsupported_grammar:{category:l.error_info.category||"unknown",edge:l.error_info.blamed_edge}}};j.prototype.buildTypeaheadRecord=function(k,l){__p&&__p();var m=k.rankType||k.render_type||k.type,n=k.keywordType,o=k.keywordSource;if(c("FacebarGlobalOptions").hasKeywordOnlyTypeahead&&!k.isNullState&&m!==c("FacebarJSConstants").keywordType){n=m;m=c("FacebarJSConstants").keywordType;if(k.isJSBootstrapMatch)o=c("FacebarJSConstants").keywordTypes.entityBootstrap}if(k.isNullState&&m===c("FacebarJSConstants").keywordType)o=c("FacebarJSConstants").keywordTypes.recentSearch;var p=0,q=l;if(typeof k.groupIndex=="number"){p=k.groupIndex;q=k.indexInGroup}var r={group_index:p,index_in_group:q,cost:k.cost,s_value:k.s_value||0,semantic:k.semantic,text:k.structure.toString(),cache_only:k.cacheOnlyResult?1:0,prefetched:k.isPrefetched?1:0,parse:k.parse,category:k.category,type:m,source:k.bootstrapped,grammar_results_type:(k.results_set_type||"").replace(/[\[\{](.*)[\]\}]/,"$1"),result_from_memcache:k.memcache,dynamic_cost:k.dynamic_cost,is_js_bootstrap_match:k.isJSBootstrapMatch,backend_cost:k.backendCost,bootstrap_cost:k.bootstrapCost,match_type:k.match_type,l_type:k.l_type,vertical_type:k.vertical_type,prefix_match:k.prefix_match,prefix_length:k.prefix_length,index_before_buckets:k.indexBeforeBuckets,bucket_lineage:k.bucketLineage,nullstate:k.isNullState,singlestate:k.isSingleState,query_id:k.qid,template_id:k.templateID,coeff_cost:typeof k.grammar_costs=="undefined"?-1:k.grammar_costs["{"+k.type+"}"],suggestion:k.isSuggestion,keyword_source:o,keyword_bootstrap_type:k.keywordBootstrapType,exact_match_suggestion:k.exactMatchKeyword?1:0,keyword_type:n};if(k.logInfo)r.backend_log_info=k.logInfo;if(k.s_token)r.s_token=k.s_token;if(k.s_categories)r.s_categories=k.s_categories;return r};j.prototype.buildListTypeaheadRecords=function(){var k=[];this.results&&this.results.forEach(function(l,m){if(l.uid!=="search")k.push(this.buildTypeaheadRecord(l,m))}.bind(this));return k};j.prototype.recordShortcut=function(k){this.recordStat("shortcut",1);this.recordStat("shortcut_with_shift",k.shift)};j.prototype.recordStats=function(k,l){for(var m in l)this.recordStat(k+"_"+m,l[m])};j.prototype.getTypeaheadIndex=function(k,l){var m=typeof k.groupIndex=="number"?k.groupIndex+1:0;return l-m};j.prototype.recordQuickSelectInfo=function(k){var l={input_query:k.input_query,semantic:k.semantic,type:k.type,position:k.position,with_mouse:k.with_mouse,text:k.text,quick_select:1};this.recordStats("selected",l);this.recordStat("quick_select",1)};j.prototype.recordMagSearch=function(k){var l={};l.text=k.text;l.semantic=k.semantic;l.type=k.type;l.input_query=k.text;l.position=k.position;this.recordStats("selected",l)};j.prototype.recordSelectInfo=function(k){__p&&__p();var l=k.selected,m=this.getTypeaheadIndex(l,k.index),n={};if(l.uid=="search")n.selected_search=1;else{n=this.buildTypeaheadRecord(l);var o=n.type=="friend"?"user":n.type;n.position=m;n[o]=1}n.with_mouse=k.clicked?1:0;n.quick_select=0;n.input_query=this.userText;n.input_fragments=JSON.stringify(this.core.currentQuery.toStruct());var p=l.dataGT?{gt:JSON.parse(l.dataGT)}:{},q={href:l.path};c("clickRefAction")("click",q,null,null,p);this.recordStats("selected",n);this.recordAppendStat("selection_history",{selected:n,candidate_results:this.buildListTypeaheadRecords(),timestamp:c("FacebarTimerUtils").getTimestamp()});var r={};this._extraRecorder.forEach(function(s){s(k,this.results,r)}.bind(this));this.recordStat("extra_select_info",JSON.stringify(r));this.recordStat("selected_with_mouse",k.clicked?1:0)};j.prototype._dataToSubmit=function(){__p&&__p();this.recordStat("max_results",this.data._maxResults);if(this.stats&&this.stats.selected_input_query)this.recordStat("input_query",this.stats.selected_input_query);else this.recordStat("input_query",this.userText);this.recordStat("uri",new(c("URI"))(window.location.href).toString());if(!this.stats.shortcut){this.recordStat("shortcut",0);this.recordStat("shortcut_with_shift",false)}var k=this.stats;for(var l in this.avgStats){var m=this.avgStats[l];k[l]=m[0]/m[1]}var n={candidate_results:this.buildListTypeaheadRecords(),timestamp:c("FacebarTimerUtils").getTimestamp(),input_query:this.userText,remote_query_match:this._isQueryMatch};if(this._unsupportedGrammarInfo)Object.assign(n,this._unsupportedGrammarInfo);this.recordAppendStat("suggestions_at_end_of_session",n);if(this.nullStateCandidates)this.recordAppendStat("suggestions_at_nullstate_session",{candidate_results:this.nullStateCandidates});if(this.singleStateCandidates)this.recordAppendStat("suggestions_at_singlestate_session",{candidate_results:this.singleStateCandidates});this.recordAppendStat("query_times",this.queryTimes);if(this.backendQueries.length>0){if(this.backendQueries.length>this.data.logBackendQueriesWindow)this.backendQueries=this.backendQueries.slice(this.backendQueries.length-this.data.logBackendQueriesWindow);this.recordStat("backend_queries",this.backendQueries)}if(c("FacebarGlobalOptions").taSessionLoggingSample){var o=[];this.results.forEach(function(q){o.push([q.text||"",q.category||"",q.subtext||""])});this.recordStat("raw_suggestions_text",o)}if(c("FacebarGlobalOptions").graphSearchV2)this.recordStat("experience_type","gsv2");else this.recordStat("experience_type","facebar");for(var p in this.appendStats)k[p]=JSON.stringify(this.appendStats[p]);return k};j.prototype.getDataToSubmit=function(){return this._dataToSubmit()};j.prototype.reset=function(){return this._reset()};j.prototype.submit=function(){if(!this._sessionDisabled)i.submit.call(this);this.view.inform("feedback");this._reset()};Object.assign(j.prototype,{_sessionEnded:true,_extraRecorder:[],_banzaiRoute:"facebar"});f.exports=j}),null);
__d("FacebarTypeaheadDebugPane.react",["React"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i;h=babelHelpers.inherits(j,c("React").Component);i=h&&h.prototype;j.prototype.renderDebugText=function(k){return c("React").createElement("div",{key:k},k)};j.prototype.render=function(){return c("React").createElement("div",{className:"fsm pam"},this.props.result.debug.map(this.renderDebugText))};function j(){h.apply(this,arguments)}f.exports=j}),null);
__d("FacebarTypeaheadDiffText.react",["cx","React","TextWithEmoticons.react"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j;i=babelHelpers.inherits(k,c("React").Component);j=i&&i.prototype;k.prototype.renderDiff=function(l,m){return c("React").createElement("span",{className:"diffNode _5td3",key:m},c("React").createElement(c("TextWithEmoticons.react"),{text:l}))};k.prototype.renderParts=function(){__p&&__p();var l=this.props.prefix,m=this.props.text;if(l==null)return[this.renderDiff(m,0)];var n=m.toLowerCase().indexOf(l.toLowerCase());l=l.trim();if(n===0)m=m.slice(l.length);var o=m.split(/\b/).map(this.renderDiff);if(n===0)o.unshift(c("React").createElement(c("TextWithEmoticons.react"),{key:"prefix",text:l}));return o};k.prototype.render=function(){return c("React").createElement("span",this.props,this.renderParts())};k.generatePrefixes=function(l,m){__p&&__p();var n=[],o=void 0,p=void 0;for(var q=0,r=m.length;q<r;q++){p=m[q].getText();o=l.slice(0,Math.min(l.length,p.length));if(o==="")return n;if(p.toLowerCase().indexOf(o.toLowerCase())===0){n.push(o);l=l.slice(o.length)}else n.push("")}return n};function k(){i.apply(this,arguments)}f.exports=k}),null);
__d("FacebarTypeaheadHighlightedText.react",["BrowseFacebarHighlighter","React","TextWithEmoticons.react"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i;h=babelHelpers.inherits(j,c("React").Component);i=h&&h.prototype;j.prototype.renderHighlight=function(k,l){if((l+1)%3===0)return c("React").createElement("span",{className:"highlightNode",key:l},c("React").createElement(c("TextWithEmoticons.react"),{text:k}));else return c("React").createElement(c("TextWithEmoticons.react"),{text:k})};j.prototype.renderParts=function(){var k=this.props.text,l=this.props.tokens;if(l!=null&&k!==""){var m=c("BrowseFacebarHighlighter").createRegex(l),n=k.split(m);return n.map(this.renderHighlight)}else return c("React").createElement(c("TextWithEmoticons.react"),{text:k})};j.prototype.render=function(){return c("React").createElement("span",this.props,this.renderParts())};function j(){h.apply(this,arguments)}f.exports=j}),null);
__d("TimelineFilterOptions",[],(function a(b,c,d,e,f,g){f.exports=Object.freeze({ALL:"all",REVIEW:"review",TAG_REVIEW:"tagreview",FACE_ALERTS:"photoreview",POSTS_AND_APPS:"postsandapps",LOCATION:"location",PHOTOS:"photos",TAGGED_PHOTOS:"taggedphotos",OWN_PHOTOS:"ownphotos",LIKES:"likes",LIKED_INTERESTS:"likedinterests",LIKED_POSTS:"likedposts",GROUPS:"groups",GROUP_MEMBERSHIP:"groupmembership",GROUP_POSTS:"groupposts",GROUP_SEARCH:"groupsearch",HIDDEN:"hidden",SPAM:"spam",ALL_APPS:"apps",SEARCH:"search",VIDEO_SEARCH:"videosearch",VIDEO_WATCH:"videowatch",ASSISTANT_HISTORY:"assistanthistory",ADS:"ads",CLUSTER:"cluster",APP:"app",STORIES:"stories",COLLECTION_ITEM:"citem",FITNESS:"fitness",OG_VIDEO:"ogvideo",SAVED_FOR_LATER:"saved",NOW:"now"})}),null);
__d("FacebarTypeaheadItem.react",["cx","Badge.react","DOM","DOMContainer.react","FacebarGlobalOptions","FacebarJSConstants","FacebarTypeaheadDebugPane.react","FacebarTypeaheadDiffText.react","FacebarTypeaheadHighlightedText.react","Image.react","React","TimelineFilterOptions","TypeaheadCanvasConfig","URI","WorkModeConfig","XUICloseButton.react","joinClasses"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j;function k(m){var n=m.getTypePart(0);return n?"fragment"+n.charAt(0).toUpperCase()+n.substr(1):"fragment"}i=babelHelpers.inherits(l,c("React").Component);j=i&&i.prototype;function l(){var m,n;for(var o=arguments.length,p=Array(o),q=0;q<o;q++)p[q]=arguments[q];return n=(m=j.constructor).call.apply(m,[this].concat(p)),this.renderHighlightedFragment=function(r,s){return c("React").createElement(c("FacebarTypeaheadHighlightedText.react"),{className:k(r),key:s,text:r.getText(),tokens:this.props.highlight})}.bind(this),n}l.prototype.renderDiffedFragment=function(m,n,o){return c("React").createElement(c("FacebarTypeaheadDiffText.react"),{className:k(m),key:o,prefix:n,text:m.getText()})};l.prototype.renderText=function(){__p&&__p();var m,n=this,o=this.props.result,p=o.isLocal,q=o.displayStructure!=null?o.displayStructure:o.structure,r=q.toArray(),s=this.props.prefix;if(c("FacebarGlobalOptions").graphSearchV2&&!o.isSeeMore&&s!=null&&s.trim()!==""){var m=function(){var t=c("FacebarTypeaheadDiffText.react").generatePrefixes(s,r);if(p)t=[];return{v:r.map(function(u,v){if(!t[v])t[v]="";return this.renderDiffedFragment(u,t[v],v)}.bind(n))}}();if(typeof m==="object")return m.v}else return r.map(this.renderHighlightedFragment)};l.prototype.renderBadge=function(){__p&&__p();if(this.props.result.photo&&this.props.showSecondaryIcon&&!this.props.result.isTrending)return c("React").createElement("span",{className:"_34my"});if(this.props.result.category&&this.props.result.category.toString().toLowerCase()===c("TypeaheadCanvasConfig").category_games.toLowerCase()&&c("TypeaheadCanvasConfig").in_games_v1)return c("React").createElement(c("Badge.react"),{type:"game_blue",size:"medium"});else if(this.props.result.is_verified)return c("React").createElement(c("Badge.react"),{type:"verified",size:"medium"});else if(this.props.result.is_work_bot)return c("React").createElement(c("Badge.react"),{type:"bot",size:"medium"});else if(this.props.result.is_multi_company_group&&!c("WorkModeConfig").is_in_solo_community)return c("React").createElement(c("Badge.react"),{type:"work_non_coworker"});else if(this.props.result.pages_verified_badge===1)return c("React").createElement(c("Badge.react"),{type:"page_gray_check",size:"medium"});else if(this.props.result.is_interest_community)return c("React").createElement(c("Badge.react"),{type:"interest_community",size:"medium"});return null};l.prototype.renderIcon=function(){var m=this.props.result,n=m.icon_class;if(n)return c("React").createElement("span",{className:"_k83"},c("React").createElement("span",{className:n}));else if(m.photo)return c("React").createElement(c("Image.react"),{className:"_20h",alt:"",src:m.photo});return null};l.prototype.renderSecondaryIcon=function(){var m=this.props.result;if(m.photo&&this.props.showSecondaryIcon)return c("React").createElement("div",{className:"_20h"},c("React").createElement(c("Image.react"),{alt:"",src:m.photo}));else if(!m.isRecent&&m.isInjectedSuggestion)return c("React").createElement("span",{className:"_3kxl"});return null};l.prototype.renderUnseenPosts=function(){if(this.props.recentSearchItem&&this.props.result.unseen_posts){var m=c("React").createElement(c("DOMContainer.react"),null,c("DOM").create("span",{className:""}," \xb7 ")),n=c("React").createElement(c("DOMContainer.react"),null,c("DOM").create("span",{className:""},this.props.result.unseen_posts.markup));return c("React").createElement("span",{className:"_2tb-"},m,n)}return null};l.prototype.renderLabel=function(){var m=" \xb7 ",n=this.props.result,o="_53ad"+(this.props.valign&&this.props.token&&this.props.token.props&&this.props.token.props.text.length>0?" _55y-":"")+(!n.category&&!n.subtext?" _2vzo":"")+(!n.category&&!!n.subtext||n.category&&n.category.toString().indexOf(m)<0&&!n.subtext?" _2vzp":"")+(n.category&&!!n.subtext||n.category&&n.category.toString().indexOf(m)>0?" _2vzq":""),p=this.renderUnseenPosts(),q=c("React").createElement("span",{className:o},this.renderText(),this.props.hideBadge?null:this.renderBadge(),p,this.props.token),r="_7gk"+(this.props.message?" _5byz":"");return c("React").createElement("span",{className:r},q,this.props.message)};l.prototype.renderMain=function(){var m=c("React").createElement("a",{className:"_6i1",href:this.props.result.uri},c("React").createElement("span",null,this.props.icon||this.renderIcon(),this.renderLabel(),this.renderSecondaryIcon()));if(this.props.result.isAsync)m=c("React").createElement("a",{className:"_6i1",href:"#",ajaxify:this.props.result.asyncURI,rel:"async"},c("React").createElement("span",null,this.props.icon||this.renderIcon(),this.renderLabel(),this.renderSecondaryIcon()));return c("React").createElement("span",{className:"_205",rel:"ignore"},this.renderActivityLogXButton(),m)};l.prototype.renderActivityLogXButton=function(){if(this.props.result.keywordBootstrapType!==c("FacebarJSConstants").keywordBootstrapTypes.recent)return null;var m=new(c("URI"))("/me/allactivity");m.setQueryData({privacy_source:"activity_log",log_filter:c("TimelineFilterOptions").SEARCH});return c("React").createElement(c("XUICloseButton.react"),{size:"medium",className:"_2d9t",href:m})};l.prototype.renderDebug=function(){return this.props.result.debug?c("React").createElement(c("FacebarTypeaheadDebugPane.react"),{result:this.props.result}):null};l.prototype.render=function(){var m="_202 _5bl2 _6_k"+(c("FacebarGlobalOptions").graphSearchV2?" _1et7":"")+(c("FacebarGlobalOptions").renderKeywordSnippets?" _28vg":"")+(this.props.result.isCelebrity?" _5g-n":"")+(this.props.result.isSeeMore?" _qbs":"")+(this.props.result.isInjectedSuggestion?" _3kxm":"")+(this.props.result.isTrending||this.props.result.isHappeningNow?" _5g-o":"")+(this.props.result.isRecent?" _jsd":"")+(this.props.result.isLocal&&!c("FacebarGlobalOptions").useBlueLocalIcon?" _1821":"")+(this.props.result.isLocal&&c("FacebarGlobalOptions").useBlueLocalIcon?" _xui":"")+(this.props.result.isFootball?" _1822":"")+(this.props.result.isHashtag?" _4z1b":"")+(this.props.result.isPhotos?" _4z1c":"")+(this.props.result.isVideos?" _4z1d":"")+(this.props.result.isInvalidated?" _44vm":"");return c("React").createElement("li",{className:c("joinClasses")(m,this.props.className),onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,onMouseEnter:this.props.onMouseEnter,role:"row"},c("React").createElement("div",{role:"gridcell"},this.renderMain(),this.renderDebug()))};l.defaultProps={valign:true};f.exports=l}),null);
__d("FacebarTypeaheadToken.react",["cx","FacebarTypeaheadHighlightedText.react","React"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j,k=" \xb7 ";i=babelHelpers.inherits(l,c("React").Component);j=i&&i.prototype;l.prototype.render=function(){__p&&__p();var m=this.props.text.map(function(r){return String(r)});if(this.props.limit)m.splice(this.props.limit);m.forEach(function(r,s){if(s!==0||this.props.leadingMiddot)m[s]=k+r}.bind(this));var n=m.shift(),o=void 0;if(n!=null)o=c("React").createElement(c("FacebarTypeaheadHighlightedText.react"),{className:this.props.mainClass,tokens:this.props.highlight,text:n});var p=void 0;if(m.length>0)p=c("React").createElement(c("FacebarTypeaheadHighlightedText.react"),{tokens:this.props.highlight,className:"_53ab",text:m.join("")});var q=this.props.innerClass||"_53aa";return c("React").createElement("span",{className:"_53a9"},c("React").createElement("span",{className:q},o,p))};function l(){i.apply(this,arguments)}f.exports=l}),null);
__d("FacebarTypeaheadTokenText",["FbtResultBase","HTML","getElementText"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h="\xb7";function i(m){if(m instanceof c("FbtResultBase"))return m.toString();else if(typeof m==="object")return c("getElementText")(c("HTML")(m).getRootNode());else return String(m)}function j(m){return i(m).split(h).map(function(n){return n.trim()})}function k(m){var n={};return m.filter(function(o){var p=String(o),q=!n[p];n[p]=true;return o!=null&&o!==""&&q})}var l={textForEntity:function m(n,o){var p=n.category||o[n.type]||"",q=n.subtext||"",r=n.boldedSubtext||"",s=j(p).concat(j(r)).concat(j(q));return k(s)},text:function m(n){return k(j(n))}};f.exports=l}),null);
__d("FacebarTypeaheadEntityItem.react",["cx","FacebarGlobalOptions","FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","FacebarTypeaheadTokenText","Image.react","React","TypeaheadFacepileX.react","joinClasses"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j;i=babelHelpers.inherits(k,c("React").Component);j=i&&i.prototype;k.prototype.renderToken=function(){return c("React").createElement(c("FacebarTypeaheadToken.react"),{highlight:this.getHighlightTokens(),text:c("FacebarTypeaheadTokenText").textForEntity(this.props.result,{}),category:this.props.result.category})};k.prototype.renderIcon=function(){if(this.props.result.isNullState){var l=this.props.result.icon_class?c("React").createElement("span",{className:this.props.result.icon_class}):c("React").createElement(c("Image.react"),{className:"_20h",src:this.props.result.photo});return c("React").createElement("span",{className:!c("FacebarGlobalOptions").renderKeywordSnippets?"_k83":""},l)}if(this.props.result.size>1&&this.props.result.photos)return c("React").createElement(c("TypeaheadFacepileX.react"),{className:"_51l_",photos:this.props.result.photos,size:this.props.result.size});else if(this.props.result.photo)return c("React").createElement(c("Image.react"),{className:"_20h",alt:"",src:this.props.result.photo});return null};k.prototype.getHighlightTokens=function(){if(this.props.result.original_query==null)return null;var l=this.props.result.original_query.toString().trim(),m=l.split(" "),n=m.length>1?[l].concat(m):[l];return n.filter(function(o){return o!==""})};k.prototype.render=function(){var l=this.props.className;if(this.props.result.isNullState)l=c("joinClasses")(this.props.className,!c("FacebarGlobalOptions").renderKeywordSnippets?"_207":"");var m=babelHelpers["extends"]({},this.props,{className:l,icon:this.renderIcon(),token:this.renderToken(),highlight:this.getHighlightTokens(),valign:true});return c("React").createElement(c("FacebarTypeaheadItem.react"),m)};function k(){i.apply(this,arguments)}f.exports=k}),null);
__d("FacebarTypeaheadGrammarItem.react",["cx","fbt","FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","FacebarTypeaheadTokenText","React","joinClasses"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j,k,l={user:i._("Person")};j=babelHelpers.inherits(m,c("React").Component);k=j&&j.prototype;m.prototype.renderToken=function(){__p&&__p();var n=this.props.result.decoration,o=this.props.result.ambiguity,p=o&&o.text,q=n&&n.entity||o&&o.entity;if(this.props.result.isRecent){var r=i._("Recent search");return c("React").createElement(c("FacebarTypeaheadToken.react"),{text:c("FacebarTypeaheadTokenText").text(r),innerClass:"_53ab"})}else if(p)return c("React").createElement(c("FacebarTypeaheadToken.react"),{text:c("FacebarTypeaheadTokenText").text(p)});else if(q)return c("React").createElement(c("FacebarTypeaheadToken.react"),{text:c("FacebarTypeaheadTokenText").textForEntity(q,l),limit:2,leadingMiddot:true});return null};m.prototype.getClassName=function(){var n=this.props.result;if(n.isPeopleAndPagesSuggestion)return"_2enu";if(n.tags&&n.tags.displayedSeeMore)return"_10gs";return"_207"};m.prototype.render=function(){var n=this.renderToken(),o=false;if(n!=null)o=!n.props.leadingMiddot;return c("React").createElement(c("FacebarTypeaheadItem.react"),babelHelpers["extends"]({},this.props,{className:c("joinClasses")(this.props.className,this.getClassName()),valign:o,token:n}))};function m(){j.apply(this,arguments)}f.exports=m}),null);
__d("FacebarTypeaheadKeywordItem.react",["cx","fbt","CurrentUser","FacebarGlobalOptions","FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","FacebarTypeaheadTokenText","React","joinClasses"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j,k;j=babelHelpers.inherits(l,c("React").Component);k=j&&j.prototype;l.prototype.render=function(){__p&&__p();var m="";if(c("CurrentUser").isWorkUser())m=[i._("Search Workplace")];else m=[i._("Search Facebook")];if(this.props.result.isTrending)m.push(i._("Trending"));else if(this.props.result.type=="related")m=[i._("Related search")];var n=void 0;if(c("FacebarGlobalOptions").renderKeywordSnippets){n=c("FacebarTypeaheadTokenText").textForEntity(this.props.result,{});if(n!=null&&n.length)m=n}var o=c("FacebarGlobalOptions").renderKeywordSnippets&&n!=null&&(n.length>1||this.props.result.boldedSubtext!=null),p=this.props.result.isSeeMore,q=p?null:c("React").createElement(c("FacebarTypeaheadToken.react"),{text:m,mainClass:(o?"_4jt7":"")+(o&&this.props.result.isSpecialIntent&&!this.props.result.isLocal?" _21z1":"")+(o&&this.props.result.isLocal&&!c("FacebarGlobalOptions").useBlueLocalIcon?" _2xfl":"")+(o&&this.props.result.isLocal&&c("FacebarGlobalOptions").useBlueLocalIcon?" _2t_t":"")+(o&&this.props.result.isPhotos?" _21z2":"")+(o&&this.props.result.isVideos?" _21z4":"")+(o&&this.props.result.isSingleState&&this.props.result.exactMatchKeyword&&!this.props.result.isLocal?" _21z5":""),innerClass:"_53ab"});return c("React").createElement(c("FacebarTypeaheadItem.react"),babelHelpers["extends"]({},this.props,{className:c("joinClasses")(this.props.className,(!c("FacebarGlobalOptions").renderKeywordSnippets?"_207":"")+" _5d77"),token:q,prefix:this.props.result.query_string.toLowerCase(),showSecondaryIcon:c("FacebarGlobalOptions").showKeywordSuggestionPhotos}))};function l(){j.apply(this,arguments)}f.exports=l}),null);
__d("FacebarTypeaheadNodeItem.react",["DOM","React","ReactDOM","isElementNode"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i;h=babelHelpers.inherits(j,c("React").Component);i=h&&h.prototype;j.prototype.render=function(){var k=this.props.result.node;return c("React").createElement("li",this.props,!c("isElementNode")(k)?k:null)};j.prototype.attachNode=function(){var k=c("ReactDOM").findDOMNode(this);if(k==null)return;var l=this.props.result.node;if(c("isElementNode")(l))c("DOM").setContent(k,l)};j.prototype.componentDidMount=function(){this.attachNode()};j.prototype.componentDidUpdate=function(){this.attachNode()};j.prototype.shouldComponentUpdate=function(k){return this.props.result.node!==k.result.node};function j(){h.apply(this,arguments)}f.exports=j}),null);
__d("FacebarTypeaheadRecentItem.react",["cx","FacebarGlobalOptions","FacebarTypeaheadItem.react","Image.react","React","joinClasses"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j;i=babelHelpers.inherits(k,c("React").Component);j=i&&i.prototype;k.prototype.render=function(){return c("React").createElement(c("FacebarTypeaheadItem.react"),babelHelpers["extends"]({},this.props,{className:c("joinClasses")(this.props.className,!c("FacebarGlobalOptions").renderKeywordSnippets?"_207":""),icon:this.renderIcon(),recentSearchItem:true}))};k.prototype.renderIcon=function(){var l=this.props.result;if(!c("FacebarGlobalOptions").allowGrammar)return c("React").createElement(c("Image.react"),{className:"_20h",src:l.photo});var m=l.icon_class?c("React").createElement("span",{className:l.icon_class}):c("React").createElement(c("Image.react"),{className:"_20h",src:l.photo});return c("React").createElement("span",{className:!c("FacebarGlobalOptions").renderKeywordSnippets||l.icon_class&&c("FacebarGlobalOptions").renderKeywordSnippets?"_k83":""},m)};function k(){i.apply(this,arguments)}f.exports=k}),null);
__d("FacebarTypeaheadSimpleItem.react",["ix","cx","FacebarGlobalOptions","FacebarJSConstants","Image.react","React","RoundImage.react","SutroGatingConfig","escapeRegex","fbglyph","joinClasses","mayHaveConnectedCharacters"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j,k,l=c("SutroGatingConfig").avatar;function m(p){__p&&__p();var q=p.result,r=q.displayStructure!=null?q.displayStructure:q.structure,s=r!=null?r.toString():"";if(q.keywordType!==c("FacebarJSConstants").keywordTypes.escape&&!q.isNullState)s=s.toLowerCase();var t=q.query_string?q.query_string.toLowerCase():null;if(!c("mayHaveConnectedCharacters")(s)&&t!=null&&!q.isSeeMore){var u=s;s=s.replace(new RegExp("^"+c("escapeRegex")(t),"ig"),"");if(u===s)t=null;s=c("React").createElement("strong",null,s)}else t=null;return c("React").createElement("div",{className:"_19bk"},t,s,"\u200e")}function n(p){__p&&__p();var q=p.result;if(!q.isNullState||!c("FacebarGlobalOptions").logSERPClickAsRecentSearch)return null;var r="_19bl",s=void 0;if(q.photo!=null){var t=l.has_rounded_avatars?c("RoundImage.react"):c("Image.react");s=c("React").createElement(t,{className:c("joinClasses")(r,"_19bm"),src:q.photo,width:"24",height:"24"})}if(s==null)s=c("React").createElement(c("Image.react"),{className:r,src:h("126434"),width:"16",height:"16"});if(s!=null)return c("React").createElement("div",{className:"_19bp"},s);return null}j=babelHelpers.inherits(o,c("React").Component);k=j&&j.prototype;o.prototype.render=function(){return c("React").createElement("li",{className:"_202 _19bq"+(this.props.result.isSeeMore?" _19br":""),onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,onMouseEnter:this.props.onMouseEnter,role:"row"},c("React").createElement("div",{role:"gridcell"},c("React").createElement("a",{href:this.props.result.uri,className:"_19bs"},this.props.isNullState?null:c("React").createElement(n,{result:this.props.result}),c("React").createElement(m,{result:this.props.result}))))};function o(){j.apply(this,arguments)}f.exports=o}),null);
__d("FacebarTypeaheadTrendingItem.react",["cx","FacebarTypeaheadItem.react","FacebarTypeaheadToken.react","React","joinClasses"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j;i=babelHelpers.inherits(k,c("React").Component);j=i&&i.prototype;k.prototype.render=function(){var l=this.props.result.articleTitle||"",m=c("React").createElement(c("FacebarTypeaheadToken.react"),{text:[l],innerClass:"_53ab",leadingMiddot:true});return c("React").createElement(c("FacebarTypeaheadItem.react"),babelHelpers["extends"]({},this.props,{className:c("joinClasses")(this.props.className,"_207"),token:m,valign:false}))};function k(){i.apply(this,arguments)}f.exports=k}),null);
__d("FacebarTypeaheadList.react",["csx","cx","fbt","invariant","CSS","FacebarGlobalOptions","FacebarJSConstants","FacebarTypeaheadEntityItem.react","FacebarTypeaheadGrammarItem.react","FacebarTypeaheadKeywordItem.react","FacebarTypeaheadNodeItem.react","FacebarTypeaheadRecentItem.react","FacebarTypeaheadSimpleItem.react","FacebarTypeaheadTrendingItem.react","LoadingIndicator.react","React","StaticContainer.react"],(function a(b,c,d,e,f,g,h,i,j,k){"use strict";__p&&__p();var l,m,n={grammar:c("FacebarTypeaheadGrammarItem.react"),trending:c("FacebarTypeaheadTrendingItem.react"),related:c("FacebarTypeaheadKeywordItem.react")};n[c("FacebarJSConstants").browseTypes.keyword]=c("FacebarTypeaheadKeywordItem.react");n[c("FacebarJSConstants").keywordType]=c("FacebarTypeaheadKeywordItem.react");l=babelHelpers.inherits(o,c("React").Component);m=l&&l.prototype;function o(){var p,q;for(var r=arguments.length,s=Array(r),t=0;t<r;t++)s[t]=arguments[t];return q=(p=m.constructor).call.apply(p,[this].concat(s)),this.handleMouseLeave=function(){if(c("FacebarGlobalOptions").facebarTypeaheadMouseoutHighlight)this.props.onClearHighlight()}.bind(this),q}o.prototype.getItemComponentConstructor=function(p){__p&&__p();if(c("FacebarGlobalOptions").hasKeywordOnlyTypeahead)return c("FacebarTypeaheadSimpleItem.react");if(p.node)return c("FacebarTypeaheadNodeItem.react");if(p.isRecent)return c("FacebarTypeaheadRecentItem.react");if(p.results_set_type===c("FacebarJSConstants").browseTypes.keyword)return c("FacebarTypeaheadKeywordItem.react");if(p.type!=null&&n[p.type])return n[p.type];return c("FacebarTypeaheadEntityItem.react")};o.prototype.renderItem=function(p){__p&&__p();var q=this.getItemComponentConstructor(p),r=void 0;if(p.type===c("FacebarJSConstants").keywordType)r=p.query_string+p.semantic+p.boldedSubtext+p.subtext+p.fromCache+(p.isSeeMore?"see_more":"")+(p.keywordBootstrapType?p.keywordBootstrapType:"")+(p.uid!=null?p.uid:"")+p.isInvalidated;else{r=p.semantic||p.uid||p.tuid;r+=p.isNullState+p.category+p.subtext;r+=p.query_string}if(c("FacebarGlobalOptions").dymOnEchoOnly)if(p.query_string!==p.text)p.uri.addQueryData({em:"1"});else p.uri.removeQueryData("em");if(c("FacebarGlobalOptions").noDymOnSingleState)if(p.isSingleState)p.uri.addQueryData({em:"1"});if(c("FacebarGlobalOptions").noDymOnNullState)if(p.isNullState)p.uri.addQueryData({em:"1"});return c("React").createElement(c("StaticContainer.react"),{key:r},c("React").createElement(q,{result:p,onClick:function(event){return this.handleClick(event,p)}.bind(this),onMouseEnter:function(){return this.handleMouseEnter(p)}.bind(this)}))};o.prototype.renderFooter=function(){var p="_3su"+(!this.props.loading?" hidden_elem":"");return c("React").createElement("li",{className:p},c("React").createElement("div",{className:"_21f"},j._("Finding results"),c("React").createElement(c("LoadingIndicator.react"),{size:"medium",color:"white"})))};o.prototype.hasValidRecentSearches=function(){if(!c("FacebarGlobalOptions").hasRecentSearchNullState||!this.props.results)return false;return this.props.results.some(function(p){return p.isRecent})};o.prototype.render=function(){var p=this.props.results,q=[];if(p)p.forEach(function(r){q.push(this.renderItem(r))},this);return c("React").createElement("div",null,c("React").createElement("ul",{id:"facebar_typeahead_view_list",className:"_21c"+(this.props.isKeywordList?" _2yob":""),"data-click":"Search",onMouseLeave:this.handleMouseLeave},q,this.renderFooter()))};o.prototype.handleClick=function(event,p){event.target instanceof HTMLElement||k(0);if(c("CSS").matchesSelector(event.target,"._2d9t"))return;if(!event.nativeEvent.isMiddleClick()&&!event.nativeEvent.getModifiers().any){this.props.onSelect(p);event.preventDefault()}};o.prototype.handleMouseEnter=function(p){this.props.onHighlight(p)};o.prototype.componentDidUpdate=function(p){this.props.onRender()};o.prototype.shouldComponentUpdate=function(p){return this.props.loading!==p.loading||this.props.results!==p.results};f.exports=o}),null);
__d("FacebarTypeaheadView",["csx","cx","fbt","Arbiter","ContextualLayer","ContextualLayerUpdateOnScroll","CSS","DOM","FacebarGlobalOptions","FacebarJSConstants","FacebarStructuredText","FacebarTypeaheadList.react","Parent","React","ReactDOM","ScriptPath","Style","TypeaheadView","WorkWebDriverConstants","performanceNow"],(function a(b,c,d,e,f,g,h,i,j){"use strict";__p&&__p();var k,l,m="unimplemented";k=babelHelpers.inherits(n,c("TypeaheadView"));l=k&&k.prototype;function n(o,p){__p&&__p();l.constructor.call(this,o,p);this.handleClearHighlight=function(){this.highlight(-1,false)}.bind(this);this.handleHighlight=function(q){this.highlight(this.getIndexOf(q,this.results),false)}.bind(this);this.handleSelect=function(q){this.handleHighlight(q);this.select(true)}.bind(this);this.handleRender=function(){this.items=this.getItems()}.bind(this);this.element=o;this.sid="";this.index=-1;this.warningShown=false;this.autoSelect=false;this.flipCount=0;this.loading=false;this.events=["highlight","render","filter","show"]}n.prototype.init=function(){this.initializeElements()};n.prototype.initGSV2Elements=function(){__p&&__p();var o=this.element;this.contentKeyword=c("DOM").find(o,"._f7s");this.contentEntity=c("DOM").find(o,"._2pda");this.contentRecent=c("DOM").find(o,"._mn8");this.contentSuggestion=c("DOM").find(o,"._2pl-");this.contentSeeMore=c("DOM").find(o,"._3-xd");this.keywordResultsContainer=c("DOM").create("div");this.entityResultsContainer=c("DOM").create("div");this.recentSearchContainer=c("DOM").create("div");this.seeMoreContainer=c("DOM").create("div");this.results=[];this.keywordResults=[];this.entityResults=[]};n.prototype.initGSV2Construct=function(){__p&&__p();this.currentKeywordContainer=this.contentKeyword;this.currentEntityContainer=this.contentEntity;this.contentKeyword.appendChild(this.keywordResultsContainer);this.contentEntity.appendChild(this.entityResultsContainer);this.contentRecent.appendChild(this.recentSearchContainer);this.contentSeeMore.appendChild(this.seeMoreContainer);if(this.isNullState()){if(c("FacebarGlobalOptions").hasRecentOnTopNullState){this.resultsContainer.appendChild(this.contentRecent);this.resultsContainer.appendChild(this.contentKeyword);this.resultsContainer.appendChild(this.contentEntity)}else{this.resultsContainer.appendChild(this.contentKeyword);this.resultsContainer.appendChild(this.contentRecent);this.resultsContainer.appendChild(this.contentEntity)}return}if(this.entityTop){this.resultsContainer.appendChild(this.contentEntity);this.resultsContainer.appendChild(this.contentKeyword)}else{this.resultsContainer.appendChild(this.contentKeyword);this.resultsContainer.appendChild(this.contentEntity)}if(!this.isNullState())this.resultsContainer.appendChild(this.contentSeeMore)};n.prototype.initializeElements=function(){__p&&__p();var o=this.element;this.isGSV2=c("FacebarGlobalOptions").graphSearchV2;this.dynamicRank=this.isGSV2;this.fixedBlendingOrder=c("FacebarGlobalOptions").blendingOrderKeywordFirst||c("FacebarGlobalOptions").blendingOrderEntityFirst;this.entityTop=c("FacebarGlobalOptions").blendingOrderEntityFirst&&!c("FacebarGlobalOptions").renderKeywordsFirst;this.content=c("DOM").find(o,"._21r");this.warningNode=c("DOM").find(o,"._553e");this.resultsContainer=c("DOM").create("div");if(this.isGSV2)this.initGSV2Elements()};n.prototype.initializeList=function(){this.renderTypeaheadList();this.content.appendChild(this.resultsContainer);if(this.isGSV2)this.initGSV2Construct()};n.prototype.initializeLayer=function(){this.layer=new(c("ContextualLayer"))({context:c("Parent").bySelector(this.causalElement,"._585-"),position:"below",causalElement:this.causalElement,shouldSetARIAProperties:false,"data-testid":c("WorkWebDriverConstants").SEARCH_TYPEAHEAD_VIEW},this.element).enableBehavior(c("ContextualLayerUpdateOnScroll"));var o=this.layer.getRoot();o.setAttribute("role","grid");var p=this.layer.getContentRoot();this.root=c("DOM").find(p,"._50c9");c("CSS").addClass(p,"_5tlx");if(this.isGSV2)c("CSS").addClass(p,"_5xzd");this.wrapper=p};n.prototype.setInputElement=function(o){this.setAccessibilityControlElement(o);this.causalElement=o;this.initializeLayer();this.initializeList()};n.prototype.setAutoSelect=function(o){this.autoSelect=o;if(this.index===-1&&o)this.first()};n.prototype.getIndexOf=function(o,p){for(var q=0;q<p.length;q++)if(o.semantic===p[q].semantic&&o.isSeeMore===p[q].isSeeMore&&o.text===p[q].text)return q;return-1};n.prototype.show=function(o){__p&&__p();if(!this.visible){this.inform("beforeShow",this.layer);c("Style").set(this.wrapper,"minWidth",o+"px");var p=l.show.call(this);this.first();this.layer.show();this.layer.updatePosition();this.inform("show");c("Arbiter").inform("layer_shown",{type:"FacebarTypeahead"});return p}};n.prototype.hide=function(){if(this.visible){this.layer.hide();l.hide.call(this);this.inform("hide");c("Arbiter").inform("layer_hidden",{type:"FacebarTypeahead"});this.flipCount=0}return this};n.prototype.select=function(o){__p&&__p();var p=this.results&&this.results[this.index];if(!p){this.inform("quickSelect");return}var q=this.inform("beforeSelect",{index:this.index,selected:p});if(q!==false){c("ScriptPath").setClickPointInfo({click:"Search"});l.select.call(this,o)}};n.prototype.doesResultBelongToEntitySection=function(o){if(c("FacebarGlobalOptions").hasKeywordOnlyTypeahead)return true;switch(o.type){case c("FacebarJSConstants").keywordType:return!!o.isRecent;case c("FacebarJSConstants").grammarType:return o.tags&&o.tags.displayedSeeMore;default:return true}};n.prototype.processGSV2Results=function(o){__p&&__p();this.keywordResults=[];this.entityResults=[];var p=[],q=[],r=[],s=o.some(function(t){return t.isSingleState});o.forEach(function(t){if(this.doesResultBelongToEntitySection(t))this.entityResults.push(t);else if(s)if(t.alternateSemantic)q.push(t);else if(t.exactMatchKeyword)r.push(t);else p.push(t);else this.keywordResults.push(t)}.bind(this));if(s)this.keywordResults=r.concat(q.concat(p));if(this.entityTop)return this.entityResults.concat(this.keywordResults);return this.keywordResults.concat(this.entityResults)};n.prototype.reGenerateContainer=function(o){__p&&__p();var p=c("DOM").create("div");if(this.isNullState()){if(c("FacebarGlobalOptions").hasRecentOnTopNullState){p.appendChild(this.contentRecent);p.appendChild(this.currentKeywordContainer);p.appendChild(this.currentEntityContainer)}else{p.appendChild(this.currentKeywordContainer);p.appendChild(this.contentRecent);p.appendChild(this.currentEntityContainer)}return p}if(this.entityTop){p.appendChild(this.currentEntityContainer);p.appendChild(this.currentKeywordContainer)}else{p.appendChild(this.currentKeywordContainer);p.appendChild(this.currentEntityContainer)}if(!this.isNullState()&&!o)p.appendChild(this.contentSeeMore);return p};n.prototype.buildResultsNoRegeneration=function(o,p){__p&&__p();if(this.dynamicRank&&o.length>0&&!this.fixedBlendingOrder&&!c("FacebarGlobalOptions").renderKeywordsFirst&&this.flipCount<2){var q=o[0].type!==c("FacebarJSConstants").keywordType;if(c("FacebarGlobalOptions").hasFlipOnce&&this.value.toString()&&this.entityTop!=q)this.flipCount++;this.entityTop=q}var r=String(this.value);o.forEach(function(u){u.query_string=r});this.results=o;if(this.isGSV2){if(c("FacebarGlobalOptions").disableKeywords)o=o.filter(function(u){return u.semantic!=null&&u.semantic.match(/^[0-9]+$/)!=null});this.results=this.processGSV2Results(o);if(this.seeMoreResult){var s=this.results.indexOf(this.seeMoreResult);if(s>-1)this.results.splice(s,1);this.seeMoreResult=null}if(!this.isNullState()&&!p){this.seeMoreResult=this.inform("seeMore",{value:r,results:this.results});if(this.seeMoreResult){this.results.push(this.seeMoreResult);this.inform("afterSeeMore",{results:this.results})}}}var t=c("performanceNow")();this.renderTypeaheadList({results:this.results,loading:this.loading});this.inform("logPerformanceTiming",{field:"build_results_set_props_duration",value:c("performanceNow")()-t})};n.prototype.buildResults=function(o){var p=o.some(function(q){return q.isSingleState});this.buildResultsNoRegeneration(o,p);if(this.dynamicRank)this.resultsContainer=this.reGenerateContainer(p);return this.resultsContainer};n.prototype.getGSV2Items=function(){return l.getItems.call(this).filter(function(o){return!c("CSS").matchesSelector(o,"._3su")})};n.prototype.getItems=function(){if(this.isGSV2)return this.getGSV2Items();return l.getItems.call(this).slice(0,-1)};n.prototype.render=function(o,p,q,r){__p&&__p();this.inform("filter",{results:p,value:o});var s=!o||o instanceof c("FacebarStructuredText")&&o.isEmptyOrWhitespace();c("CSS").conditionClass(this.wrapper,"_5qz2",!p.length&&s);var t=p[0];if(r&&!s){if(!this.isGSV2)this.showWarning(j._("There are no results for '{query}'",[j.param("query",o.toString())]))}else if(t&&t.results_set_type===m){if(!t.error_info.suppress)this.showWarning(t.error_info.errorMessage||j._("This search isn't currently supported."))}else this.hideWarning();if(this.inform("removeUnimplementedGrammar")!==false)p=p.filter(function(u){return u.results_set_type!==m}.bind(this));l.render.call(this,o,p,q)};n.prototype.reset=function(){this.index=-1;this.items=[];this.results=[];this.value="";this.buildResults([]);this.inform("reset");return this};n.prototype.resetIndex=function(){this.index=-1};n.prototype.showWarning=function(o){c("CSS").show(this.warningNode);c("DOM").setContent(this.warningNode,o);this.warningShown=true;this.highlight(-1,false)};n.prototype.hideWarning=function(){c("CSS").hide(this.warningNode);this.warningShown=false;this.highlight(this.index,false)};n.prototype.setLoading=function(o){if(this.loading!=o){this.loading=o;this.renderTypeaheadList({results:this.results,loading:o})}};n.prototype.first=function(){this.index=this.autoSelect?0:-1;this.highlight(this.index)};n.prototype.prev=function(){if(this.isGSV2){if(this.index<0||this.index===0&&this.autoSelect)this.index=this.items.length}else if(this.index<=0)this.index=this.items.length;this.ignoreMouseover=true;l.prev.call(this)};n.prototype.next=function(){if(this.isGSV2&&this.autoSelect&&this.index>=this.items.length-1)this.index=-1;if(!this.isGSV2&&this.index+1>=this.items.length)this.index=-1;this.ignoreMouseover=true;l.next.call(this)};n.prototype.highlight=function(o,p){p=p!==false&&this.index!=o;if(!p||this.inform("beforeHighlight")!==false){var q=this.warningShown||!this.autoSelect?-1:0;l.highlight.call(this,Math.max(q,o),p)}};n.prototype.isNullState=function(){return!String(this.value).trim()};n.prototype.updateCurrentKeywordContainer=function(){var o=this.currentKeywordContainer;if(this.isNullState())this.currentKeywordContainer=this.contentSuggestion;else this.currentKeywordContainer=this.contentKeyword;if(o&&o!==this.currentKeywordContainer){c("CSS").hide(o);o.removeChild(this.keywordResultsContainer);this.currentKeywordContainer.appendChild(this.keywordResultsContainer)}};n.prototype.updateCurrentEntityContainer=function(){var o=this.currentEntityContainer,p=!String(this.value).trim();if(p&&this.entityResults)this.currentEntityContainer=this.contentEntity;else this.currentEntityContainer=this.contentEntity;if(o&&o!=this.currentEntityContainer){c("CSS").hide(o);o.removeChild(this.entityResultsContainer);this.currentEntityContainer.appendChild(this.entityResultsContainer)}};n.prototype.hasValidRecentSearches=function(){if(!c("FacebarGlobalOptions").hasRecentSearchNullState||!this.keywordResults)return false;return this.keywordResults.some(function(o){return o.isRecent})};n.prototype.copyProps=function(o){return babelHelpers["extends"]({accessibilityElement:this.accessibilityElement,onClearHighlight:this.handleClearHighlight,onHighlight:this.handleHighlight,onRender:this.handleRender,onSelect:this.handleSelect},o)};n.prototype.renderList=function(o,p){c("ReactDOM").render(c("React").createElement(c("FacebarTypeaheadList.react"),this.copyProps(o)),p)};n.prototype.renderGSV2TypeaheadList=function(o){__p&&__p();var p=this.copyProps(Object.assign({},o,{isKeywordList:true})),q=this.copyProps(o),r=this.copyProps(Object.assign({},o,{isKeywordList:true}));p.results=this.isNullState()?this.keywordResults.filter(function(v){return!v.isRecent}):this.keywordResults;r.results=this.isNullState()?[]:this.results.filter(function(v){return v.isSeeMore});q.results=this.entityResults.filter(function(v){return!v.isRecent});if(r.results.length>0||this.isNullState()){p.loading=false;q.loading=false}else if(this.entityTop||q.results.length===0)q.loading=false;else p.loading=false;var s=!!q.results.length,t=!!p.results.length;this.renderList(p,this.keywordResultsContainer);this.renderList(q,this.entityResultsContainer);var u=false;if(this.isNullState()){q.results=this.entityResults.filter(function(v){return!!v.isRecent});this.renderList(q,this.recentSearchContainer);u=!!q.results.length}this.updateCurrentKeywordContainer();this.updateCurrentEntityContainer();this.renderList(r,this.seeMoreContainer);c("CSS").conditionShow(this.currentKeywordContainer,t);c("CSS").conditionShow(this.contentRecent,u);c("CSS").conditionShow(this.currentEntityContainer,s);c("CSS").conditionShow(this.contentSeeMore,this.seeMoreResult!=null&&!this.isNullState())};n.prototype.renderTypeaheadList=function(o){o=o||{};if(this.isGSV2)this.renderGSV2TypeaheadList(o);else this.renderList(o,this.resultsContainer)};f.exports=n}),null);
__d("XWarmUserRequestArgsController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/search/browse/warm/requestargs/",{query:{type:"String"},csid:{type:"String"}})}),null);
__d("FacebarTypeaheadBrowsePreload",["AsyncRequest","XWarmUserRequestArgsController","emptyFunction"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i){this._core=i.core;this._typeahead=i}h.prototype.enable=function(){this._core.subscribe("execute",this.preloadOnNavigate.bind(this))};h.prototype.preloadOnNavigate=function(i,j){if(j.type==="keyword"){var k=c("XWarmUserRequestArgsController").getURIBuilder().setString("query",String(j.text));if(j.csid)k.setString("csid",String(j.csid));new(c("AsyncRequest"))().setURI(k.getURI()).setAllowCrossPageTransition(true).send()}};h.prototype.disable=function(){c("emptyFunction")()};f.exports=h}),null);
__d("FacebarTypeaheadInjectedSuggestion",["csx","cx","fbt","Arbiter","DOM"],(function a(b,c,d,e,f,g,h,i,j){"use strict";__p&&__p();var k=3,l=0,m;function n(o){this.core=o.getCore();this.$FacebarTypeaheadInjectedSuggestion1=this.core.view}n.prototype.enable=function(){c("Arbiter").subscribe("FacebarTypeahead.injectedSuggestion",function(){return this.addSuggestionTextToSearchBox()}.bind(this));c("Arbiter").subscribe("FacebarTypeahead.removeInjectedSuggestion",function(){return this.removeSuggestionTextToSearchBox()}.bind(this));c("Arbiter").subscribe("FacebarTypeahead.showSuggestionBadge",function(){return this.showSuggestionBadge(true)}.bind(this));c("Arbiter").subscribe("FacebarTypeahead.hideSuggestionBadge",function(){return this.showSuggestionBadge(false)}.bind(this))};n.prototype.disable=function(){this.$FacebarTypeaheadInjectedSuggestion2.unsubscribe()};n.prototype.showSuggestionBadge=function(o){var p=c("DOM").scry(this.core.getElement(),"._5861")[0];if(p){var q=p.getElementsByClassName("injectedSearchSuggestion")[0];if(!q)return;if(o)q.style.visibility="visible";else q.style.visibility="hidden"}};n.prototype.removeSuggestionTextToSearchBox=function(){__p&&__p();if(!l)return;--l;if(!l){var o=c("DOM").scry(this.core.getElement(),"._5861")[0],p=o.getElementsByClassName("injectedSearchSuggestion")[0];o.removeChild(p)}else if(m){var q=j._({"suggestion":"{suggestionCount} new suggestion","suggestions":"{suggestionCount} new suggestions"},[j.param("suggestionCount",l),j["enum"](l===1?"suggestion":"suggestions",{suggestion:"suggestion",suggestions:"suggestions"})]);m.innerText=q}};n.prototype.addSuggestionTextToSearchBox=function(){__p&&__p();if(l){if(m&&l<k)m.innerText=l+1+" new suggestions"}else{var o=c("DOM").scry(this.core.getElement(),"._5861")[0];if(o){m=document.createElement("DIV");var p=document.createTextNode("1 new suggestion");m.style.cssFloat="right";m.appendChild(p);var q=document.createElement("DIV");q.className="_586j injectedSearchSuggestion";q.appendChild(m);o.appendChild(q)}}l+=1};f.exports=n}),null);
__d("FacebarTypeaheadNavigation",["Arbiter","FacebarNavigation","emptyFunction"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i){this._core=i.core;this._preserveQuery=false;this._typeahead=i}h.prototype.enable=function(){c("FacebarNavigation").registerBehavior(this);this._core.subscribe("execute",this.executedUserQuery.bind(this))};h.prototype.executedUserQuery=function(i,j){this._preserveQuery=true};h.prototype.pageTransition=function(){if(!this._preserveQuery){this._core.close();this._core.reset()}else this._preserveQuery=false};h.prototype.setPageQuery=function(i){i=this._core.setPageQuery(i);this._typeahead.inform("navigation",i,c("Arbiter").BEHAVIOR_PERSISTENT)};Object.assign(h.prototype,{disable:c("emptyFunction")});f.exports=h}),null);
__d("FacebarTypeaheadPrefixLengthOrderedCache",["Arbiter","emptyFunction"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i){this._typeahead=i}h.prototype.enable=function(){__p&&__p();this._typeahead.data.inform("setSortFunction",function(i){return function(j,k){if((j.keyword_type==="local"||j.keyword_type==="local_category")&&(k.keyword_type==="local"||k.keyword_type==="local_category"))return 0;if(j.cache_id_length!==k.cache_id_length)return j.cache_id_length-k.cache_id_length;var l=this.getCost(j,i)-this.getCost(k,i);if(l!==0)return l;return(j.semantic||"").localeCompare(k.semantic||"")}.bind(this)}.bind(this),c("Arbiter").BEHAVIOR_STATE)};h.prototype.getCost=function(i,j){return i.cost||0};Object.assign(h.prototype,{disable:c("emptyFunction")});f.exports=h}),null);
__d("FacebarTypeaheadQuickSelect",["FacebarStructuredText","URI"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h="/search/web/direct_search.php";function i(j){this._core=j.getCore();this._view=j.getView();this._input=this._core.input;this._beforeSelectListener=null;this._quickSelectListener=null}i.prototype.enable=function(){this._beforeSelectListener=this._view.subscribe("beforeSelect",this._quickSelect.bind(this));this._quickSelectListener=this._view.subscribe("quickSelect",this._quickSelect.bind(this))};i.prototype._quickSelect=function(j,k){if(k&&k.selected)return true;var l=this._input.getValue().toArray(),m=new(c("FacebarStructuredText"))(l),n=m.toString();if(!n)return true;var o=new(c("URI"))(h).addQueryData("q",n),p={input_query:n,type:"quickselect",text:n,position:0,with_mouse:0,semantic:"quickselect("+o.toString()+")",extra_uri_params:{source:"quickselect",sid:this._core.getSessionID()},uri:o};this._core.inform("quickSelectRedirect",p);this._core.executeQuery(p);return false};i.prototype.disable=function(){this._beforeSelectListener&&this._view.unsubscribe(this._beforeSelectListener);this._quickSelectListener&&this._view.unsubscribe(this._quickSelectListener)};f.exports=i}),null);
__d("FacebarTypeaheadRecorderBasic",["FacebarTypeaheadRecorder"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i){this._typeahead=i}h.prototype.enable=function(){var i=this._typeahead;this._recorder=new(c("FacebarTypeaheadRecorder"))(i)};h.prototype.disable=function(){this._typeahead.unsubscribe(this._subscription);this._recorder=null;this._subscription=null};Object.assign(h.prototype,{_subscription:null});f.exports=h}),null);
__d("FacebarTypeaheadSeeMore",["cx","fbt","FacebarGlobalOptions","FacebarGSv2Echo","FacebarJSConstants","FacebarKeywordSearchUtils","FacebarStructuredText"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();function j(k){this.$FacebarTypeaheadSeeMore1=k.getCore();this.$FacebarTypeaheadSeeMore2=this.$FacebarTypeaheadSeeMore1.view}j.prototype.enable=function(){this.$FacebarTypeaheadSeeMore3=this.$FacebarTypeaheadSeeMore2.subscribe("seeMore",this.$FacebarTypeaheadSeeMore4.bind(this))};j.prototype.disable=function(){this.$FacebarTypeaheadSeeMore3.unsubscribe()};j.prototype.$FacebarTypeaheadSeeMore4=function(k,l){var m=l.value.toString().trim();m=c("FacebarGSv2Echo").normalizeValue(m);var n=c("FacebarKeywordSearchUtils").makeFacebarEntry(m),o=void 0;if(c("FacebarGlobalOptions").hasKeywordOnlyTypeahead)o=i._("See all results for {query}",[i.param("query",m)]);else o=i._("See all results for \"{query}\"",[i.param("query",m)]);return babelHelpers["extends"]({},n,{query_string:m,icon_class:"_5b1w",isSeeMore:true,structure:c("FacebarStructuredText").fromString(m),displayStructure:c("FacebarStructuredText").fromString(String(o)),uri:n.uri,tags:{},isSingleState:this.$FacebarTypeaheadSeeMore1.data.getSingleState(),keywordType:c("FacebarJSConstants").keywordTypes.escape,keywordSource:c("FacebarJSConstants").keywordTypes.escape})};f.exports=j}),null);
__d("FacebarTypeaheadSelectAll",["requestAnimationFrame"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i){this._core=i.getCore();this._listener=null}h.prototype.enable=function(){var i=this._core.input;this._listener=this._core.subscribe("focus",function(j,k){var l=k&&k.catchup;l||c("requestAnimationFrame")(function(){i.selectInput()})})};h.prototype.disable=function(){this._listener&&this._core.unsubscribe(this._listener)};f.exports=h}),null);
__d("FacebarTypeaheadShortcut",["KeyEventController","Run","setTimeoutAcrossTransitions"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i){this._input=i.core.input;this._view=i.view;this._listener=null}h.prototype.enable=function(){this._registerListener()};h.prototype.disable=function(){};h.prototype._registerListener=function(){this._listener&&this._listener.remove();this._listener=c("KeyEventController").registerKey("SLASH",this._handleKeydown.bind(this));c("Run").onLeave(function(){c("setTimeoutAcrossTransitions")(this._registerListener.bind(this),0)}.bind(this))};h.prototype._handleKeydown=function(i){var j=i.getModifiers().shift;if(j)return;this._selectInput();return false};h.prototype._selectInput=function(){this._view.setAutoSelect(true);this._input.focus();this._input.selectInput();this._input.inform("shortcut",{shift:false})};f.exports=h}),null);
__d("FacebarTypeaheadStickyFilters",["Arbiter","NavigationMessage","Run","SubscriptionsHandler","enumerate","setTimeoutAcrossTransitions"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=false,i=5e3,j="/search/top";function k(l){this.core=l.getCore();this.filters={};this.subscriptionsHandler=new(c("SubscriptionsHandler"))();this.view=this.core.view}k.prototype.enable=function(){__p&&__p();this.subscriptionsHandler.addSubscriptions(c("Arbiter").subscribe("SearchLHCFilters.initStickyFilters",function(l,m){__p&&__p();for(var n=c("enumerate")(this.filters),o=Array.isArray(n),p=0,n=o?n:n[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var q;if(o){if(p>=n.length)break;q=n[p++]}else{p=n.next();if(p.done)break;q=p.value}var r=q,s=r[0],t=r[1];if(!(s in m))t.active=false}for(var u=c("enumerate")(m),v=Array.isArray(u),w=0,u=v?u:u[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var x;if(v){if(w>=u.length)break;x=u[w++]}else{w=u.next();if(w.done)break;x=w.value}var y=x,z=y[0],A=y[1],B={value:A,active:true};this.filters[z]=B}}.bind(this)),c("Arbiter").subscribe(c("NavigationMessage").NAVIGATION_BEGIN,function(event,l){this.resetFiltersIfNotSearching()}.bind(this)),this.view.subscribe("filter",this.handleFilter.bind(this)),this.core.subscribe("magSearch",this.handleSearch.bind(this)),this.view.subscribe("afterSeeMore",this.handleSeeMore.bind(this)));c("Run").onLeave(function(){this.resetFiltersIfNotSearching()}.bind(this))};k.prototype.disable=function(){this.teardown()};k.prototype.teardown=function(){this.subscriptionsHandler.release()};k.prototype.handleFilter=function(l,m){var n=m.results.filter(function(o){return!o.isNullState&&!o.isTrending});this.updateResultData(n)};k.prototype.handleSearch=function(l,m){this.updateResultData([m])};k.prototype.handleSeeMore=function(l,m){var n=m.results.filter(function(o){return o.isSeeMore});this.updateResultData(n)};k.prototype.resetFiltersIfNotSearching=function(){__p&&__p();if(h)return;h=true;c("setTimeoutAcrossTransitions")(function(){__p&&__p();var l=window.location.pathname;if(l.indexOf(j)===-1)for(var m=c("enumerate")(this.filters),n=Array.isArray(m),o=0,m=n?m:m[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var p;if(n){if(o>=m.length)break;p=m[o++]}else{o=m.next();if(o.done)break;p=o.value}var q=p,r=q[1];r.active=false}h=false;c("Run").onLeave(function(){this.resetFiltersIfNotSearching()}.bind(this))}.bind(this),i)};k.prototype.updateResultData=function(l){__p&&__p();for(var m=0;m<l.length;m++){var n=l[m];if(n.type==="keyword"){var o=n.uri.getQueryData();for(var p=c("enumerate")(this.filters),q=Array.isArray(p),r=0,p=q?p:p[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var s;if(q){if(r>=p.length)break;s=p[r++]}else{r=p.next();if(r.done)break;s=r.value}var t=s,u=t[0],v=t[1];if(v.active)o[u]=v.value;else n.uri.removeQueryData(u)}}}};f.exports=k}),null);
__d("TypeaheadEarlyUserRequest",["AsyncRequest","FacebarGlobalOptions","XWarmUserRequestArgsController"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i){this._core=i.getCore();this._listener=null}h.prototype.enable=function(){this._listener=this._core.subscribe("focus",function(i,j){new(c("AsyncRequest"))().setURI(c("XWarmUserRequestArgsController").getURIBuilder().getURI()).send();this.disable()}.bind(this))};h.prototype.disable=function(){this._listener&&this._core.unsubscribe(this._listener)};f.exports=h}),null);
__d("XSearchFacebarSurveyController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/search/facebar_survey/",{id:{type:"String",required:true},query:{type:"String"},session_id:{type:"String",required:true},on_session_start:{type:"Exists",defaultValue:false},result_selected:{type:"Exists",defaultValue:false}})}),null);
__d("AbandonedSessionSurvey",["AsyncRequest","SubscriptionsHandler","XSearchFacebarSurveyController","getOrCreateDOMID"],(function a(b,c,d,e,f,g){__p&&__p();function h(i){"use strict";__p&&__p();this.tryToSubmitSurvey=function(){if(this.searchBoxFocused){this.openSurvey();this.resultSelected=false;this.searchBoxFocused=false}}.bind(this);this.core=i.getCore();this.data=i.getData();this.view=i.getView();this.subscriptionsHandler=new(c("SubscriptionsHandler"))()}h.prototype.enable=function(){"use strict";this.subscriptionsHandler.addSubscriptions(this.core.subscribe("focus",function(){this.searchBoxFocused=true;this.resultSelected=false}.bind(this)),this.data.subscribe("beforeQuery",function(i,j){this.query=j.value||""}.bind(this)),this.view.subscribe("select",function(){this.resultSelected=true;this.tryToSubmitSurvey()}.bind(this)),this.core.subscribe("blur",this.tryToSubmitSurvey))};h.prototype.disable=function(){"use strict";this.subscriptionsHandler.release();this.request&&this.request.abort()};h.prototype.openSurvey=function(){"use strict";__p&&__p();if(this.openedSurvey)return;this.openedSurvey=true;var i=this.core.element;if(i==null)i=this.core.getElement();var j=this.normalizeValue(this.query),k=c("XSearchFacebarSurveyController").getURIBuilder().setString("id",c("getOrCreateDOMID")(i)).setString("query",j!=null?j:"").setString("session_id",this.data.queryData.sid).setExists("result_selected",this.resultSelected);this.request=new(c("AsyncRequest"))().setMethod("POST").setAllowCrossPageTransition(true).setURI(k.getURI());this.request.send()};h.prototype.normalizeValue=function(i){"use strict";return String(i).trim().replace(/\s+/g," ").replace(/[\u200E|\u200F|\u202a|\u202b|\u202c]/g,"").toLowerCase()};f.exports=h}),null);