/*!CK:3401015538!*//*1444016039,*/

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

__d('Facepile.react',['joinClasses','Link.react','Pixelz.react','React','List.react','cx'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n=k.PropTypes,o={small:24,medium:32,large:50},p=k.createClass({displayName:'Facepile',propTypes:{className:n.string,onFaceClick:n.func,onComponentDidMount:n.func,profiles:n.arrayOf(n.shape({URL:n.string,name:n.string.isRequired,uniqueID:n.number.isRequired,profilePicURI:n.string.isRequired})).isRequired,size:n.oneOf(['small','medium','large']).isRequired},_onFaceClick:function(q,r){if(this.props.onFaceClick)this.props.onFaceClick(q,r);},componentDidMount:function(){if(this.props.onComponentDidMount)this.props.onComponentDidMount();},renderFace:function(q,r){var s=o[this.props.size];return (k.createElement('li',{className:"_43q7",key:q.uniqueID,onClick:this._onFaceClick.bind(this,q,r)},k.createElement(i,{href:q.URL,'aria-label':q.name,'data-hover':'tooltip',className:"_2rt_",'data-tooltip-alignh':'left'},k.createElement(j,{src:q.profilePicURI,width:s,height:s,className:'img'}))));},render:function(){var q=h(this.props.className,"_43qm"+(this.props.size=='small'?' '+"_43q9":'')+(this.props.size=='medium'?' '+"_43qc":'')+(this.props.size=='large'?' '+"_43qf":''));return (k.createElement('div',{className:q},k.createElement(l,{className:'uiFacepile/list',direction:'horizontal',spacing:'none',border:'none'},this.props.profiles.map(this.renderFace))));}});f.exports=p;},null);
__d("XBrowserPushDisabledController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/notifications\/client\/push\/disabled\/",{});},null,{});
__d("XBrowserPushXOutController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/notifications\/client\/push\/xout\/",{});},null,{});
__d("XServiceWorkerSessionChangeController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/service_workers\/session\/persist\/",{});},null,{});
__d('BrowserPushSessionChange.react',['AsyncRequest','BanzaiLogger','Image.react','ImageBlock.react','LayerFadeOnHide','React','ReactLayeredComponentMixin','XBrowserPushDisabledController','XBrowserPushXOutController','XServiceWorkerSessionChangeController','XUIDialog.react','XUIDialogBody.react','XUIDialogButton.react','XUIDialogFooter.react','XUIDialogOkayButton.react','XUIDialogTitle.react','XUISpinner.react','XUIText.react','reloadPage','cx','fbt','ix'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca){if(c.__markCompiled)c.__markCompiled();var da=m.PropTypes,ea=m.createClass({displayName:'BrowserPushSessionChange',mixins:[n],propTypes:{onHide:da.func.isRequired,push:da.object.isRequired},getInitialState:function(){return {dialogShown:true,spin:false};},_onToggle:function(fa){if(fa)return;this.setState({dialogShown:false});this._logEvent('session_keep');var ga=q.getURIBuilder().getURI();new h().setURI(ga).setMethod('post').setData({app_id:this.props.push.appID}).setAllowCrossPageTransition(true).setHandler((function(ha){this.props.onHide();}).bind(this)).send();},_logEvent:function(event){var fa={event:event,appid:this.props.push.appID,surface:'session_change'};i.log('BrowserPushLoggerConfig',fa);},_doNotPersist:function(){this.setState({spin:true});this._logEvent('session_uninstall');this._logEvent('xout');var fa=p.getURIBuilder().getURI(),ga=(function(){this.props.push.unregisterPushAndSW(o,h).then(function(ha){z.now();})['catch'](function(ha){throw ha;});}).bind(this);new h().setURI(fa).setMethod('post').setHandler(ga).setAllowCrossPageTransition(true).send();},componentDidMount:function(){this._logEvent('session_change_prompt');},renderLayers:function(){if(!this.state.dialogShown)return {};var fa=ca('/images/notifications/potsy_jump.png');return {dialog:m.createElement(r,{shown:true,behaviors:{LayerFadeOnHide:l},onToggle:this._onToggle,width:445},m.createElement(w,null,ba._("Desktop Notifications Are On")),m.createElement(s,null,this.state.spin?m.createElement(x,{size:'large'}):m.createElement(k,{spacing:'medium'},m.createElement(j,{src:fa,alt:ba._("Desktop Notifications Are On")}),m.createElement('div',null,m.createElement('div',{className:"_3-8h"},m.createElement(y,{size:'large'},ba._("When you get a new notification, you'll see it in the corner of your screen."))),m.createElement('div',{className:"_3-8h"},m.createElement(y,{size:'small'},ba._("To be sure you get notifications, youll now stay logged into Facebook on this computer. If you're using a public computer or don't want to stay logged in, click Undo to turn off desktop notifications.")))))),m.createElement(u,null,m.createElement(t,{action:'button',label:ba._("Undo"),onClick:this._doNotPersist}),m.createElement(v,{use:'confirm',action:'cancel'})))};},render:function(){return (m.createElement('span',null));}});f.exports=ea;},null);
__d('NotificationPermissionNotice.react',['Event','Keys','React','ReactLayeredComponentMixin','XUIAmbientNUX.react','cx','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n){if(c.__markCompiled)c.__markCompiled();var o=[],p=j.PropTypes,q=j.createClass({displayName:'NotificationPermissionNotice',mixins:[k],propTypes:{onHide:p.func.isRequired,shortText:p.bool},componentDidMount:function(){o.push(h.listen(window,'mousedown',this.props.onHide));o.push(h.listen(window,'keydown',(function(event){if(event.keyCode===i.ESC)this.props.onHide();}).bind(this)));},componentWillUnmount:function(){while(o.length>0){var r=o.pop();r.remove();}},renderLayers:function(){var r=this.props.shortText?n._("Click the lock to give Chrome permission to send you desktop notifications."):n._("If you change your mind, click the lock to give Chrome permission to send you desktop notifications.");return {nux:j.createElement(l,{contextRef:(function(){return this.refs.noticeAnchor;}).bind(this),shown:true,position:'below',onCloseButtonClick:this.props.onHide},r)};},render:function(){return (j.createElement('span',{ref:'noticeAnchor',className:"_1_i1"}));}});f.exports=q;},null);
__d('Spotlight.react',['LayerHideOnBlur','LayerHideOnEscape','ReactLayer','Spotlight'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();var l=j.createClass({getDefaultEnabledBehaviors:function(){return {hideOnBlur:h,hideOnEscape:i};},createLayer:function(m){var n=this.enumerateBehaviors(this.props.behaviors),o={addedBehaviors:n,rootClassName:this.props.rootClassName},p=new k(o,m);p.conditionShow(this.props.shown);if(this.props.onBeforeHide)p.subscribe('beforehide',this.props.onBeforeHide);if(this.props.onHide)p.subscribe('hide',this.props.onHide);return p;},receiveProps:function(m){this.layer.conditionShow(m.shown);}});f.exports=l;},null);
__d("XBrowserPushOptinFriendsController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/notifications\/push\/optin\/friends\/",{});},null,{});
__d('NotificationPermissionRequest.react',['AsyncRequest','Facepile.react','Spotlight.react','ShortProfiles','React','ReactLayeredComponentMixin','UserAgent','XBrowserPushOptinFriendsController','cx','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();var r=n.isPlatform('Mac OS X'),s=l.PropTypes,t=l.createClass({displayName:'NotificationPermissionRequest',mixins:[m],propTypes:{onHide:s.func.isRequired,useFaces:s.bool.isRequired,useAllow:s.bool.isRequired},getInitialState:function(){return {friendsList:[]};},componentWillMount:function(){if(!this.props.useFaces)return;new h().setURI(o.getURIBuilder().getURI()).setHandler((function(u){var v=u.payload.list,w=[];for(var x=0;w.length<(r?7:6)&&x<v.length;x++){var y=v[x].slice(0,-2),z=k.getNowUnsafe(y);if(z&&z.type==='friend')w.push(z);}w=w.map(function(aa){return {uniqueID:parseInt(aa.id,10),name:aa.name,profilePicURI:aa.thumbSrc};});this.setState({friendsList:w});}).bind(this)).send();},renderLayers:function(){var u=null;if(this.props.useAllow){var v=l.createElement('span',{className:"_23ah"},q._("Allow")),w=this.props.useFaces?q._("Don't miss updates from friends - click {allow} to see your notifications on your desktop.",[q.param('allow',v)]):q._("Click {allow} to see your notifications on your desktop.",[q.param('allow',v)]);u=l.createElement('div',{className:"_23ak"+(r?' '+"_3qwt":'')+(' '+"_50f5")},l.createElement('div',null,w));}return {spotlight:l.createElement(j,{shown:true,onHide:this.props.onHide},l.createElement('div',{className:"_n3"},l.createElement('div',{className:"_1s6q"+(r?' '+"_3qw_":'')},l.createElement(i,{profiles:this.state.friendsList,size:'medium',className:"_23aj"}),u)))};},render:function(){return l.createElement('span',null);}});f.exports=t;},null);
__d("ClientServiceWorkerMessage",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j,k){"use strict";this.$ClientServiceWorkerMessage1=i;this.$ClientServiceWorkerMessage2=j;this.$ClientServiceWorkerMessage3=k;}h.prototype.sendViaController=function(){"use strict";if(!navigator.serviceWorker||!navigator.serviceWorker.controller)return;var i=new MessageChannel();if(this.$ClientServiceWorkerMessage3)i.port1.onmessage=this.$ClientServiceWorkerMessage3;navigator.serviceWorker.controller.postMessage({command:this.$ClientServiceWorkerMessage1,data:this.$ClientServiceWorkerMessage2},[i.port2]);};f.exports=h;},null);
__d('BrowserPushCommands',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h='browser_push_ack',i='browser_push_redirect',j='browser_push_window_visible',k={ACK:h,REDIRECT:i,WINDOW_VISIBLE:j};f.exports=k;},null);
__d('BrowserPushMessageHandler',['BrowserPushCommands','EventListener','isFacebookURI','URISchemes'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();function l(event){if(event.data.command&&event.data.command===h.REDIRECT){if(typeof window.onbeforeunload()==='undefined'){event.ports[0].postMessage({command:h.ACK,success:true});}else{event.ports[0].postMessage({command:h.ACK,success:false});return;}var n=event.data.uri;if(/^([^.:/?#]+):/.test(n)&&!k.isAllowed(/^([^.:/?#]+):/.exec(n)[0])&&j(n))throw new Error('goURI: URI scheme rejected, URI: '+n);window.location.href=n;}}var m={registerRedirectHandler:function(){i.listen(window,'message',function(event){if(event.origin==="")l(event);});if(navigator.serviceWorker&&navigator.serviceWorker.addEventListener)navigator.serviceWorker.addEventListener('message',function(event){if(new RegExp('^'+window.location.protocol+'//'+window.location.host+'$').test(event.origin))l(event);});}};f.exports=m;},null);
__d('BrowserPushVisibilityChanger',['BrowserPushCommands','ClientServiceWorkerMessage','Visibility'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();function k(){new i(h.WINDOW_VISIBLE,null).sendViaController();}var l={listenForVisibility:function(){if(!j.isHidden())k();j.addListener(j.VISIBLE,k);}};f.exports=l;},null);
__d('ServiceWorkerRegistration',['Promise'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=('serviceWorker' in navigator);function j(){var l=navigator.serviceWorker;if(!i||!l)throw new Error('serviceWorker is not supported in this browser');return l;}var k={isSupported:function(){return i;},registerWorkerIfUnregistered:function(l){var m=j();return new h((function(n,o){this.getWorkerRegistration(l).then(function(p){if(!p){m.register(l).then(function(){m.ready.then(n);});}else n(p);});}).bind(this));},getWorkerRegistration:function(l){var m=j();return m.getRegistration(l);}};f.exports=k;},null);
__d('PushRegistration',['BrowserPushMessageHandler','BrowserPushVisibilityChanger','Map','Promise','ServiceWorkerRegistration'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m=window.Notification,n=new j();o.get=function(p,q){'use strict';if(n.has(q))return n.get(q);var r=new o(p,q);n.set(q,r);return r;};function o(p,q){'use strict';this.$PushRegistration1=p;this.appID=q;if(!o.$PushRegistration2&&!o.$PushRegistration3){o.$PushRegistration2=false;o.$PushRegistration3=false;}}o.prototype.getPushSubscription=function(){'use strict';return new k((function(p,q){if(!m||m.permission==='denied')q(new Error('No permission or not supported'));l.getWorkerRegistration(this.$PushRegistration1).then(function(r){if(!r){p(null);return;}r.pushManager.getSubscription().then(function(s){p(s);})['catch'](q);})['catch'](q);}).bind(this));};o.prototype.$PushRegistration4=function(p){'use strict';var q=p.endpoint;if('subscriptionId' in p&&!new RegExp('/'+p.subscriptionId+'$').test(q))q+='/'+p.subscriptionId;return q;};o.prototype.$PushRegistration5=function(p,q,r,s){'use strict';var t=this.$PushRegistration4(r),u=p.getURIBuilder().getURI(),v=new q(u);v.setData({app_id:this.appID,push_endpoint:t});v.setMethod('post');if(v.setHandler)v.setHandler(function(w){if(w.payload&&w.payload.session_change)s();});v.send();};o.prototype.getSubscription=function(){'use strict';return new k((function(p,q){this.getPushSubscription().then((function(r){if(r){p(this.$PushRegistration4(r));}else p(null);}).bind(this))['catch'](q);}).bind(this));};o.prototype.maybeRegisterPushAgain=function(p,q,r){'use strict';return new k((function(s,t){this.getPushSubscription().then((function(u){if(u){this.$PushRegistration5(p,q,u,r);s(this.$PushRegistration4(u));}else s(null);}).bind(this))['catch'](function(){s(null);});}).bind(this));};o.prototype.$PushRegistration6=function(p,q,r){'use strict';return new k((function(s,t){if(o.$PushRegistration3&&!r){t(new Error('sending disable info already'));return;}o.$PushRegistration3=true;var u=p.getURIBuilder().getURI(),v=new q(u.toString());v.setData({appid:this.appID,from_browser_settings:r});v.setMethod('post');if(v.listen){v.listen('finally',s);v.listen('fail',function(){o.$PushRegistration3=false;t();});}else if(v.setErrorHandler&&v.setHandler){v.setErrorHandler(function(){o.$PushRegistration3=false;t();});v.setHandler(s);}else s();v.send();}).bind(this));};o.prototype.isPushRegistered=function(p,q,r,s,t,u){'use strict';h.registerRedirectHandler();return new k((function(v,w){this.getPushSubscription().then((function(x){v(!!x||p&&!o.pushPermissionIsPending());if(x){if(t){x.unsubscribe().then((function(){this.registerPush(q,s,u);}).bind(this))['catch'](function(){});}else i.listenForVisibility();}else if(!x&&p)if(o.pushPermissionIsOn()){this.registerPush(q,s,u)['catch'](function(){});}else this.$PushRegistration6(r,s,false);}).bind(this))['catch']((function(){if(p){this.$PushRegistration6(r,s,false);w();}}).bind(this));}).bind(this));};o.prototype.registerPush=function(p,q,r){'use strict';if(o.$PushRegistration2)return new k(function(s,t){t(new Error('registering already'));});o.$PushRegistration2=true;return new k((function(s,t){l.registerWorkerIfUnregistered(this.$PushRegistration1).then((function(u){u.pushManager.subscribe({userVisibleOnly:true}).then((function(v){s(this.$PushRegistration4(v));this.$PushRegistration5(p,q,v,r);i.listenForVisibility();}).bind(this))['catch'](function(v){o.$PushRegistration2=false;t(v);});}).bind(this))['catch'](function(u){o.$PushRegistration2=false;t(u);});}).bind(this));};o.prototype.unregisterPushAndSW=function(p,q){'use strict';return new k((function(r,s){this.$PushRegistration6(p,q,true).then((function(){l.getWorkerRegistration(this.$PushRegistration1).then(function(t){if(t){t.pushManager.getSubscription().then(function(u){u.unsubscribe().then(function(){t.unregister();r(true);})['catch'](function(){r(true);});})['catch'](function(){r(true);});}else{t.unregister();r(true);}})['catch'](s);}).bind(this))['catch'](s);}).bind(this));};o.pushPermissionIsPending=function(){'use strict';return m&&m.permission==='default';};o.pushPermissionIsOn=function(){'use strict';return m&&m.permission==='granted';};f.exports=o;},null);
__d("XBrowserPushMuteController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/notifications\/client\/push\/mute\/",{push_endpoint:{type:"String",required:true},appid:{type:"Int",required:true},is_settings_page:{type:"Bool",defaultValue:false},__asyncDialog:{type:"Int"}});},null,{});
__d('BrowserPushMuteOptions',['AsyncRequest','PushRegistration','React','ReactDOM','XBrowserPushMuteController','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();function n(p,q,r){var s=i.get(q,r);s.getPushSubscription().then(function(t){if(t){var u=l.getURIBuilder().setString('push_endpoint',t).setInt('appid',r).getURI();new h().setURI(u).setRelativeTo(p).send();}})['catch'](function(t){throw t;});}var o={showMuteOptions:function(p,q,r){if(!i.pushPermissionIsOn())return;k.render(j.createElement('a',{href:'#',onClick:function(){n(p,q,r);}},m._("Mute")),p);}};f.exports=o;},null);
__d("XPushRegisterServiceWorkerController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/push\/register\/service_worker\/",{});},null,{});
__d('BrowserPushNoUpsellInstaller',['Arbiter','AsyncRequest','BanzaiLogger','BrowserPushSessionChange.react','DOM','NotificationPermissionNotice.react','NotificationPermissionRequest.react','PushRegistration','React','ReactDOM','XBrowserPushDisabledController','XBrowserPushXOutController','XPushRegisterServiceWorkerController'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){if(c.__markCompiled)c.__markCompiled();function u(event,x){var y={event:event,appid:x,surface:'prompt'};j.log('BrowserPushLoggerConfig',y);}function v(x,y){var z=l.insertBefore(x,l.create('span')),aa=z.pop();q.render(p.createElement(k,{onHide:function(){q.unmountComponentAtNode(x);},push:y}),aa);}var w={installPush:function(x,y,z,aa,ba,ca,da,ea,fa){var ga=o.get(x,y);ga.isPushRegistered(ca,t,r,i,!!fa,function(){v(z,ga);}).then(function(ha){if(ha||da)return;if(o.pushPermissionIsPending()&&!ea)q.render(p.createElement(n,{useFaces:aa,useAllow:ba,onHide:function(){q.unmountComponentAtNode(z);}}),z);u('turn_on',y);ga.registerPush(t,i,function(){v(z,ga);}).then(function(){q.unmountComponentAtNode(z);u('install',y);h.inform('BrowserPushInstall/installed');})['catch'](function(ia){q.unmountComponentAtNode(z);if(window.Notification&&window.Notification.permission==='denied'){q.render(p.createElement(m,{onHide:function(){q.unmountComponentAtNode(z);}}),z);u('deny',y);}else u('install_ignore',y);var ja=s.getURIBuilder().getURI();new i().setURI(ja).setMethod('post').send();u('xout',y);});})['catch'](function(){});}};f.exports=w;},null);