/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 10th 2010 5:08:13 AM PST                            */
/*      Machine:  10.16.140.104                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/1z37bu8xtyo04wgw.pkg.js h:4xlr707a                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/1z37bu8xtyo04wgw.pkg.js                                   */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/1z37bu8xtyo04wgw.pkg.js"]); }

function typeahead_mentions(_L0,_L1,_L2){this.element=$(_L0);_L2=copy_properties({delimiter:'@',anchor_block:true,max_display:4,max_results:4,auto_select:false},_L2||{});this.active=true;this.selected=null;_L1=new search_friend_source(_L1,true);_L1.allowTypes([search_friend_source.TYPES.USER,search_friend_source.TYPES.PAGE,search_friend_source.TYPES.APP,search_friend_source.TYPES.GROUP,search_friend_source.TYPES.EVENT]);this.parent.construct(this,_L0,_L1,_L2);CSS.addClass(this.dropdown,'typeahead_search');CSS.addClass(this.dropdown,'typeahead_mentions');this.initializeCleanup();this.hide();}typeahead_mentions.extend('typeaheadpro');copy_properties(typeahead_mentions.prototype,{_onchange:bagofholding,set_class:bagofholding,set_value:bagofholding,update_class:bagofholding,recalc_scroll:bagofholding,clear_placeholder:bagofholding,initializeCleanup:function(){Event.listen(this.element,'drop',Event.kill);Event.listen(this.element,'paste',function(){this.element.setOpacity(0);this.element.setStyle('height',this.element.offsetHeight+'px');this.cleanup.bind(this).defer(100);}.bind(this));},setup_anchor:function(){return this.element.parentNode.parentNode;},get_value:function(){var _L0=Text.getRange(),_L1=Text.getFocusNode(_L0,this.element),_L2=Text.getFocusValue(_L0,_L1),_L3=Text.getFocusOffset(_L0,_L1);if(!_L0||!_L2||_L0.collapsed===false)return '';var _L4=_L2.lastIndexOf(this.delimiter,_L3);if(_L4<0||(_L4>0&&(/\w/).test(_L2.charAt(_L4-1))))return '';return _L2.slice(_L4,_L3).trim();},check_value:function(){if(DOM.getText(this.element).lastIndexOf(this.delimiter)==-1){if(this.value==this.delimiter)this.hide();return;}if(!this.ready||!this.active){if(!this.loading){this.loading=true;this.source.initialize(function(){this.ready=true;this.results_text=this.delimiter;this.check_value();}.bind(this));this.set_message(_tx("Llwytho..."));this.show();}return;}var _L0=this.get_value();if(_L0!=this.value){this.dirty_results();this.value=_L0;}if(_L0==this.delimiter){this.set_message(_tx("Type the name of someone or something..."));this.show();}},_onblur:function(_L0){this.fixBreak();this.hide();},_onfocus:function(_L0){this.fixBreak();this.focused=true;this.results_text='';},_onkeydown:function(_L0){_L0=$E(_L0);var _L1=_L0?Event.getKeyCode(_L0):-1;if(ua.firefox()&&_L0.getModifiers().meta&&(_L1==KEYS.LEFT||_L1==KEYS.RIGHT))_L0.kill();if(_L1==KEYS.RETURN)if(this.visible){_L0.kill();}else if(document.selection){Text.insertBreak();_L0.kill();}if(this.visible)return this.parent._onkeydown(_L0);},_onkeypress:function(_L0){if(this.visible)return this.parent._onkeypress(_L0);var _L1=_L0?Event.getKeyCode(_L0):-1;if(ua.firefox()&&_L1==KEYS.BACKSPACE){var _L2=Text.getFocusNode(),_L3=Text.getFocusOffset();if(_L3==0){_L2=_L2.previousSibling;}else if(_L2==this.element&&_L3>0)_L2=this.element.childNodes[_L3-1];if(this.isMention(_L2))DOM.remove(_L2);}},_onkeyup:function(_L0){this.check_value();if(this.visible)return this.parent._onkeyup(_L0);},_onselect:function(_L0){if(!_L0)return;var _L1=this.value,_L2=this.element.childNodes;for(var i=0,l=_L2.length;i<l;i++){var _L5=_L2[i];if(this.isText(_L5)){var _L6=_L5.data,_L7=_L6.lastIndexOf(_L1,Text.getFocusOffset());if(_L7>-1){var _L8=this.createMention(_L0);var _L9=document.createTextNode(_L6.substring(0,_L7).replace(/[\s\xa0]*$/g,'')+"\xa0");_L5.data="\xa0"+_L6.substring(_L7+_L1.length).replace(/^[\s\xa0]*/g,'');this.element.insertBefore(_L8,_L5);this.element.insertBefore(_L9,_L8);this.cleanup();Text.setFocusAfter(_L8);break;}}}this.hide();},createSpacer:function(){return document.createTextNode("\xa0");},createMention:function(obj){var _L1={id:obj.i,text:obj.t};var _L2=$N('a',{href:'#',tabIndex:-1,className:'mention',unselectable:'on',contentEditable:false,oncontextmenu:Event.kill,onclick:Event.kill,onfocus:Event.kill},$N('span',{contentEditable:!!document.selection},_L1.text));Event.listen(_L2,'mousedown',this.selectMention.bind(this,_L2));DataStore.set(_L2,'mention',_L1);return _L2;},selectMention:function(_L0,_L1){if(_L1)_L1.kill();if(!_L0)return;if(!_L0.previousSibling)DOM.insertBefore(this.createSpacer(),_L0);setTimeout(function(){this.element.focus();Text.selectNode(_L0);}.bind(this),0);},cleanup:function(){var _L0=this.element.firstChild;while(_L0){if(!this.isText(_L0)&&!this.isMention(_L0)&&!this.isBreak(_L0)){var _L1=document.createTextNode((DOM.getText(_L0)||''));this.element.replaceChild(_L1,_L0);_L0=_L1;}var _L2=_L0.previousSibling;if(_L2&&this.isText(_L2)&&this.isText(_L0)){_L0.data=_L2.data+_L0.data;this.element.removeChild(_L2);}else _L0=_L0.nextSibling;}this.element.setStyle('height','').setOpacity(1);Text.focusElement(this.element);},getMessage:function(){var _L0=$A(this.element.childNodes).map(function(_L1){if(this.isBreak(_L1))return "\n";var _L2=this.isMention(_L1);if(_L2)return '@['+_L2.id+':'+_L2.text+']';return DOM.getText(_L1);},this);return _L0.join('').replace(/\xa0/g,' ').trim();},setMessage:function(_L0){DOM.setText(this.element,_L0);this.fixBreak();},focusInput:function(){this.element.focus();},setActive:function(_L0){this.active=_L0;if(!_L0)DOM.setText(this.element,DOM.getText(this.element));},enable:function(){this.element.contentEditable=true;return this;},disable:function(){this.element.contentEditable=false;return this;},isBreak:function(_L0){return DOM.isNode(_L0,'br');},isText:function(_L0){return DOM.isNode(_L0,['#text','#whitespace']);},isMention:function(_L0){return DOM.isNode(_L0,'a')&&DataStore.get(_L0,'mention');},fixBreak:document.selection?bagofholding:function(){var _L0=this.element.lastChild;if(!_L0||!this.isBreak(_L0))this.element.appendChild($N('br'));}});var Text=(function(){var _L0;if(window.getSelection){_L0={getRange:function(_L1){_L1=_L1||this.getSelection();return _L1.rangeCount>0?_L1.getRangeAt(0):null;},getSelection:function(){return window.getSelection();},getFocusNode:function(_L1){_L1=_L1||this.getRange();return _L1&&_L1.endContainer;},getFocusValue:function(_L1,_L2){_L1=_L1||this.getRange();_L2=_L2||this.getFocusNode(_L1);return _L2.data;},getFocusOffset:function(_L1,_L2){_L1=_L1||this.getRange();return _L1.endOffset||0;},setFocus:function(_L1,_L2){if(!_L1)return;this.getSelection().collapse(_L1,_L2);},setFocusAfter:function(_L1){var _L2=_L1.parentNode;this.setFocus(_L2,$A(_L2.childNodes).indexOf(_L1)+1);},focusElement:function(_L1){_L1.focus();this.setFocus(_L1,_L1.childNodes.length);},insertBreak:bagofholding,selectNode:function(_L1){if(!_L1)return;var sel=this.getSelection(),_L3=this.getRange(sel);sel.collapse(_L1,0);_L3.selectNode(_L1);sel.addRange(_L3);}};}else if(document.selection)_L0={getRange:function(){return this.getSelection().createRange();},getSelection:function(){return document.selection;},getFocusNode:function(_L1,_L2){if(_L2)return _L2;_L1=_L1||this.getRange();return _L1.parentElement();},getFocusValue:function(_L1,_L2){_L1=_L1||this.getRange();_L2=_L2||this.getFocusNode(_L1);return _L2.innerText;},getFocusOffset:function(_L1,_L2){_L1=_L1||this.getRange();_L2=_L2||this.getFocusNode(_L1);var _L3=_L2,_L4=0;while(_L3==_L2){_L1.moveStart('character',-1);_L3=_L1.parentElement();_L4++;}return _L1.text.length;},setFocus:function(_L1,_L2){var _L3=this.getRange(),_L4=_L3.parentElement(),_L5=0,_L6=[],_L7=_L1.previousSibling;while(_L7){var _L8=_L7.previousSibling;_L6.push(_L4.removeChild(_L7));_L7=_L8;}_L3.moveToElementText(_L4);_L3.collapse();_L3.moveEnd('character',(_L2+_L5));_L3.collapse(false);_L3.select();for(var i=0;i<_L6.length;i++)_L4.insertBefore(_L6[i],_L4.firstChild);},setFocusAfter:function(_L1){var _L2=this.getRange();_L2.moveToElementText(_L1);_L2.moveEnd('character',1);_L2.collapse(false);_L2.select();},focusElement:function(_L1){_L1.focus();this.setFocusAfter(_L1);},insertBreak:function(){var _L1=this.getRange();_L1.pasteHTML('<br/>');_L1.moveEnd('character',1);_L1.collapse();_L1.select();},selectNode:function(_L1){var _L2=this.getRange();_L2.moveToElementText(_L1);_L2.moveStart('character',-1);_L2.moveEnd('character',1);_L2.select();}};return _L0;})();
function UIComposerAttachmentArea(_L0,_L1){this.composer=_L0;this.root=_L1;this.area=_L1.find('div.UIComposer_AttachmentArea_Cache');this.cache={};this.visible=null;this.attachment={};this.dirtyOnReset=false;var _L2=_L1.find('a.UIComposer_AttachmentArea_CloseButton');Event.listen(_L2,'click',function(_L3){Event.kill(_L3);_L0.reset(true);});}UIComposerAttachmentArea.prototype={show:function(_L0,_L1){this.composer.addState(UIComposer.STATE.ATTACHMENT_AREA);this.attachment=_L0;this.dirtyOnReset=false;if(ua.ie()<7)this.area.setStyle('width',this.area.offsetWidth);var _L2=_L0.app_id;if(this.cache[_L2]&&!_L1){this.showAttachment(_L2);}else this.loadAttachment(_L2,_L1);},loadAttachment:function(_L0,_L1){var _L2={app_id:_L0,composer_id:this.composer.id,stream_id:this.composer.targetID,is_inbox:this.composer.isInbox};if(_L1)copy_properties(_L2,{data:_L1});new AsyncRequest().setURI(UIComposerAttachmentArea.ENDPOINT).setData(_L2).setHandler(UIComposerAttachmentArea.handleResponse.bind(this,_L1)).setErrorHandler(this.composer.handleError.bind(this.composer)).setTransportErrorHandler(this.composer.handleError.bind(this.composer)).send();},showAttachment:function(_L0){if(!this.composer.hasState(UIComposer.STATE.ATTACHMENT_AREA))return;this.visible=this.cache[_L0];this.visible.addClass(UIComposerAttachmentArea.CLASS.VISIBLE);this.composer.addState(UIComposer.STATE.ATTACHMENT_LOADED);this.fireAttachmentEvent('load');},createAttachment:function(_L0){var _L1=$N('div',{className:UIComposerAttachmentArea.CLASS.CACHED});this.area.appendChild(_L1).setContent(HTML(_L0.html));return _L1;},setAttachment:function(_L0){if(this.attachment){this.attachment.controller=_L0;_L0.initialize(this.composer,this.cache[this.attachment.app_id],this.attachment.app_id);}return this;},getAttachment:function(){if(this.attachment&&this.attachment.controller)return this.attachment.controller;return null;},getData:function(){if(this.attachment&&this.attachment.controller)return this.attachment.controller.getData();return null;},getEndpoint:function(_L0){if(this.attachment&&this.attachment.controller)return this.attachment.controller.getEndpoint(_L0);return null;},post:function(){if(!this.visible)return;var _L0=this.getData();var _L1=this.getEndpoint(true);if(!_L0||!_L1)return;_L0.composer_id=this.composer.id;this.composer.removeState(UIComposer.STATE.ATTACHMENT_LOADED);new AsyncRequest().setURI(_L1).setData(_L0).setHandler(UIComposerAttachmentArea.handleResponse.bind(this,null)).setErrorHandler(this.composer.handleError.bind(this.composer)).send();},reset:function(){if(!this.visible)return;this.visible.removeClass(UIComposerAttachmentArea.CLASS.VISIBLE);this.visible=null;if(this.dirtyOnReset){var _L0=this.attachment.app_id;this.cache[_L0].remove();this.cache[_L0]=null;}this.fireAttachmentEvent('reset');},fireAttachmentEvent:function(_L0){if(this.attachment&&this.attachment.controller)this.attachment.controller[_L0]();}};copy_properties(UIComposerAttachmentArea,{handleResponse:function(_L0,_L1){var _L2=this.attachment.app_id,_L3=this.cache[_L2],_L4=_L1.getPayload(),_L5=_L1.getError(),_L6=_L1.getErrorIsWarning();if(_L5&&_L6)this.composer.showError(_L1.getErrorSummary(),_L1.getErrorDescription());if(!_L3){this.cache[_L2]=this.createAttachment(_L4);this.dirtyOnReset=!!_L0;}else{_L3.setContent(HTML(_L4.html));this.dirtyOnReset=true;}this.showAttachment(_L2);}});copy_properties(UIComposerAttachmentArea,{CLASS:{CACHED:'UIComposer_Attachment_Cached',VISIBLE:'UIComposer_Attachment_Visible'},ENDPOINT:'/ajax/composer/attachment.php',PARAM_STRUCTURE:'app_data[attachment][params]'});
function UIComposer(_L0,_L1,_L2,_L3){if(!_L0){throw new Error('UIComposer instantiated with no root.');return false;}this.root=_L0;this.id=_L0.id;this.input=_L1;this.user=_L2;var d={};try{d=JSON.decode(window.name);}catch(e){}if(d.pub){_L3.autoload=d.pub;_L3.autoloadData=d.pubdata;window.name='';}this.initialize=this.initialize.bind(this,_L3);this.resetState=this.root.className;this.initializeAttachments(_L3.attachments);this.initializeLocation(_L3.locationActivated);UIComposer.storeInstance(_L0.id,this);onunloadRegister(function(){delete UIComposer.instances[_L0.id];},true);this.usingNewHigh=_L3.usingNewHigh;if(_L3.autoload||(_L3.usingNewHigh&&this.textAreaFocused()))this.ensureInitialized();}UIComposer.prototype={ensureInitialized:function(_L0){if(this.initialized)return;this.initialized=true;this.initialize(_L0);},initialize:function(_L0,_L1){var _L2={contentArea:null,endpoint:'/ajax/updatestatus.php',autoload:null,autoloadData:null,targetID:0,attachments:[],contextData:{},placeholder:null,privacyWidget:null,defaultPrivacy:null,defaultPrivacyFbid:0,privacyOptions:{},maxInputLength:0,mentionsData:null,locationActivated:false,overrideAttachmentEndpoint:false,sourceAppID:null,initialTextareaHeight:36,targetedPrivacyWidget:null};copy_properties(this,copy_properties(_L2,_L0));this.lastLoc=null;this.shouldHide=true;this.submitButton=DOM.scry(this.root,'span.UIComposer_SubmitButton input.UIButton_Text')[0]||null;this.privacyButton=DOM.scry(this.root,'div.UIComposer_PrivacyWidget')[0]||null;this.privacyCallout=DOM.scry(this.root,'div.UIComposer_PrivacyCallout')[0]||null;this.targetedPrivacyButton=DOM.scry(this.root,'div.UIComposer_TargetedPrivacyWidget')[0]||null;this.doMentionsPromptUpdatePref=false;this.doMentionsPromptUpdateOnsubmit=false;this.doMentionsCallout='';this.shownMentionsCallout=false;if(this.privacyWidget){this.defaultPrivacy=this.privacyWidget.getData();this.defaultPrivacyFbid=this.privacyWidget.getSaveAsDefaultCheckboxFbid();}if(_L2.mentionsData){this.initializeMentions(_L2.mentionsData);}else this.initializeTextarea(_L2.maxInputLength,_L2.initialTextareaHeight);this.initializeAutoscrape(_L1);this.initializeEvents();if(_L2.autoload)this.loadAttachment(_L2.autoload,_L2.autoloadData);},initializeAttachments:function(_L0){if(!_L0.length)return;this.apps=_L0.map(function(_L3){return _L3.app_id;});this.attachments=_L0;var _L1=this.root.find('ul.UIComposer_Attachments');var _L2=this.root.find('div.UIComposer_AttachmentArea');this.attachmentList=new UIComposerAttachmentList(this,_L1);this.attachmentArea=new UIComposerAttachmentArea(this,_L2);this.buttonArea=DOM.scry(this.root,'div.UIComposer_ButtonArea')[0];},initializeLocation:function(_L0){this.locationField=DOM.scry(this.root,'div.UIComposer_LocationField')[0]||null;this.locationButton=DOM.scry(this.root,'div.UIComposer_LocationButton')[0]||null;if(this.locationButton){this.locationButton.find('a').listen('click',this.toggleLocSetting.bind(this));if(_L0){this.locationButton.find('.UIActionButton').removeClass('UIButton_Suppressed').addClass('UIButton_Depressed');this.addState(UIComposer.STATE.LOC_ACTIVATED);}}},initializeTextarea:function(_L0,_L1){new TextAreaControl(this.input).setMaxLength(_L0).setOriginalHeight(_L1).setAutogrow(true).onfocus();this.input.onfocus='';},initializeMentions:function(_L0){if(ua.firefox()<3||ua.safariPreWebkit()||ua.opera())return;var _L1=$N('div',{id:this.input.id,className:'Mentions_Input',contentEditable:true},document.createTextNode(this.input.value));CSS.setStyle(_L1,'width',this.input.offsetWidth+'px');DOM.replace(this.input,_L1);this.input=_L1;_L1.focus();var _L2=new typeahead_mentions(_L1,_L0.typeahead);this.getMessage=_L2.getMessage.bind(_L2);this.setMessage=_L2.setMessage.bind(_L2);this.focusInput=_L2.focusInput.bind(_L2);var _L3=this.enable.bind(this);this.enable=function(){_L2.enable();_L3();};var _L4=this.disable.bind(this);this.disable=function(){_L2.disable();_L4();};this.mentions=_L2;if(this.mentions){this.doMentionsPromptUpdatePref=_L0.prompt;this.doMentionsCallout=_L0.callout;}},initializeAutoscrape:function(_L0){var _L1=new UrlDetector(this.input);_L1.subscribe('urlDetected',this.autoScrape.bind(this));_L1.setSuppressDetectionCheck(this.hasState.bind(this,UIComposer.STATE.ATTACHMENT_AREA));if(_L0)_L1.startDetectionInterval();},initializeEvents:function(){addEventBase(this.input,'focus',this.focus.bind(this));Event.listen(this.submitButton,'click',this.post.bind(this));if(this.locationButton){var _L0=this.locationButton.find('a.UIActionButton');Event.listen(_L0,'click',this.toggleLocSetting.bind(this));}if(this.attachmentArea){var _L1=function(){this.shouldHide=false;}.bind(this);Event.listen(this.root,'click',_L1);Event.listen(this.root,'mousedown',_L1);Event.listen(document.body,'click',function(){if(this.shouldHide)this.blur();this.shouldHide=true;}.bind(this));}},focus:function(){this.ensureInitialized(true);if(!this.hasState(UIComposer.STATE.ATTACHMENT_AREA)&&this.hasState(UIComposer.STATE.LOC_ACTIVATED)&&this.locationField)this.populateLoc();if(this.privacyWidget){if(this.privacyOptions.change_default_dialog&&!this.privacyChangedToken)this.privacyChangedToken=this.privacyWidget.subscribe('privacyChanged',function(_L1,_L2){this.showChangeDefaultPrivacyDialog(_L2);}.bind(this));if(this.privacyOptions.callout&&!this.privacyMenuActivatedToken)this.privacyMenuActivatedToken=this.privacyWidget.subscribe('menuActivated',function(_L1,_L2){this.closePrivacyCallout();this.privacyWidget.unsubscribe(this.privacyMenuActivatedToken);delete this.privacyMenuActivatedToken;}.bind(this));}this.showMentionsCallout();var _L0=this.getMessage().trim();if(!_L0||_L0==this.placeholder){this.input.removeClass('DOMControl_placeholder');this.clearMessage();}this.showPrivacyCallout();this.mentionsPromptUpdatePref();Arbiter.inform(UIIntentionalStreamMessage.SET_AUTO_INSERT,{pause:true});if(this.usingNewHigh)this.buttonArea.removeClass('hidden_elem');return this.addState(UIComposer.STATE.INPUT_FOCUSED);},blur:function(){if(this.privacyWidget&&this.privacyWidget.dialogOpen()){if(!this.privacyCloseDialogToken)this.privacyCloseDialogToken=this.privacyWidget.subscribe('closeDialog',function(){this.privacyWidget.unsubscribe(this.privacyCloseDialogToken);delete this.privacyCloseDialogToken;}.bind(this));}else{if(this.attachmentList&&!this.hasState(UIComposer.STATE.ATTACHMENT_AREA)){this.removeState(UIComposer.STATE.INPUT_FOCUSED);if(!this.getMessage())this.clearMessage();if(this.usingNewHigh)this.buttonArea.addClass('hidden_elem');}this.hidePrivacyCallout();this.hideLocField();}if(!this.getMessage().trim()&&!this.hasState(UIComposer.STATE.ATTACHMENT_AREA))this.resetMessage();this.hideMentionsCallout();Arbiter.inform(UIIntentionalStreamMessage.SET_AUTO_INSERT,{pause:false});return this;},autoScrape:function(_L0,url){this.loadAttachment(UIComposer.APP_ID_POSTED,{url:url});},setAttachment:function(_L0){this.attachmentArea.setAttachment(_L0);return this;},getAttachment:function(){return this.attachmentArea.getAttachment();},setSourceAppId:function(_L0){this.sourceAppID=_L0;return this;},getSourceAppId:function(){return this.sourceAppID;},loadAttachment:function(_L0,_L1){this.ensureInitialized();var _L2=this.attachments[this.apps.indexOf(_L0)];if(this.hasState(UIComposer.STATE.ATTACHMENT_AREA))this.reset(true,false,false);if(!_L2){this.input.blur();return this.blur();}this.attachmentList.select(_L2,_L1);this.focus();},showAttachment:function(_L0,_L1){this.focus();this.hideLocWidget();if(_L0.supports_privacy){if(this.privacyWidget){if(_L0.default_privacy)this.privacyWidget.setData(_L0.default_privacy);if(_L0.default_privacy_fbid)this.privacyWidget.setSaveAsDefaultCheckboxFbid(_L0.default_privacy_fbid);}this.showPrivacyWidget();this.showTargetedPrivacyWidget();}else{this.hidePrivacyWidget();this.hideTargetedPrivacyWidget();}this.hidePrivacyCallout();this.hideMentionsCallout();this.attachmentArea.show(_L0,_L1);return this;},reset:function(_L0,_L1,_L2){if(_L0&&this.attachmentArea){this.attachmentList.reset();this.attachmentArea.reset();this.removeState(UIComposer.STATE.ATTACHMENT_AREA);this.removeState(UIComposer.STATE.ATTACHMENT_LOADED);}this.resetSubmitButtonText();this.removeLoc();if(this.privacyWidget){this.privacyWidget.setData(this.defaultPrivacy);this.privacyWidget.setSaveAsDefaultCheckboxFbid(this.defaultPrivacyFbid);}if(this.targetedPrivacyWidget)this.targetedPrivacyWidget.reset();this.showPrivacyWidget();this.showTargetedPrivacyWidget();this.showLocWidget();this.enable();if(_L1)this.resetMessage();if(_L2!==false){this.focusInput();}else this.removeState(UIComposer.STATE.INPUT_FOCUSED);this.shouldHide=true;return this;},addState:function(_L0){this.root.addClass(_L0);return this;},removeState:function(_L0){this.root.removeClass(_L0);return this;},hasState:function(_L0){return this.root.hasClass(_L0);},toggleState:function(_L0){CSS.toggleClass(this.root,_L0);return this;},disable:function(){this.input.disabled=true;return this.addState(UIComposer.STATE.INPUT_DISABLED).disableButton();},enable:function(){this.input.disabled=false;return this.removeState(UIComposer.STATE.INPUT_DISABLED).enableButton();},disableButton:function(){this.disabled=true;CSS.addClass(this.submitButton.parentNode,'UIButton_Disabled');return this;},enableButton:function(){this.disabled=false;CSS.removeClass(this.submitButton.parentNode,'UIButton_Disabled');return this;},getPrivacyData:function(){if(this.privacyWidget)return this.privacyWidget.getData();return null;},getTargetedPrivacyData:function(){if(this.targetedPrivacyWidget)return this.targetedPrivacyWidget.getData();return null;},getData:function(){var _L0=this.getEndpoint();var _L1={},_L2=this.getMessage();if(!this.isValidPost())return null;if(!this.hasState(UIComposer.STATE.ATTACHMENT_AREA)){copy_properties(_L1,this.targetID>0?UIComposer.TARGET_DATA:UIComposer.HOME_DATA);copy_properties(_L1,{status:_L2,target_id:this.targetID,profile_id:this.user,app_id:this.sourceAppID,privacy_data:{}});if(this.lastLoc){this.lastLoc.timestamp=Math.floor(this.lastLoc.timestamp.getTime()/1000);_L1.composer_loc_data=JSON.encode(this.lastLoc);}if(this.attachmentArea&&this.attachmentArea.visible){copy_properties(_L1,this.attachmentArea.getData());if(!_L1.app_id)_L1.app_id=this.attachmentArea.attachment.app_id;}}else{_L1=this.attachmentArea.getData();if(_L1){copy_properties(_L1,{id:this.user,target_id:this.targetID,app_id:this.attachmentArea.attachment.app_id,action:'post',button:'publish_button',comment_text:_L2});if(this.attachmentArea.attachment.supports_privacy)_L1.privacy_data={};}}if(_L1){_L1.composer_id=this.id;if(this.privacyWidget&&_L1.privacy_data)copy_properties(_L1.privacy_data,this.getPrivacyData());if(this.targetedPrivacyWidget){_L1.targeted_privacy_data={};copy_properties(_L1.targeted_privacy_data,this.getTargetedPrivacyData());}if(this.contextData)copy_properties(_L1,this.contextData);}return _L1;},isValidPost:function(){var _L0=this.getMessage();if(_L0==this.placeholder)return false;if(this.endpoint==this.getEndpoint()&&!_L0)return false;return true;},getEndpoint:function(){var _L0;if(this.hasState(UIComposer.STATE.ATTACHMENT_LOADED))_L0=this.attachmentArea.getEndpoint();return _L0||this.endpoint;},post:function(){if(this.disabled||!this.initialized)return false;if(this.privacyOptions.everyone_warning&&this.privacyWidget&&this.privacyWidget.isEveryonePrivacy()){this.showConfirmEveryonePrivacyDialog();return false;}this._post();return false;},_post:function(){var _L0=this.getEndpoint(),_L1=this.getData();if(!_L1)return false;this.disable();if(this.doMentionsCallout=='inmsg')_L1.mentions_suggest=1;if(this.shownMentionsCallout){_L1.shown_mentions_callout=1;if(this.doMentionsCallout)_L1.close_mentions_callout=1;}if(this.doMentionsPromptUpdateOnsubmit){_L1.mentions_composermsg_submit=1;this.doMentionsPromptUpdateOnsubmit=false;}this.hideMentionsCallout();var req=new AsyncRequest().setURI(_L0).setData(_L1).setHandler(bind(this,handle_require_email_conf_response,this.handleResponse.bind(this),null,null)).setErrorHandler(this.handleError.bind(this)).setFinallyHandler(this.enable.bind(this));for(key in this.contextData)req.setContextData(key,this.contextData[key]);req.send();},handleError:function(_L0){var _L1=_L0.getError();var _L2=_L0.getPayload();switch(_L1){case kError_Platform_CallbackValidationFailure:return this.showError(_L2.errorTitle,_L2.errorMessage);case kError_Platform_ApplicationResponseInvalid:return this.showError(_L2.errorTitle,_L2.showDebug?_L2.errorMessage:_tx("Roedd yna wall gyda'r rhaglen. Ceisiwch eto wedyn."));default:this.shouldHide=false;this.reset();return this.showError(_L0.getErrorSummary(),_L0.getErrorDescription());}},handleResponse:function(_L0){var _L1=_L0.getError();var _L2=_L0.getErrorIsWarning();var _L3=_L0.getPayload();if(_L3.mentions_announce&&this.doMentionsCallout=='inmsg'){this.doMentionsCallout='focus';DOM.find(this.root,'div.UIComposer_MentionsCallout .UIComposer_PrivacyCallout_Text').setContent(_L3.mentions_announce);this.showMentionsCallout();}else{this.closeMentionsCallout(true);this.reset(true,true).publish(_L0);if(_L1&&_L2)ErrorDialog.showAsyncError(_L0);}},publish:function(_L0){var _L1=this.contentArea;if(_L1&&_L1.addContent){var _L2=_L0,_L3,_L4;if(_L0.getPayload){var _L5=_L0.getPayload();_L3=_L5.status;_L2=_L5.markup;if(_L5.payload_is_content)_L4=_L5;}_L4=_L4||HTML(_L2).getRootNode();var _L6=500;_L1.addContent(_L4,_L6);if(_L1.setStatus&&_L3)setTimeout(function(){_L1.setStatus(_L3);},_L6);}if(this.privacyWidget)this.privacyWidget.reset();if(this.targetedPrivacyWidget)this.targetedPrivacyWidget.reset();return this;},populateLoc:function(){var _L0=false;var _L1=function(pos){if(!this.hasState(UIComposer.STATE.LOC_ACTIVATED)||!this.hasState(UIComposer.STATE.INPUT_FOCUSED)||this.hasState(UIComposer.STATE.ATTACHMENT_AREA))return;if(this.lastLoc&&_L0!==false&&pos.coords.accuracy>=this.lastLoc.coords.accuracy)return;_L0=true;var _L6=pos.desc.label||pos.desc.street||pos.desc.region;if(!_L6)return;this.locationField.setContent(_tx("near {place}",{place:_L6}));this.lastLoc=pos;if(!shown(this.locationField))animation(this.locationField).to('height','auto').from('height',0).to('opacity',1).from('opacity',0).show().duration(100).ease(animation.ease.end).go();};var _L2=0;var _L3=function(_L5){if(++_L2>=2)return this.removeLoc();};var _L4=function(){navigator.geolocation.getCurrentPosition(_L1.bind(this),_L3.bind(this),{maximumAge:1000*60*60,enableHighAccuracy:false});navigator.geolocation.getCurrentPosition(_L1.bind(this),_L3.bind(this),{maximumAge:1000*60*10,enableHighAccuracy:true});};Bootloader.loadComponents(['geolocation'],_L4.bind(this));},removeLoc:function(){if(this.locationField){this.locationField.empty();this.hideLocField();this.shouldHide=true;}this.lastLoc=null;},toggleLocSetting:function(){this.toggleState(UIComposer.STATE.LOC_ACTIVATED);this.locationButton.find('.UIActionButton').toggleClass('UIButton_Suppressed').toggleClass('UIButton_Depressed');var _L0=this.hasState(UIComposer.STATE.LOC_ACTIVATED);new AsyncRequest('/ajax/geo/setting.php').setData({collect:_L0}).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();if(_L0){this.input.focus();this.populateLoc();}else this.removeLoc();return false;},showLocWidget:function(){show(this.locationButton);},hideLocWidget:function(){hide(this.locationButton);this.removeLoc();},hideLocField:function(){hide(this.locationField);},showPrivacyWidget:function(){show(this.privacyButton);},hidePrivacyWidget:function(){hide(this.privacyButton);},showTargetedPrivacyWidget:function(){show(this.targetedPrivacyButton);},hideTargetedPrivacyWidget:function(){hide(this.targetedPrivacyButton);},showPrivacyCallout:function(){this.root.scry('div.UIComposer_PrivacyCallout').map(show);},hidePrivacyCallout:function(){this.root.scry('div.UIComposer_PrivacyCallout').map(hide);},closePrivacyCallout:function(){this.hidePrivacyCallout();this.savePrivacyData('close','callout',function(){this.root.scry('div.UIComposer_PrivacyCallout').map(DOM.remove);}.bind(this));},showMentionsCallout:function(){if(this.doMentionsCallout!='focus'||this.hasState(UIComposer.STATE.ATTACHMENT_AREA))return;if(this.attachmentList)this.attachmentList.hide();this.shownMentionsCallout=true;this.root.scry('div.UIComposer_MentionsCallout').map(show);},hideMentionsCallout:function(){if(this.attachmentList&&!this.hasState(UIComposer.STATE.ATTACHMENT_AREA))this.attachmentList.reset();this.root.scry('div.UIComposer_MentionsCallout').map(hide);},closeMentionsCallout:function(_L0){this.hideMentionsCallout();if(this.shownMentionsCallout&&this.doMentionsCallout){this.doMentionsCallout='';if(_L0)return;new AsyncRequest().setURI('/ajax/mentions_ue.php').setData({type:'callout'}).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();}},mentionsPromptUpdatePref:function(){if(this.doMentionsPromptUpdatePref){new AsyncRequest().setURI("/ajax/mentions_ue.php").setData({type:'prompt'}).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();this.doMentionsPromptUpdatePref=false;this.doMentionsPromptUpdateOnsubmit=true;}},savePrivacyData:function(_L0,_L1,_L2){_L1=_L1||_L0;_L2=_L2||bagofholding;var _L3={};_L3[_L0]=true;new AsyncRequest().setData(_L3).setURI('/ajax/privacy/save_composer_data.php').setHandler(function(_L4){var _L5=_L4.getPayload();this.privacyOptions[_L1]=_L5[_L1];_L2();}.bind(this)).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();},showChangeDefaultPrivacyDialog:function(_L0){var _L1=function(){this.privacyWidget.unsubscribe(this.privacyChangedToken);delete this.privacyChangedToken;}.bind(this);new Dialog().setAsync(new AsyncRequest().setURI('/ajax/privacy/change_default_dialog.php').setData({privacy_data:_L0})).setHandler(this.savePrivacyData.bind(this,'seen_changed_default','change_default_dialog',_L1)).show();},showConfirmEveryonePrivacyDialog:function(){new Dialog().setAsync(new AsyncRequest().setURI('/ajax/privacy/confirm_everyone_dialog.php')).setHandler(this.savePrivacyData.bind(this,'seen_everyone','everyone_warning',this._post.bind(this))).show();},getContextData:function(){return this.contextData;},resetMessage:function(){this.input.addClass('DOMControl_placeholder');this.input.setStyle('height','');this.setMessage(this.placeholder);},clearMessage:function(){this.setMessage('');},getMessage:function(){return this.input.value.trim();},setMessage:function(_L0){this.input.value=_L0;},showError:function(_L0,_L1){new ErrorDialog().setTitle(_L0).setBody(_L1||_tx("Roedd yna wall gyda'r rhaglen. Ceisiwch eto wedyn.")).setButtons([Dialog.OK]).show();},resetSubmitButtonText:function(){if(this.orig_button_text)this.setSubmitButtonText(this.orig_button_text);},setSubmitButtonText:function(_L0){if(_L0)if(this.submitButton&&this.submitButton.value){this.orig_button_text=this.orig_button_text||this.submitButton.value;this.submitButton.value=_L0;}},focusInput:function(){this.input.select();this.input.focus();},textAreaFocused:function(){var _L0=DOM.scry(this.root,'textarea.UIComposer_TextArea')[0];return !_L0.hasClass('DOMControl_placeholder');}};copy_properties(UIComposer,{instances:{},getInstance:function(id){return this.instances[id];},storeInstance:function(id,_L1){this.instances[id]=_L1;},focusInstance:function(id){var _L1=this.instances;var _L2=_L1[id];if(!_L2)return;onloadRegister(function(){_L1[id].focus();setTimeout(function(){_L1[id].input.focus();},0);});},animation:function(_L0,_L1){return animation(_L0).ondone(_L1||bagofholding).ease(animation.ease.end).duration(200);}});copy_properties(UIComposer,{DIALOG_WIDTH:560,DIALOG_WIDTH_PIC:620,APP_ID_POSTED:2309869772,HOME_DATA:{action:'HOME_UPDATE',home_tab_id:1,profile_id:null,status:null,target_id:null},TARGET_DATA:{action:'PROFILE_UPDATE',profile_id:null,status:null,target_id:null},STATE:{PIC_NONE:'UIComposer_STATE_PIC_NONE',PIC_INSIDE:'UIComposer_STATE_PIC_INSIDE',PIC_OUTSIDE:'UIComposer_STATE_PIC_OUTSIDE',LOC_ACTIVATED:'UIComposer_STATE_LOC_ACTIVATED',INPUT_FOCUSED:'UIComposer_STATE_INPUT_FOCUSED',INPUT_DISABLED:'UIComposer_STATE_INPUT_DISABLED',ATTACHMENT_AREA:'UIComposer_STATE_ATTACHMENT_AREA',ATTACHMENT_LOADED:'UIComposer_STATE_ATTACHMENT_LOADED'}});
function UIComposerAttachmentList(_L0,_L1){this.composer=_L0;this.root=_L1;this.title=_L0.root.find('div.UIComposer_AttachmentTitle');var _L2=_L0.attachments,_L3=$A(DOM.scry(_L1,'li.UIComposer_Attachment a')),_L4=_L3.length;var _L5=function(_L7,_L8){var _L9=_L2[_L8];_L9.index=_L8;Event.listen(_L7,'click',this.select.bind(this,_L9,null));}.bind(this);var _L6=function(_L7,_L8){var _L9=$N('a',{href:"#",className:'UIComposer_MoreItem'},[$N('span',{className:'UIComposer_MoreIcon',style:{backgroundImage:'url('+_L7.menu_icon+')'}}),HTML(_L7.caption)]);_L5(_L9,_L8+_L4);return _L9;};_L3.each(_L5);if(_L2.length>_L4){this.menu=new UIActionMenu().setSuppressButton(true).setSuppressText(true).setTooltip(_tx("Mwy")).setContentCallback(function(){return $N('div',_L2.slice(_L4).map(_L6));});_L1.appendChild($N('li',{className:'UIComposer_More'},this.menu.root));}}UIComposerAttachmentList.prototype={select:function(_L0,_L1){this.title.setContent(_L0.caption);this.title.setStyle('backgroundImage','url('+_L0.icon+')');this.composer.showAttachment(_L0,_L1);if(this.menu)this.menu.hideMenu();hide(this.root);return false;},hide:function(){hide(this.root);},reset:function(){show(this.root);}};
function UserActivity(){}copy_properties(UserActivity,{_initialized:false,_listeners:[],initialize:function(){var _L0=function(_L2){Arbiter.inform(Arbiter.USER_ACTIVITY,_L2);};UserActivity._listeners.push(Event.listen(document.body,'mouseover',_L0));var _L1=window;if(ua.ie())_L1=document.body;UserActivity._listeners.push(Event.listen(_L1,'keydown',_L0));UserActivity._listeners.push(Event.listen(document.body,'click',_L0));UserActivity._initialized=true;},subscribe:function(_L0){if(!UserActivity._initialized)UserActivity.initialize();return Arbiter.subscribe(Arbiter.USER_ACTIVITY,_L0,Arbiter.SUBSCRIBE_NEW);},unsubscribe:function(_L0){Arbiter.unsubscribe(_L0);}});onloadRegister(UserActivity.initialize);
function OnVisible(_L0,_L1){this.targetY=Vector2.getElementPosition(_L0).y;var _L2=function(){var y=Vector2.getScrollPosition().y+Vector2.getViewportDimensions().y;if(y>this.targetY){this.remove();_L1();}return true;}.bind(this);if(DOMScroll.usingScrollWrapper()){var _L3=DOMScroll.getScrollRoot();}else var _L3=window;this.scrollListener=Event.listen(_L3,'scroll',_L2);this.resizeListener=Event.listen(window,'resize',_L2);_L2();onunloadRegister(this.remove.bind(this));}copy_properties(OnVisible.prototype,{remove:function(){if(this.scrollListener){this.scrollListener.remove();this.resizeListener.remove();this.scrollListener=this.resizeListener=null;}}});
function RecentActivityEditor(){RecentActivityEditor.instance=this;copy_properties(this,{dialog:null,showingFriendSelector:false});}copy_properties(RecentActivityEditor,{show:function(){if(RecentActivityEditor.instance)return false;return new RecentActivityEditor().showDialog();},verifyPositiveInteger:function(_L0){_L0=_L0||ge('recent_activity_settings_input_num_friends');if(!_L0)return true;var _L1=_L0.value.trim();var _L2=_L1.replace(/[^0-9]/g,'');var _L3=$('recent_activity_settings_warning');if(_L1!=_L2||_L1<=0){show(_L3);return false;}hide(_L3);return true;}});copy_properties(RecentActivityEditor.prototype,{showDialog:function(){var _L0=new AsyncRequest().setMethod('POST').setReadOnly(true).setURI('/ajax/feed/recent_activity/settings_dialog.php').setData(this.getFormData());if(!this.dialog)this.dialog=new Dialog().setHandler(this.handleResponse.bind(this)).setCloseHandler(function(){if(RecentActivityEditor.instance)delete RecentActivityEditor.instance;});this.dialog.setAsync(_L0).show();this.showingFriendSelector=false;return false;},handleResponse:function(_L0){if(_L0==Dialog.SAVE){if(!RecentActivityEditor.verifyPositiveInteger())return false;this.dialog.setLoadingText(_tx("Saving...")).setAsync(new AsyncRequest().setURI('/ajax/feed/recent_activity/settings_save.php').setData(this.getFormData()).setHandler(function(){window.location.reload();}));return false;}},showFriendSelectorDialog:function(){if(!RecentActivityEditor.verifyPositiveInteger())return false;this.dialog.setAsync(new AsyncRequest().setMethod('POST').setReadOnly(true).setURI('/ajax/feed/recent_activity/friend_selector_dialog.php').setData(this.getFormData()));this.showingFriendSelector=true;return false;},getFormData:function(){var _L0={};if(this.dialog){_L0=this.dialog.getFormData();if(this.showingFriendSelector)_L0.always_show=window.fs.get_selected();}return _L0;}});
var NewHigh={reset:function(){this.initialized=false;},ensureInitialized:function(){if(this.initialized)return;this.button=DOM.scry(document.body,'a.stream_header_button')[0];this.composer=DOM.scry(document.body,'div.UIComposer')[0];this.buttonArea=DOM.scry(this.composer,'div.UIComposer_ButtonArea')[0];this.initialized=true;},showComposer:function(_L0){this.ensureInitialized();if(this.composer){this.composer.removeClass('hidden_elem');UIComposer.focusInstance(this.composer.id);var _L1=UIComposer.getInstance(this.composer.id);_L1&&_L1.loadAttachment(_L0);}this.button&&this.button.addClass('hidden_elem');},hideComposer:function(_L0){this.ensureInitialized();if(this.composer){var _L1=UIComposer.getInstance(this.composer.id);if(!_L0){_L1&&_L1.initialized&&_L1.blur();this.composer.addClass('hidden_elem');this.button&&this.button.removeClass('hidden_elem');}else{_L1&&_L1.initialized&&_L1.loadAttachment(0);this.composer.removeClass('hidden_elem');this.buttonArea&&this.buttonArea.addClass('hidden_elem');}}}};
function UIIntentionalStream(_L0,_L1,_L2,_L3,_L4,_L5,_L6,_L7,_L8,_L9,_La,_Lb,_Lc,_Ld){if(!_L0)throw new Error('UIIntentionalStream instantiated with no root.');copy_properties(this,{id:_L0.id,root:_L0,instanceName:_L1,newest:_L2,oldest:_L3,firstLoadIDs:_Ld,hiddenCount:_L4,hiddenIDCount:_L5,shouldShowHidden:false,storyCount:_L6,hasAdditionalStories:_L7,defaultFilter:_L8,currentFilterKey:null,sourceType:_L9,hlGroup:_La,stickyFilter:_Lb,streamStoryCount:_Lc,isAutoRefreshing:false,hasPendingRefresh:false,storyInterval:null,lastRefresh:new Date().getTime(),presenceCheckCounter:0,ignoreQueueTurningActive:false,storyQueue:[],storyQueueCount:0,storyQueueDiv:_L0.find('div.UIIntentionalStream_StoryQueue'),showNewStories:_L0.find('div.UIIntentionalStream_ShowNewStories'),showNewStoriesMsg:_L0.find('a.UIIntentionalStream_ShowNewStories_Msg'),showNewStoriesTxt:_L0.find('span.UIIntentionalStream_ShowNewStories_Txt'),showNewStoriesCount:_L0.find('strong.UIIntentionalStream_ShowNewStories_Count'),streamHeader:DOM.scry(document.body,'div.UIIntentionalStream_Top')[0],forceFilterKey:false,pageloadTime:new Date().getTime(),heavyRefreshCount:0,pushRefreshCount:0,pollRefreshCount:0,scrollLoadIsDone:false,error:DOM.scry(_L0,'div.UIIntentionalStream_Error')[0],pager:_L0.find('div.UIShowMore_Pager'),hiddenInfo:_L0.find('div.UIIntentionalStream_HiddenInfo'),streamContent:_L0.find('div.UIIntentionalStream_Content'),requestNum:0,forceRefresh:false,pauseAutoInsert:false});this.setUpHighlightsStreamHeader();if(this.streamStoryCount>0){this.storyQueueCount=this.streamStoryCount;this.showLiveFeedCount();}this.setAutoRefreshConfig({});onunloadRegister(this.unload.bind(this));this.userActivity();this.updatePager();CSS.removeClass(this.pager,'hidden_elem');this.uaToken=UserActivity.subscribe(this.userActivity.bind(this));if(!UIIntentionalStream.instances)UIIntentionalStream.instances={};UIIntentionalStream.instances[_L1]=this;UIIntentionalStream.instance=this;this.setupAutoPageRefresh();this.setupAutoInsert();}UIIntentionalStream.prototype.unload=function(){if(this.logDetail&&this.allowAutoRefresh){var _L0=new Date().getTime()-this.pageloadTime;scribe_log('nile_refresh_detail','unload_stat '+_L0+' '+this.heavyRefreshCount+' '+this.pushRefreshCount+' '+this.pollRefreshCount);}this.enableAutoRefresh(false);this.cleanupRefreshInterval();UIIntentionalStream.instance=null;UIIntentionalStream.instances[this.instanceName]=null;UserActivity.unsubscribe(this.uaToken);this.clearScrollLoader();};UIIntentionalStream.getInstance=function(_L0){return UIIntentionalStream.instances[_L0];};UIIntentionalStream.handleNewStoryMessage=function(_L0,_L1){var _L2=UIIntentionalStream.instance;if(_L2&&!_L2.queueIsFull()){_L2.pushRefreshCount++;_L2.updateStream();}};UIIntentionalStream.callOnInstance=function(_L0){return function(){if(UIIntentionalStream.instance){var fn=UIIntentionalStream.instance[_L0];return fn.apply(UIIntentionalStream.instance,arguments);}else return null;};};UIIntentionalStream.prototype.presenceStreamCheck=function(_L0,_L1,_L2){if(!this.allowAutoRefresh||!this.presenceLoopPerPoll)return false;if(!presenceNotifications.requiresUpdate(_L0,_L1,_L2))return false;if(!this.needsRefresh())return false;++this.presenceCheckCounter;if(this.presenceCheckCounter>=this.presenceLoopPerPoll){var _L3=this.getCurrentParams();_L3.newest=this.newest;_L3.last_refresh=this.getMSSinceLastRefresh();this.lastPresenceRequestNum=++this.requestNum;_L1['stream_query']=_L3;this.presenceCheckCounter=0;return true;}return false;};UIIntentionalStream.prototype._getUpdateInsertType=function(){if(this.isDarkRefresh){return UIIntentionalStream.REFRESH_DARK;}else if(this.hlGroup!=UIIntentionalStream.HIGHLIGHTS_CONTROL&&!this.isOnNewHighlights()){return UIIntentionalStream.REFRESH_PREPEND;}else if(this.queueNewStories){return UIIntentionalStream.REFRESH_QUEUE;}else return UIIntentionalStream.REFRESH_PREPEND;};UIIntentionalStream.prototype.presenceStreamResponse=function(_L0,_L1){this.lastRefresh=new Date().getTime();this.heavyRefreshCount++;this.handleResponsePayload(this.lastPresenceRequestNum,this._getUpdateInsertType(),_L0);this.lastPresenceRequestNum=0;};UIIntentionalStream.prototype.setStoryInterval=function(_L0){this.storyInterval=_L0;return this;};UIIntentionalStream.prototype.setAutoRefreshConfig=function(_L0){_L0=_L0||{};var _L1=24*60*60*1000;this.allowAutoRefresh=coalesce(_L0.allow_auto_refresh,false);this.inactiveThreshold=coalesce(_L0.inactive_threshold,0);this.activeRefreshTime=coalesce(_L0.fast_refresh_rate,_L1);this.inactiveRefreshTime=coalesce(_L0.slow_refresh_rate,_L1);this.allowPolling=coalesce(_L0.allow_polling,false);this.refreshFactor=coalesce(_L0.refresh_factor,10);this.queueNewStories=coalesce(_L0.queue_new_stories,true);this.isDarkRefresh=coalesce(_L0.dark,false);this.presenceLoopPerPoll=coalesce(_L0.presence_loop_per_poll,0);this.maxQueueSize=coalesce(_L0.max_queue_size,0);this.minRefreshInterval=coalesce(_L0.min_refresh_interval,60*1000);this.logDetail=coalesce(_L0.log_detail,false);this.ignoreQueueTurningActive=coalesce(_L0.ignore_queue_turning_active,false);return this;};UIIntentionalStream.prototype.queueIsFull=function(){return (this.maxQueueSize&&this.storyQueueCount>=this.maxQueueSize);};UIIntentionalStream.prototype.shouldAutoRefresh=function(){return this.isAutoRefreshing&&this.allowAutoRefresh;};UIIntentionalStream.prototype.clearPendingHighlights=function(){if(this.hlGroup!=UIIntentionalStream.HIGHLIGHTS_CONTROL&&this.isOnNewHighlights()&&(this.getMSSinceLastActivity()>UIIntentionalStream.HIGHLIGHTS_REFRESH_INACTIVE_THRESHOLD))new AsyncSignal('/ajax/feed/save_view_state.php').send();};UIIntentionalStream.prototype.userActivity=function(){this.clearPendingHighlights();var _L0=this.isInactive();this.lastActivity=(new Date().getTime());if(_L0&&this.allowAutoRefresh&&this.needsRefresh(true)){this.updateStream();this.schedulePoll(this.getRefreshInterval());}return true;};UIIntentionalStream.prototype.getMSSinceLastActivity=function(){return (new Date().getTime())-this.lastActivity;};UIIntentionalStream.prototype.getMSSinceLastRefresh=function(){return (new Date().getTime())-this.lastRefresh;};UIIntentionalStream.prototype.isInactive=function(){return this.getMSSinceLastActivity()>this.inactiveThreshold;};UIIntentionalStream.prototype.getRefreshInterval=function(){if(this.isInactive()){return this.inactiveRefreshTime;}else if(this.storyInterval!=null){var _L0=this.storyInterval*this.refreshFactor;return Math.max(_L0,this.activeRefreshTime);}else return this.activeRefreshTime;};UIIntentionalStream.prototype.enableAutoRefresh=function(_L0,_L1){this.isAutoRefreshing=_L0;if(_L0){var _L2=_L1?0:this.getRefreshInterval();this.schedulePoll(_L2);}else this.cancelUpdate();};UIIntentionalStream.prototype.cancelUpdate=function(){if(this.updateTask){clearTimeout(this.updateTask);this.updateTask=null;}};UIIntentionalStream.prototype.schedulePoll=function(_L0){this.cancelUpdate();if(this.allowPolling)this.updateTask=setTimeout(this.runUpdatePoll.bind(this),_L0);};UIIntentionalStream.prototype.needsRefresh=function(_L0){return !(this.hasPendingRefresh||(!(_L0&&this.ignoreQueueTurningActive)&&this.queueIsFull())||this.getMSSinceLastRefresh()<this.minRefreshInterval);};UIIntentionalStream.prototype.runUpdatePoll=function(){this.updateTask=null;if(!this.shouldAutoRefresh())return;if(this.needsRefresh()){this.pollRefreshCount++;this.updateStream();}this.schedulePoll(this.getRefreshInterval());};UIIntentionalStream.prototype.updateStream=function(_L0){if(!this.allowAutoRefresh||this.isAutoRefreshPaused())return;this.loadNewer({showLoader:false,ignoreSelf:true,flushOnComplete:_L0,insertType:this._getUpdateInsertType()});};UIIntentionalStream.prototype.clearScrollLoader=function(){if(this.currentScrollListener){this.currentScrollListener.remove();this.currentScrollListener=null;}this.scrollLoadIsDone=true;};UIIntentionalStream.prototype.loadMoreOnScroll=function(_L0,_L1,_L2){if(this.scrollLoadIsDone)return;var _L3=function(){this.clearScrollLoader();this.loadOlder({delayLoadCount:_L1,firstLoadIDs:this.firstLoadIDs,showLoader:false,queryTime:_L2});}.bind(this);if(ge(_L0)){this.currentScrollListener=new OnVisible($(_L0),_L3);}else this.scroll_handler();};UIIntentionalStream.prototype.updatePageCache=function(){this.loadNewer({bundleAsync:true,showLoader:false,ignoreReqNum:true});};UIIntentionalStream.prototype.getID=function(){return this.id;};UIIntentionalStream.prototype.showPositioned=function(_L0,_L1,_L2){if(_L1==UIIntentionalStream.REFRESH_APPEND){this.root.appendContent(_L0);}else if(_L1==UIIntentionalStream.REFRESH_PREPEND){this.root.prependContent(_L0);}else if(_L1==UIIntentionalStream.REFRESH_EXPAND)DOM.insertAfter($(_L2.expandStoryID),_L0);_L0.setStyle('display','block');if(_L0.src)_L0.src=_L0.src;};UIIntentionalStream.prototype.showHiddenStories=function(){this.shouldShowHidden=true;var _L0=this.getCurrentParams();_L0.max_stories=this.storyCount+this.hiddenCount;_L0.show_hidden=true;this.refresh(UIIntentionalStream.REFRESH_TRANSITION,_L0);DOMScroll.scrollTo($('home_stream'),false);return false;};UIIntentionalStream.prototype.showHiddenPeople=function(_L0){if(_L0==undefined)_L0=this.getCurrentFilterKey();var _L1=function(){var _L2=this.getCurrentParams();this.refresh(UIIntentionalStream.REFRESH_TRANSITION,_L2);DOMScroll.scrollTo($('home_stream'),false);}.bind(this);NewsFeedEditor.show(_L0,_L1);return false;};UIIntentionalStream.prototype.getCurrentFilterKey=function(){if(this.currentFilterKey)return this.currentFilterKey;var _L0=this.getCurrentParams();if(_L0&&_L0.filter){if(this.hlGroup!=UIIntentionalStream.HIGHLIGHTS_CONTROL&&this.stickyFilter&&_L0.filter==UIIntentionalStream.FEED_FILTER_KEY_NEWS_FEED)this.currentFilterKey=this.stickyFilter;this.currentFilterKey=_L0.filter;}else if(this.defaultFilter)this.currentFilterKey=this.defaultFilter;return this.currentFilterKey;};UIIntentionalStream.prototype.loadOlder=function(_L0){_L0=_L0||{};if(!this.oldest)return;var _L1=this.getCurrentParams();_L1.oldest=this.oldest;if(this.shouldShowHidden)_L1.show_hidden=true;if(_L0.delayLoadCount){_L1.delay_load_count=_L0.delayLoadCount;}else this.logFeedTrackingEvent(ft.NF_EVENT_SEE_MORE,'page');if(_L0.firstLoadIDs)_L1.first_load_ids=_L0.firstLoadIDs;_L1.query_time=_L0.queryTime;this.refresh(UIIntentionalStream.REFRESH_APPEND,_L1,_L0);return this;};UIIntentionalStream.prototype.loadNewer=function(_L0){if(!this.newest)return;_L0=_L0||{};var _L1=this.getCurrentParams();_L1.newest=this.newest;if(_L0.ignoreSelf)_L1.ignore_self=true;_L1.load_newer=true;var _L2=coalesce(_L0.insertType,UIIntentionalStream.REFRESH_PREPEND);this.lastRefresh=new Date().getTime();this.refresh(_L2,_L1,_L0);return this;};UIIntentionalStream.prototype.getCurrentParams=function(){var _L0={};var _L1=URI.getRequestURI(true,true).getQueryData();if(_L1.sk)_L1.filter=_L1.sk;var _L2=this.getValidParams();if(_L2){_L2.forEach(function(i){_L0[i]=_L1[i];});}else _L0=_L1;_L0.hidden_count=this.hiddenCount||0;return _L0;};UIIntentionalStream.prototype.setHomeFilter=function(_L0){this._homeFilter=_L0;};UIIntentionalStream.prototype.setHomeFilterLoading=function(_L0){if(this._homeFilter)this._homeFilter.setLoading(_L0);};UIIntentionalStream.prototype.refresh=function(_L0,_L1,_L2){this.lastRefresh=new Date().getTime();if(this.forceFilterKey){_L1.force_filter_key=true;this.forceFilterKey=false;}if(this.hlGroup==UIIntentionalStream.HIGHLIGHTS_STICKY&&_L1.filter==UIIntentionalStream.FEED_FILTER_KEY_NEWS_FEED&&this.stickyFilter)_L1.filter=this.stickyFilter;this.currentFilterKey=_L1.filter;_L2=_L2||{};var _L3=++this.requestNum;var _L4=coalesce(_L2.bundleAsync,false);var _L5=coalesce(_L2.showLoader,true);var _L6=this.instanceName;var _L7=function(_Lc){UIIntentionalStream.getInstance(_L6).handleResponse(_L3,_L0,_Lc,_L2);};var _L8=function(_Lc){UIIntentionalStream.getInstance(_L6).handleError(_L3,_L0,_Lc,_L2);};var _L9=function(_Lc){UIIntentionalStream.getInstance(_L6).handleFinally(_L0,_L1.filter,_Lc);};if(!(_L1.request_type=_L0))_L1.request_type='none';if(_L1.filter){_L2.show_hidden=_L1.show_hidden?_L1.show_hidden:false;}else _L2.show_hidden=this.shouldShowHidden;var _La=true;if(_L1.newest)_La=false;this.hasPendingRefresh=true;var _Lb;if(_L0==UIIntentionalStream.REFRESH_APPEND&&_L5)_Lb=this.pager;new AsyncRequest().setURI(this.getEndpoint()).setReadOnly(true).setOption('retries',0).setMethod(this.getRefreshMethod()).setData(_L1).setOption('bundle',_L4).setReplayable(_La).setHandler(_L7).setStatusElement(_Lb).setErrorHandler(_L8).setTransportErrorHandler(_L8).setFinallyHandler(_L9).send();if(_L0==UIIntentionalStream.REFRESH_TRANSITION){this.storyCount=0;this.hasAdditionalStories=true;hide(this.pager);this.clearQueue();this.clearScrollLoader();this.oldest=this.newest=null;}if(_L5)this.setHomeFilterLoading(true);};UIIntentionalStream.prototype.addContent=function(_L0,_L1){this.addContentPrepend(_L0,_L1);};UIIntentionalStream.prototype.addContentPrepend=function(_L0,_L1){if(_L0.length){$A(_L0).reverse().forEach(function(i){this.addContentPrepend(i,_L1);}.bind(this));return;}CSS.setStyle(_L0,'overflow','hidden');CSS.setStyle(_L0,'height','0px');CSS.setOpacity(_L0,'0');this.streamContent.prependContent(_L0);var _L2=animation(_L0).to('height','auto').to('opacity','1').duration(UIIntentionalStream.ANIMATION_DURATION).ondone(function(){CSS.setStyle(_L0,'overflow','');});_L1?setTimeout(_L2.go.bind(_L2),_L1):_L2.go();};UIIntentionalStream.prototype.addContentAppend=function(_L0){this.streamContent.appendContent(_L0);};UIIntentionalStream.prototype.unfollow=function(_L0){var _L1={value:_L0.id,action:'unfollow',filter_key:this.getCurrentFilterKey()};var _L2=function(){var _L8=UIIntentionalStream.forEachStory(_L0.id,hide);this.hiddenCount+=_L8;this.hiddenIDCount++;this.updatePager();}.bind(this);new AsyncRequest().setURI('/ajax/feed/filter_action.php').setData(_L1).setReplayable(true).setHandler(_L2).send();var _L3=$(_L0.storyID);var _L4=$N('div',{className:'unfollow_message'});var _L5=$N('a',{className:'unfollow_undo','href':'#'},HTML(_tx("Dad-wneud")));var _L6=$N('a',{onclick:this.showHiddenPeople.shield(this)},HTML(_tx("Golygu Dewisiadau")));_L5.listen('click',this.undoUnfollow.bind(this,_L0,_L4));var _L7;if(!_L0.isApp){_L7=_tx("<strong>{name} has been hidden from your News Feed.<\/strong><br>In the future, you won't see posts from {first_name}.  ",{'name':_L0.name,'first_name':_L0.firstName});}else _L7=_tx("<strong>{application} has been hidden from your News Feed.<\/strong><br>In the future, you won't see posts from {application}.  ",{'application':_L0.name});msg_content=[_L5,HTML(_L7),' (',_L6,')'];_L4.setContent($N('p',msg_content));hide(_L4);DOM.insertBefore(_L4,_L3);var _L8=UIIntentionalStream.forEachStory(_L0.id,hide);CSS.setOpacity(_L4,'0');show(_L4);if(_L8>1)DOMScroll.scrollTo(_L4,false,true);animation(_L4).to('opacity','1').duration(UIIntentionalStream.ANIMATION_DURATION).ondone(function(){setTimeout(function(){animation(_L4).to('opacity','0').checkpoint().ease(animation.ease.both).to('height','0').to('padding','0').blind().duration(UIIntentionalStream.ANIMATION_DURATION).ondone(function(){if(_L4.parentNode)_L4.remove();}).go();},10*1000);}).go();return false;};UIIntentionalStream.forEachStory=function(id,fn){var _L2=UIIntentionalStream.getStoriesByAssoc(id);_L2.forEach(fn);return _L2.length;};UIIntentionalStream.prototype.undoUnfollow=function(_L0,_L1){var _L2={value:_L0.id,action:'undo_unfollow',filter_key:this.getCurrentFilterKey()};var _L3=function(){var _L4=UIIntentionalStream.forEachStory(_L0.id,show);this.hiddenCount-=_L4;this.hiddenIDCount--;this.updatePager();}.bind(this);new AsyncRequest().setURI('/ajax/feed/filter_action.php').setData(_L2).setReplayable(true).setHandler(_L3).send();var _L4=UIIntentionalStream.forEachStory(_L0.id,show);if(_L4>1)DOMScroll.scrollTo(_L1,false,true);_L1.remove();return false;};UIIntentionalStream.prototype.updatePager=function(){var _L0='';if(this.hiddenIDCount>0){var _L1=$N('a',{href:'#'},_tx("Golygu Dewisiadau"));var _L2=function(){if(this.isOnNewsFeed()&&this.hlGroup!=UIIntentionalStream.HIGHLIGHTS_CONTROL){return RecentActivityEditor.show();}else return this.showHiddenPeople();}.bind(this);Event.listen(_L1,'click',_L2);_L0=[_L1];}if(!this.storyCount||!this.hasAdditionalStories){CSS.addClass(this.pager,'UIShowMore_NoMore');if(this.hiddenIDCount){show(this.pager);}else hide(this.pager);}else{CSS.removeClass(this.pager,'UIShowMore_NoMore');show(this.pager);}DOM.setContent(this.hiddenInfo,_L0);};UIIntentionalStream.getStoriesByAssoc=function(_L0){return DOM.scry(UIIntentionalStream.instance.root,'div.aid_'+_L0);};UIIntentionalStream.prototype.handleResponse=function(_L0,_L1,_L2,_L3){var _L4=_L2.isReplay()||_L3.ignoreReqNum;return this.handleResponsePayload(_L0,_L1,_L2.getPayload(),_L4,_L3);};UIIntentionalStream.prototype.handleDuplicateStories=function(_L0){var _L1=[];for(var i=0;i<_L0.length;i++){var _L3=_L0[i];var _L4=_L3.id;var _L5=ge(_L4);if(!_L5)continue;var _L6=_L5.scry("textarea.add_comment_text");if(_L6.length==1){var _L7=_L6[0];if(_L7.hasClass("DOMControl_autogrow")){var _L8=_L3.scry("textarea.add_comment_text");if(_L8.length!=0){var _L9=_L8[0];_L9.value=_L7.value;_L1.push(_L9);}}}animation(_L5).to('height','0px').to('opacity','0').duration(UIIntentionalStream.ANIMATION_DURATION).ease(animation.ease.end).ondone(function(){DOM.remove(_L5);}).go();}return _L1;};UIIntentionalStream.prototype.handleResponsePayload=function(_L0,_L1,_L2,_L3,_L4){_L4=_L4||{};if(is_empty(_L2))return;if(_L2.streamHeader){this.streamHeader.setContent(HTML(_L2.streamHeader));if(this.isUsingStreamHeaders()&&(this.isOnNewHighlights()||this.isOnNewsFeed()))this.setUpHighlightsStreamHeader();NewHigh.reset();}if(_L2.autoRefreshConfig)this.setAutoRefreshConfig(_L2.autoRefreshConfig);this.setHomeFilterLoading(false);if(_L1==UIIntentionalStream.REFRESH_EXPAND)$(_L4.expandStoryID).find('div.UIIntentionalStory_CollapsedStories').removeClass('UIIntentionalStory_CollapsedStoriesLoading').addClass('hidden_elem');if(this.error)hide(this.error);if(!_L3&&_L0!=this.requestNum)return;if('show_hidden' in _L4)this.shouldShowHidden=_L4.show_hidden;this.hiddenCount=_L2.hiddenCount;this.hiddenIDCount=_L2.hiddenIDCount;this.storyCount+=_L2.storyCount;if('newestStoryTime' in _L2&&_L2.newestStoryTime>this.newest)this.newest=_L2.newestStoryTime;if('oldestStoryTime' in _L2&&(!this.oldest||_L2.oldestStoryTime<this.oldest))this.oldest=_L2.oldestStoryTime;if('hasAdditionalStories' in _L2){this.hasAdditionalStories=_L2.hasAdditionalStories;}else if(_L1==UIIntentionalStream.REFRESH_APPEND&&_L2.storyCount==0)this.hasAdditionalStories=false;if('streamStoryCount' in _L2){this.storyQueueCount=_L2.streamStoryCount;this.showLiveFeedCount();}this.updatePager();if(_L2.html){var _L5=HTML(_L2.html).getRootNode();_L5=$A(_L5.childNodes);switch(_L1){case UIIntentionalStream.REFRESH_QUEUE:this.queueStories(_L5,_L2.storyCount);break;case UIIntentionalStream.REFRESH_PREPEND:this.addContentPrepend(_L5);break;case UIIntentionalStream.REFRESH_APPEND:this.addContentAppend(_L5);this.clearScrollLoader();break;case UIIntentionalStream.REFRESH_TRANSITION:this.streamContent.setContent(_L5);DOMScroll.scrollTo(new Vector2(0,0,"document"),false);break;case UIIntentionalStream.REFRESH_DARK:break;case UIIntentionalStream.REFRESH_EXPAND:DOM.insertAfter($(_L4.expandStoryID),_L5);break;}}if(_L4.flushOnComplete)this._flushQueue();};UIIntentionalStream.prototype.clearQueue=function(_L0){_L0=_L0||0;this.storyQueueCount=0;this.storyQueueDiv.empty();this.hideShowNewStories(this.showNewStories,_L0);if(this.liveFeedBubble)this.hideShowNewStories(this.liveFeedBubble,_L0);};UIIntentionalStream.prototype.hideShowNewStories=function(_L0,_L1){if(_L1){setTimeout(function(){animation(_L0).to('opacity','0').checkpoint().to('height','0').hide().duration(150).go();}.bind(this),_L1);}else hide(_L0);};UIIntentionalStream.prototype.flushQueue=function(){if(this.getMSSinceLastRefresh()<this.minRefreshInterval){this._flushQueue();}else this.updateStream(true);};UIIntentionalStream.prototype._flushQueue=function(){this.addContentPrepend(this.storyQueueDiv.childNodes);this.clearQueue(UIIntentionalStream.ANIMATION_DURATION);};UIIntentionalStream.prototype.queueStories=function(_L0,_L1){var _L2=(this.storyQueueCount==0);this.storyQueueDiv.prependContent(_L0);if(_L1)this.storyQueueCount+=_L1;if(this.isUsingStreamHeaders()&&(this.isOnNewHighlights()||this.isOnNewsFeed())&&this.liveFeedCount){this.showLiveFeedCount();return;}this.showNewStories.setClass('UIIntentionalStream_ShowNewStories');if(this.showNewStoriesCount)hide(this.showNewStoriesCount);var msg;var _L4=this.storyQueueCount;if(this.storyQueueCount==1){msg=_tx("DANGOSWCH 1 POST NEWYDD");}else msg=_tx("DANGOSWCH {count} POST NEWYDD",{count:_L4});this.showNewStoriesTxt.setContent(HTML(msg));if(_L2)this.showNewStoriesMessage();};UIIntentionalStream.prototype.showNewStoriesMessage=function(){this.logFeedTrackingEvent(ft.NF_EVENT_IMPRESSION,'new');if(this.isUsingStreamHeaders()&&(this.isOnNewHighlights()||this.isOnNewsFeed())){CSS.setStyle(this.liveFeedBubble,'display','inline');}else{CSS.setStyle(this.showNewStories,'display','block');animation(this.showNewStories).to('height','auto').to('opacity','1').go();}};UIIntentionalStream.prototype.showLiveFeedCount=function(){if(this.storyQueueCount>0&&this.liveFeedCount){var _L0='';if(this.storyQueueCount>UIIntentionalStream.HIGHLIGHTS_MAX_UNSEEN_COUNT){_L0=_tx("{count}+",{count:UIIntentionalStream.HIGHLIGHTS_MAX_UNSEEN_COUNT});}else _L0=this.storyQueueCount.toString();this.liveFeedCount.setContent(HTML(_L0));this.showNewStoriesMessage();}};UIIntentionalStream.prototype.logFeedTrackingEvent=function(_L0,_L1,_L2){if(!this.sourceType)return;if(!_L2)_L2=this.getCurrentFilterKey();var _L3={src:this.sourceType,evt:_L0,filter:_L2};if(_L1)_L3.type=_L1;ft.logData(_L3);};UIIntentionalStream.prototype.handleError=function(_L0,_L1,_L2,_L3){if(!_L2.isReplay()&&_L0!=this.requestNum)return;this.setHomeFilterLoading(false);if(_L1==UIIntentionalStream.REFRESH_EXPAND)$(_L3.expandStoryID).find('div.UIIntentionalStory_CollapsedStories').removeClass('UIIntentionalStory_CollapsedStoriesLoading');var _L4=_L2.getError();if(_L4==kError_Async_NotLoggedIn){var _L5=_tx("Session Timeout");var msg=_tx("Your session has timed out. Please log in again.");var _L7=Dialog.newButton('login',_tx("Log In"),null,function(){goURI('/login.php');});new Dialog().setTitle(_L5).setBody(msg).setButtons([_L7,Dialog.CANCEL]).show();}if(!_L3.delayLoadCount&&_L1!=UIIntentionalStream.REFRESH_PREPEND&&this.error)CSS.setStyle(this.error,'display','block');};UIIntentionalStream.prototype.handleFinally=function(_L0,_L1){if(_L0==UIIntentionalStream.REFRESH_TRANSITION){PageTransitions.transitionComplete();Arbiter.inform(UIIntentionalStreamMessage.REFRESH_COMPLETED);}if(_L0!=UIIntentionalStream.REFRESH_APPEND)NewHigh.hideComposer(this.isOnNewsFeed()||this.isOnNewHighlights());this.hasPendingRefresh=false;};UIIntentionalStream.prototype.getValidParams=function(){return UIIntentionalStream.VALID_PARAMS;};UIIntentionalStream.prototype.getEndpoint=function(){return UIIntentionalStream.ENDPOINT;};UIIntentionalStream.prototype.getRefreshMethod=function(){return UIIntentionalStream.REFRESH_METHOD;};UIIntentionalStream.prototype.registerShowNewStoriesKey=function(){KeyEventController.registerKey("u",function(_L0,_L1){if(_L0.getModifiers().shift&&this.storyQueueCount>0){this.doShowNewStories();return false;}}.bind(this));};UIIntentionalStream.prototype.isOnNewHighlights=function(){var _L0=this.getCurrentFilterKey();return (_L0==UIIntentionalStream.FEED_FILTER_KEY_NEW_HIGHLIGHTS);};UIIntentionalStream.prototype.isOnNewsFeed=function(){var _L0=this.getCurrentFilterKey();return (_L0==UIIntentionalStream.FEED_FILTER_KEY_NEWS_FEED);};UIIntentionalStream.prototype.isUsingStreamHeaders=function(){return (this.hlGroup!=UIIntentionalStream.HIGHLIGHTS_CONTROL);};UIIntentionalStream.prototype.setupAutoPageRefresh=function(){if(this.hlGroup==UIIntentionalStream.HIGHLIGHTS_CONTROL)return;this.highlightsRefreshInterval=setInterval(function(){if(!this.allowAutoRefresh)return;if(this.getMSSinceLastRefresh()<UIIntentionalStream.HIGHLIGHTS_REFRESH_INACTIVE_THRESHOLD)return;var _L0=this.getMSSinceLastActivity();var _L1=(_L0>UIIntentionalStream.HIGHLIGHTS_REFRESH_INACTIVE_THRESHOLD);var _L2=(_L0>UIIntentionalStream.HIGHLIGHTS_OVERRIDE_INACTIVE_THRESHOLD);if((_L1&&this.isOnNewHighlights())||_L2)this.refreshFilter(UIIntentionalStream.FEED_FILTER_KEY_NEW_HIGHLIGHTS,_L2,true);}.bind(this),UIIntentionalStream.HIGHLIGHTS_CHECK_REFRESH_INTERVAL);};UIIntentionalStream.prototype.cleanupRefreshInterval=function(){if(this.highlightsRefreshInterval){clearInterval(this.highlightsRefreshInterval);this.highlightsRefreshInterval=null;}};UIIntentionalStream.prototype.setupAutoInsert=function(){if(this.hlGroup==UIIntentionalStream.HIGHLIGHTS_CONTROL)return;Arbiter.subscribe(UIIntentionalStreamMessage.SET_AUTO_INSERT,UIIntentionalStream.setAutoInsert);};UIIntentionalStream.setAutoInsert=function(_L0,_L1){if(_L0!=UIIntentionalStreamMessage.SET_AUTO_INSERT)return;var _L2=UIIntentionalStream.instance;if(_L2)_L2.pauseAutoInsert=_L1.pause;};UIIntentionalStream.prototype.isAutoRefreshPaused=function(){if(this.hlGroup==UIIntentionalStream.HIGHLIGHTS_CONTROL||this.isOnNewHighlights())return false;return this.pauseAutoInsert;};UIIntentionalStream.prototype.setUpHighlightsStreamHeader=function(){if(!this.streamHeader)return;this.liveFeedBubble=DOM.scry(this.streamHeader,'div.BubbleCount')[0];if(!this.liveFeedBubble)return;this.liveFeedCount=DOM.scry(this.streamHeader,'div.BubbleCount_Number')[0];this.summaryHeaderLink=DOM.find(this.streamHeader,'a.UIIntentionalStream_SummaryLink');this.liveHeaderLink=DOM.find(this.streamHeader,'a.UIIntentionalStream_LiveLink');Event.listen(this.liveHeaderLink,'click',this.toggleFilters.bind(this,UIIntentionalStream.FEED_FILTER_KEY_NEWS_FEED));Event.listen(this.summaryHeaderLink,'click',this.toggleFilters.bind(this,UIIntentionalStream.FEED_FILTER_KEY_NEW_HIGHLIGHTS));};UIIntentionalStream.prototype.toggleFilters=function(_L0){this.logFeedTrackingEvent(ft.NF_EVENT_PILL_CLICK,'',_L0);this.forceFilterKey=true;this.stickyFilter=_L0;};UIIntentionalStream.prototype.refreshFilter=function(_L0,_L1,_L2){this.logFeedTrackingEvent(ft.NF_PAGE_AUTOREFRESH,'',_L0);if(_L1){this.forceFilterKey=true;this.stickyFilter=_L0;}var _L3={'filter':_L0};var _L4={'filter':_L0};if(_L2)_L3.pending=_L2;this.refresh(UIIntentionalStream.REFRESH_TRANSITION,_L3,_L4);Arbiter.inform(UIIntentionalStreamMessage.FILTER_CHANGED,_L4);};UIIntentionalStream.prototype.doShowNewStories=function(){this.logFeedTrackingEvent(ft.NF_EVENT_SEE_MORE,'new');if(this.isOnNewHighlights()){this.refreshFilter(UIIntentionalStream.FEED_FILTER_KEY_NEWS_FEED,true);}else this.flushQueue();};copy_properties(UIIntentionalStream,{ANIMATION_DURATION:300,REFRESH_METHOD:'GET',REFRESH_TRANSITION:1,REFRESH_PREPEND:2,REFRESH_APPEND:3,REFRESH_QUEUE:4,REFRESH_DARK:5,REFRESH_EXPAND:6,FEED_FILTER_KEY_NEW_HIGHLIGHTS:'h',FEED_FILTER_KEY_NEWS_FEED:'nf',HIGHLIGHTS_NEW:1,HIGHLIGHTS_STICKY:3,HIGHLIGHTS_CONTROL:4,VALID_PARAMS:['filter','show_hidden'],ENDPOINT:'/ajax/intent.php',_presenceInit:false,HIGHLIGHTS_CHECK_REFRESH_INTERVAL:5*60*1000,HIGHLIGHTS_REFRESH_INACTIVE_THRESHOLD:30*60*1000,HIGHLIGHTS_OVERRIDE_INACTIVE_THRESHOLD:240*60*1000,HIGHLIGHTS_MAX_UNSEEN_COUNT:300});UIIntentionalStream.presenceRegister=function(){if(UIIntentionalStream._presenceInit)return true;var _L0=UIIntentionalStream.callOnInstance('presenceStreamCheck');var _L1=UIIntentionalStream.callOnInstance('presenceStreamResponse');Arbiter.registerCallback(function(){presenceUpdater.register('stream_update',_L0,_L1,bagofholding,bagofholding);},[PresenceMessage.PRESENCE_UPDATER_READY]);Arbiter.subscribe(PresenceMessage.getArbiterMessageType('feedpub'),UIIntentionalStream.handleNewStoryMessage);UIIntentionalStream._presenceInit=true;};
UIIntentionalStory={setup:function(_L0,_L1){if(!_L0||!_L1)return null;if(_L1.unfollow)var _L2=Event.listen(_L0,'mouseover',function(){this.createUnfollowMenu(_L0,_L1);_L2.remove();}.bind(this));},createUnfollowMenu:function(_L0,_L1){var _L2=_L0.scry('div.UIStory_Hide')[0];if(!_L2)return;if(ua.ie()<7){Event.listen(_L0,'mouseover',function(){_L2.style.visibility='visible';});Event.listen(_L0,'mouseout',function(){_L2.style.visibility='hidden';});}var _L3=_L1.title;_L1=_L1.unfollow;var _L4=new UIActionMenu();var _L5=new UISelectList();var _L6=function(_L0,_L4,_L5,_L7,_L1){_L4.hideMenu();_L5.reset();var _L8=copy_properties({storyID:_L0.id},_L1);UIIntentionalStream.instance.unfollow(_L8);}.bind(this,_L0,_L4,_L5);_L5.setMode(UISelectList.SINGLE_SELECT_MODE).setCallback(_L6);_L1.users.each(function(_L7){_L5.addItem(HTML(_L7.hideString),false,_L7);});if(_L1.app)_L5.addItem(HTML(_L1.app.hideString),false,_L1.app);_L4.setTitle(_L3).setContentCallback(_L5.getElement.bind(_L5)).setSuppressButton(true).setAlignRight(true);_L2.setContent(_L4.getNodes());},_moreDetails:{},expandStory:function(_L0,_L1,_L2,_L3){var _L4=UIIntentionalStream.instance.getCurrentParams();_L4.expand_story_uid=_L1;_L4.newest=_L2;_L4.oldest=_L3;var _L5={expandStoryID:_L0,showLoader:false};$(_L0).find('div.UIIntentionalStory_CollapsedStories').addClass('UIIntentionalStory_CollapsedStoriesLoading');UIIntentionalStream.instance.refresh(UIIntentionalStream.REFRESH_EXPAND,_L4,_L5);},morePrivacyDetails:function(_L0,row,_L2){if(is_empty(this._moreDetails))onunloadRegister(function(){this._moreDetails={};}.bind(this));if(this._moreDetails[_L0])return;this._moreDetails[_L0]=true;new AsyncRequest().setURI('/ajax/privacy/more_details.php').setData({fbid:_L0,privacy_data:row}).setHandler(function(_L3){var _L4=_L3.getPayload().explanation;DOM.setContent(DOM.find(_L2,'span.UITooltip_Text'),_L4);}).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();}};

if (window.Bootloader) { Bootloader.done(["js\/1z37bu8xtyo04wgw.pkg.js"]); }