ansWebpackJsonpFunction(["main"],{"./actions.js":function(e,t,i){function n(){l>=c&&(o(),l=0)}function o(){var e=(new Date).getTime(),t=[];for(var i in d){var n=d[i];e-n.startTime>u&&(t.push(n),delete d[i])}}function s(e){e.mustReport&&(delete e.mustReport,r.log("action_data",{data:e}))}var a=i("./shared/util.js"),r=i("./shared/log_sender.js"),d={},l=0,c=100,u=6e5;t.startAction=function(e){if(null===e||void 0===e)throw new Error("This method expects an object describing the action.");return e.startTime=(new Date).getTime(),e.id=(1e3*e.startTime+Math.floor(1e3*Math.random())).toString(36),d[e.id]=e,l++,n(),e},t.startOrUpdateAction=function(e,i){return e&&d[e]?t.updateAction(e,i):t.startAction(i)},t.getAction=function(e){return d[e]},t.updateAction=function(e,t){if(t===undefined)throw new Error("This method expects an object describing the update.");var i=d[e];return i===undefined?null:a.extend(i,t)},t.finishAction=function(e,t){var i=d[e];return i===undefined?null:(t&&a.extend(i,t),i.endTime=(new Date).getTime(),delete d[e],s(i),i)}},"./app/view/activation/facebook.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/onload.js"),s=i("./shared/facebook.js");t.FacebookPageLikeButton=n.extend({onLoad:function(){var e=this;o.execAfterLoadDelayed(function(){s.onInit(function(){window.FB.XFBML.parse(e.$id("@button").get(0)),window.FB.Event.subscribe("edge.create",function(){e.serverCall("page_liked").liveMutate().send()}),window.FB.Event.subscribe("edge.remove",function(){e.serverCall("page_unliked").liveMutate().send()})})})}}),t.FacebookConnect=n.extend({onLoad:function(){var e=this;e.actionButton=e.child("close"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(){e.$id("@facebook_connect").fadeOut(300)})}})},"./app/view/activation/twitter.js":function(e,t,i){var n=i("./app/view/share/connect.js").SocialConnector,o=i("./shared/core/component.js").Component;t.TwitterConnect=o.extend({onLoad:function(){var e=this;this.$id("@twitter_disconnect_button").click(function(){return e.serverCall("twitter_disconnect").liveMutate().send(),!1}),e.actionButton=e.child("close"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(){e.serverCall("dismiss_twitter_connect").liveMutate().success(function(){e.$id("@twitter_connect").fadeOut(300)}).send()})}}),t.TwitterConnectButton=n.extend({onLoad:function(){var e=this;this.$id("@twitter_connect_button").click(function(){e.serverCall("on_connect_button_press").send(),e.connectTwitter()})}})},"./app/view/admin.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./tooltip.js"),s=i("./unified_view/modal.js").ModalBase,a=i("./view/modal.js").Base,r=i("./view/dialog.js"),d=i("./w2.dialog.js"),l=i("./shared/keystrokes.js"),c=i("./settings.js").interface_strings;t.AdminLogItemView=n.extend({onLoad:function(){var e=this;this.$id("@view").click(function(t){e.$id("@details").toggleClass("hidden"),t.preventDefault()}),this.$id("@item").hover(function(){e.$id("@item").addClass("hover"),e.$id("@buttons").removeClass("hidden")},function(){e.$id("@item").removeClass("hover"),e.$id("@buttons").addClass("hidden")}),o.attach(this.$id("@remove"),this.hide_title),this.$id("@remove").click(function(t){d.createDialog(e).title(e.hide_title).cancel(null,c.cancel).ok(function(){e.serverCall("hide_log_item").send()},e.hide_title).html(e.hide_message),t.preventDefault()})}}),t.AdminMode=n.extend({toggle:function(){this.serverCall("toggle").liveMutate().send()},onLoad:function(){function e(e){t.toggle(),e.preventDefault()}var t=this;t.$id("@toggle").click(e),t.listen&&l.on([81,49,81,49],e)}}),t.AdminModeListener=n.extend({toggle:function(){this.serverCall("toggle").liveMutate().send()},onLoad:function(e){function t(e){i.toggle(),e.preventDefault()}var i=this;l.on([81,49,81,49],t)}}),t.RemoveInboxMessagesLink=n.extend({onLoad:function(){var e=this;this.$id("@delete").click(function(t){t.preventDefault(),e.createModal("remove_inbox_messages_modal").onSubmit(function(){e.serverCall("delete_messages").liveMutate().send()}).show()})}}),t.AdminRemoveUserPhoto=n.extend({onLoad:function(e){var t=this;this.$id("@remove_photo_link").click(function(e){e.preventDefault(),t.createModal("remove_user_photo_modal").kwargs({uid:t.uid}).show()})}}),t.FlagNameLink=n.extend({onLoad:function(){var e=this;this.$id("@show_flag_name_modal").click(function(t){t.preventDefault(),e.createModal("flag_modal").kwargs({uid:e.uid,resolved:e.resolved}).show()})}}),t.ResolveNameLink=n.extend({onLoad:function(){var e=this;this.$id("@show_resolve_name_modal").click(function(t){t.preventDefault(),e.createModal("verify_modal").kwargs({uid:e.uid}).show()})}}),t.RemoveUserPhotoModal=s.extend({onSubmit:function(){var e=this._super.bind(this);this.serverCall("remove_photo").kwargs({comment:this.$id("@comment").val()}).liveMutate().success(function(){e()}).send()}}),t.ResolveNameModal=s.extend({onSubmit:function(){var e=this._super.bind(this);this.serverCall("resolve_name").kwargs({reason:this.$id("@reason").val()}).liveMutate().success(function(){e()}).send()}}),t.FlagNameModal=s.extend({onSubmit:function(){var e=this._super.bind(this);this.serverCall("flag_name").kwargs({reason:this.$id("@reason").val()}).liveMutate().success(function(){e()}).send()}}),t.BanRemoveLink=n.extend({onLoad:function(){var e=this;e.$id("@ban_remove_link").click(function(t){t.preventDefault(),e.serverCall("ad_admin_uids").kwargs({uids:e.uids_to_ban_remove}).success(function(t){if(0==t.length)e.createModal("ban_remove_modal").kwargs({location:e.location,uids_to_ban_remove:e.uids_to_ban_remove,use_safe_ban:e.use_safe_ban}).show();else{var i="Some of these users (uids: "+t+") are admins on ";i+="Quora ad accounts. If these users ",i+="should be banned, please first edit block the users, and email ",i+="ad-admin-bans@quora.com with a link to the users' profile pages ",i+="and whois pages to discuss next steps for the ban.",d.createDialog(e).title("Banning an ad admin").cancel(function(){e.createModal("ban_remove_modal").kwargs({location:e.location,uids_to_ban_remove:e.uids_to_ban_remove,use_safe_ban:e.use_safe_ban,force_ban_ad_admin:!0}).show()},"Ban anyway").ok(null).html(i)}}).send()})}}),t.BanRemoveModal=a.extend({onLoad:function(){this._super.apply(this,arguments),this.child("editor").focus()},onSubmit:function(){var e=this,t=e.child("editor");if(t.isOnlyWhiteSpace())return e.$id("@required_comment_warning").removeClass("hidden"),void t.focus();var i=t.serialize(),n=this.$id("@revert_edits").is(":checked"),o=this.$id("@mark_as_verified_spammer").is(":checked"),s=this.$id("@remove_votes").is(":checked"),a=function(t){return e.$id("@"+t).prop("checked")};return e.serverCall("ban_remove_all_users").kwargs({comment:i,revert_edits:n,mark_as_verified_spammer:o,remove_votes:s,uids_to_ban_remove:e.uids_to_ban_remove.filter(a)}).liveMutate().success(function(){e._closeModal()}).send(),!1}}),t.SendMessageLinkBase=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({recipient_uid:e.recipient_uid}).show()})}}),t.SendMessageModalBase=s.extend({onSubmit:function(){var e=this._super.bind(this),t=this.child("editor").serialize();this.serverCall("submit").kwargs({msg:t}).liveMutate().success(function(){e()}).send()}}),t.BanUserDialog=r.AddCommentDialog.extend({getPars:function(){var e=this._super.apply(this,arguments);return e&&(e.removeMessages=this.$id("@checkbox").prop("checked")),e}}),t.AdminMessageDialog=r.Dialog.extend({onLoad:function(){this._super.apply(this,arguments),this.editor=this.child("editor"),this.editor.focus()},getPars:function(){return!this.editor.isOnlyWhiteSpace()&&{msg:this.editor.serialize()}}}),t.BanUserLink=r.DialogLink.extend({click:function(){var e=this;e.serverCall("attempt_ban_user").except("ad_admin_blocked",function(){var t="This user is an admin on a Quora ad account. If the user ";t+="should be banned, please first edit block this user, and email ",t+="ad-admin-bans@quora.com with a link to the user's profile page ",t+="and whois page to discuss next steps for the ban.",d.createDialog(e).title("Banning an ad admin").cancel(function(){e.options.force_ban_ad_admin=!0,d.createDialog(e).load("get_dialog",{kwargs:{ty:e.type,object_id:e.object_id,options:e.options}})},"Ban anyway").ok(null).html(t)}).success(function(){d.createDialog(e).load("get_dialog",{kwargs:{ty:e.type,object_id:e.object_id,options:e.options}})}).send()}}),t.SendMessageTemplateModal=s.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.sender=null,e.$id("@select_template").change(e.onSelectTemplate.bind(e)),e.$id("@select_user").change(function(t){e.sender=t.target.value})},onSelectTemplate:function(e){var t=this,i=e.target.value;t.serverCall("show_message_template").kwargs({message:i}).contentFor(t.$id("@message_template")).send()},onSubmit:function(){var e=this,t=e._super.bind(e),i=this.child("editor").serialize();this.serverCall("submit").kwargs({message:i,sender:e.sender}).liveMutate().success(function(){t()}).send()}})},"./app/view/ads.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/events/index.js"),s=i("./view/fixable2.js"),a=i("./settings.js"),r=i("./shared/log_sender.js"),d=i("./shared/ads_landing_page_time.js"),l=i("./shared/core/component.js").Component,c=i("./unified_view/multimodal.js").Manager;t.AdComponent=l.extend({onLoad:function(){this._super.apply(this,arguments),this.handleOnLoad()},handleOnLoad:function(){var e=this;n(document).ready(function(){[100,2e3,5e3].forEach(function(t){setTimeout(e.logIfBlocked.bind(e),t)})})},logIfBlocked:function(){var e=this,t=e.$id("@"+e.wrapperString);if(0===t.width()||0===t.height()){for(var i=!1,o=t.get(0);o;){if(n(o).hasClass("pagedlist_hidden")){i=!0;break}o=o.parentNode}if(!i){var s={impression_hash:e.impressionHash,window_id:a.windowId};r.log("ads_blocked_impressions",s)}}}}),t.AdLink=l.extend({onLoad:function(){var e=this;e._super.apply(this,arguments),e.lead_gen_data={ad_id:e.ad_id,impression_hash:e.impressionHash};var t=e.$id("@"+e.linkString);if(t.on("mousedown",function(){t.attr("href",e.redirect_url)}),e.is_leadgen)var i=new c(e,function(t,i,n){"lead_gen_form"===i?t.replaceStep("lead_gen_form_submission_confirmation",e.lead_gen_data):"lead_gen_form_submission_confirmation"===i&&t.dismiss()});t.on("click",function(t){if(e.is_leadgen)i.pushStep("lead_gen_form",e.lead_gen_data);else{var n={scribeOnly:!0},o={impression_hash:e.impressionHash};r.log("ads_js_clicks",o,n),t.shiftKey||t.ctrlKey||t.metaKey||d.startTimer(e.impressionHash)}})}}),t.AdsDebugToggle=l.extend({onLoad:function(){this._state=!1,this.setupKeyboardShortcut()},toggle:function(){var e,t=this,i=document.getElementsByClassName("ads_debug_info");if(t._state)for(t._state=!1,e=0;e'),u=n('');c.append(l),c.append(u),i.data("tags")[d]||(n(o).append(c),i.data("tags")[d]=!0,i.val(""),n(i).attr("placeholder",e.orPlaceholder))}})},disableSubmit:function(){this.submitBtn.addClass("action_disabled")},enableSubmitIfNoErrors:function(){var e=this;e.nameEmptyError||e.rulesEmptyError?e.disableSubmit():this.submitBtn.removeClass("action_disabled")},onSubmit:function(){function e(e,t){var i=[];for(var n in t)i.push([parseInt(e),n]);return 1==i.length?i[0]:i}var t=this,i=this.name.val(),o=this.description.val(),r=t.conversionTypeSelector.val(),d=this.rulesWrapper.find(".url_keywords:visible"),l=[],c=[];if(t.rulesWrapper.find(".url_keyword_highlight:visible").length){for(var u=0;u=this.limit)return void this.toggleTooManyTopicsError(!0);this.toggleTooManyTopicsError(!1),this._super.apply(this,arguments),this.updateSummary()},addSelectedTopics:function(e){var t,i,n=this,o=e.length+n.saved_results.length,s={};if(o>n.limit)return n.serverCall("show_too_many_target_topics_pmsg").kwargs({total:o,saved_results_length:n.saved_results.length}).send(),!1;for(t=0;t0&&(n.updateDisplayedResults(),n.onSavedResultsChanged(!(e.length>1)),n.updateSummary()),n.$input.focus(),!0},remove:function(e){this._super.apply(this,arguments),this.updateSummary(),this.focus()},removeLastItem:function(e){var t=this.saved_results.length-1;this.remove(t)},onSavedResultsChanged:function(e){this._super.apply(this,arguments),this.emitEvent({type:o.Types.ADS_MANAGER_UPDATE_INVENTORY,payload:{}}),this.emitEvent({type:o.Types.ADS_MANAGER_UPDATE_SUGGESTED_BID,payload:{}}),this.emitEvent({type:o.Types.ADS_MANAGER_UPDATE_SUGGESTED_TOPIC,payload:{show_suggested:e}}),this.emitRemainingCount(),this.toggleTooManyTopicsError(!1)},toggleTooManyTopicsError:function(e){var t=this.parent().$id("@topic_selector_too_many_topics_error"),i=this.parent().child("topic_selector");e?(i.$wrapper.addClass("error"),t.removeClass("hidden")):(i.$wrapper.removeClass("error"),t.addClass("hidden"))},getNumRemainingSlots:function(){var e=0;return this.saved_results&&(e=this.saved_results.length),this.limit-e},updateSummary:function(){var e={};"topic_selector"==this.cname?e.topic_count=this.saved_results.length:"interest_topic_selector"==this.cname&&(e.interest_count=this.saved_results.length),this.emitEvent({type:o.Types.ADS_MANAGER_UPDATE_SUMMARY,payload:e})},emitRemainingCount:function(){this.emitEvent({type:o.Types.ADS_MANAGER_SELECTOR_COUNT_CHANGE,payload:{remainingCount:this.getNumRemainingSlots(),target:this}})}})},"./app/view/ama.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js");t.AmaSessionRightCol=n.extend({onLoad:function(){var e=this.$id("@ticker").get(0);if(e||(e=this.$id("@upcoming").get(0)),e){o.makeFixable(e,{scroll_dep:!0,height_dep:!0,extra_top_spacing:16})}}}),t.AMAWriterStats=n.extend({onLoad:function(){var e=this.$id("@writer_stats").get(0);e&&o.makeFixable(e,{scroll_dep:!0,extra_top_spacing:110})}}),t.AMAMetricGraph=n.extend({onLoad:function(){new Rickshaw.Graph({element:this.$id("@rsgraph").get(0),series:[{color:"steelblue",data:this.series_data}],width:150,height:40,interpolation:"basis",renderer:"line"}).render()}}),t.FinishSessionButton=n.extend({onLoad:function(){var e=this;this.finish_session_button=this.child("finish_session_button"),this.finish_session_button&&e.finish_session_button.onPressed(e.finishSessionConfirm.bind(e))},finishSessionConfirm:function(){this.createModal("finish_session_confirm").onSubmit(this.finishSession.bind(this)).show()},finishSession:function(){this.serverCall("finish_session").kwargs({ama_id:this.ama_id}).success(this.redirectToSessionPage.bind(this)).sendOnlyOnce()},redirectToSessionPage:function(){window.location.replace(this.redirect_url)}})},"./app/view/answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.AnswerHeader=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.ANSWER_VOTE_STATE,function(t){if(t.payload.aid==e.aid){var i="upvoted"==t.payload.state;e.$id("@credibility_fact_no_vote").toggleClass("hidden",i),e.$id("@credibility_fact_upvoted").toggleClass("hidden",!i)}}),this.handleEvent(o.Types.FEED_ANSWER_INLINE_EXPAND,function(t){t.payload.aid==e.aid&&e.showFollowButton()})},showFollowButton:function(){var e=this;e.$id("@follow_button").removeClass("hidden",function(){e.$id("@follow_button").addClass("fadeIn")})}}),t.ToggledAnswerHeader=n.extend({onLoad:function(){var e=this;this.toggled=!1,this.handleEvent(o.Types.INLINE_EDITOR_STATE,function(t){t.payload.contentType==e.contentType&&t.payload.oid==e.oid&&("cancel"==t.payload.state?e.performCancel():"edit"==t.payload.state?e.updateState(!0):"submit"==t.payload.state?e.updateState(!1):"submitted"==t.payload.state?e.updateState(!1):"toggle"==t.payload.state&&e.updateState(!e.toggled))})},updateState:function(e){setTimeout(this._updateState.bind(this,e),0)},_updateState:function(e){this.toggled=e,this.toggled?this.performEdit():this.performCancel()},performEdit:function(){this.$id("@read_mode_header").addClass("hidden"),this.$id("@edit_mode_header").removeClass("hidden")},performCancel:function(){this.$id("@read_mode_header").removeClass("hidden"),this.$id("@edit_mode_header").addClass("hidden")}}),t.AnswerListItem=n.extend({onLoad:function(){var e=this;e.answerFeedbackLoaded=!1,e.handleEvent(o.Types.ANSWER_VOTE_STATE,function(t){t.payload.aid==e.aid&&("downvoted"==t.payload.state?e.showAnswerDownvoteFeedback():e.hideAnswerDownvoteFeedback())})},showAnswerDownvoteFeedback:function(){var e=this;e.$id("@item").addClass("hidden"),e.$id("@answer_feedback").removeClass("hidden"),!1===e.answerFeedbackLoaded&&e.serverCall("load_downvote_feedback").contentFor(e.$id("@answer_feedback")).success(function(){e.answerFeedbackLoaded=!0}).send()},hideAnswerDownvoteFeedback:function(){this.$id("@item").removeClass("hidden"),this.$id("@answer_feedback").addClass("hidden")}})},"./app/view/answer/promote.js":function(e,t,i){var n=i("./view/modal.js"),o=i("./shared/jquery.js"),s=i("./shared/toast.js"),a=i("./shared/events/index.js"),r=i("./shared/window_manager.js"),d=i("./shared/client_log.js"),l=i("./shared/core/component.js"),c=/[^0-9.-]+/g;t._PromoteAnswerModal=n.MultiStep.extend({getCallBacks:function(){var e=this;return{PromoteAnswerTargetingModal:{getStepData:function(){var t=e.$id("@account_dropdown").find(":selected").val();return{aid:e.aid,accountId:t,campaignId:e.campaignId,currentStep:e.currentStep}},init:function(){var t=function(){var t=e.$id("@account_dropdown").find(":selected").val();e.moneyFormat(e.$id("@total_budget"),e.ad_accounts_info[t].currency_symbol)},i=function(){var t=e.$id("@account_dropdown").find(":selected").val();e.serverCall("has_payment").kwargs({account_id:t}).success(function(t){t?e.$id("@steps")[0].classList.add("u-hidden"):e.$id("@steps")[0].classList.remove("u-hidden")}).send()};e.$id("@total_budget").blur(t),e.$id("@account_dropdown").change(t),e.$id("@account_dropdown").change(i),e.$id("@edit_topics").on("click",function(t){t.preventDefault(),e.$id("@topic_selector_summary").addClass("hidden"),e.$id("@topic_selector").removeClass("hidden")})},onSubmit:function(){var t=e.$id("@account_dropdown").find(":selected").val(),i=e.$id("@promotion_period_dropdown").find(":selected").val(),n=parseInt(e.$id("@total_budget").val().replace(c,"")),o=e.$id("@submit_button"),a=e.$id("@modal_body");e.toggleSubmitAndLoading(o,a);var r=[],u=e.child("topic_selector");r=e.getSelectedTopics(u),parseInt(e.totalBudget,10)<5?e.serverCall("show_budget_error_pmsg").kwargs({currency_symbol:e.currencySymbol}).send():0==u.saved_results.length?s.showError(e.topicErrorString):e.serverCall("promote_answer").kwargs({account_id:t,aid:e.aid,promotion_period:i,total_budget:n,topic_tids:r}).success(function(t){e.campaignId=t,e._loadNext()}).error(function(){e.toggleSubmitAndLoading(o,a)}).send(),d.logEvent("ExpressPromotedAnswerCreateAd",l.getAnyElement(this),{aid:e.aid})}},PromoteAnswerSummaryModal:{isLastStep:!0,init:function(){e.$id("@cancel_button").on("click",function(e){e.preventDefault(),r.navigateTo("/ads","present")})},onSubmit:function(){e._closeModal(),d.logEvent("ExpressPromotedAnswerDone",l.getAnyElement(this),{aid:e.aid})}},NoAccountEntryModal:{onSubmit:function(){d.logEvent("ExpressPromotedAnswerIntro",l.getAnyElement(this),{aid:e.aid}),e._loadNext()}},AddBillingModal:{getStepData:function(){return{currentStep:e.currentStep}},init:function(){var t=e.$id("@submit_button"),i=e.$id("@modal_body");e.handleEvent(a.Types.ADS_MANAGER_ADD_PAYMENT_CARD_FORM_UPDATE,function(n){n.payload.error&&e.toggleSubmitAndLoading(t,i)}),e.handleEvent(a.Types.ADS_PROMOTE_ANSWER_PAYMENT_CARD_ADDED,function(n){n.payload.error?s.showError(e.billingErrorString):e.serverCall("billing_added").success(function(){e._loadNext()}).error(function(){e.toggleSubmitAndLoading(t,i)}).send()})},onSubmit:function(){var t=e.$id("@submit_button"),i=e.$id("@modal_body");e.toggleSubmitAndLoading(t,i),e.child("add_card_form").submit(),d.logEvent("ExpressPromotedAnswerAddBilling",l.getAnyElement(this),{self:this.aid})}},CountryAndCurrencyModal:{init:function(){var t=e.$id("@country_dropdown"),i=e.$id("@currency_dropdown"),n=e.$id("@resize_option");e.resizeDropdown(t,n),e.resizeDropdown(i,n),t.change(function(){e.resizeDropdown(t,n),this.value&&e.serverCall("ads_available_in_country").kwargs({country:this.value}).success(function(t){t||e.createModal("show_ads_blocked_in_country_modal").show()}).send()}),i.change(function(){e.resizeDropdown(i,n)})},onSubmit:function(){var t=e.$id("@country_dropdown").find(":selected").val(),i=e.$id("@currency_dropdown").find(":selected").val(),n=e.$id("@submit_button"),o=e.$id("@modal_body");e.toggleSubmitAndLoading(n,o),t&&i&&e.serverCall("create_ad_account").kwargs({country:t,currency:i}).success(function(){e._loadNext()}).error(function(){e.toggleSubmitAndLoading(n,o)}).send(),d.logEvent("ExpressPromotedAnswerCreateAccount",l.getAnyElement(this),{aid:e.aid})}},CantPromoteAnswerModal:{isLastStep:!0,onSubmit:function(){d.logEvent("ExpressPromotedAnswerCannotPromote",l.getAnyElement(this),{aid:e.aid}),e._closeModal()}}}},onLoad:function(){this._super.apply(this,arguments)},resizeDropdown:function(e,t){t.html(e.find("option:selected").text());var i=o(".resize_dropdown")[0].offsetWidth+40;e.width(i)},toggleSubmitAndLoading:function(e,t){e.toggleClass("disabled"),t.toggleClass("loading_transparency")},moneyFormat:function(e,t){if(""!==e.val()&&o.isNumeric(e.val().replace(c,""))){var i=parseFloat(e.val().replace(c,""));e.val(t+i.toFixed(2))}},getSelectedTopics:function(e){var t=[];return e.saved_results&&e.saved_results.map(function(e){t.push(e.data.tid)}),t}})},"./app/view/answer_wiki.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./view/inline_editor.js").InlineEditor;t.CreateAnswerWikiInlineEditor=o.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@inline_editor_cancel").click(function(){return e.hideEditor(),!1})},trigger_request:function(){return this._super.apply(this,arguments),this.isEditorEmpty()&&this.hideEditor(),!1},hideEditor:function(){this.toggle_editor(),n("#answer_wiki").addClass("hidden")},_get_kwargs:function(){return{qid:this.id,input:this.get_value()}}}),t.AnswerWikiInlineEditor=o.extend({_get_kwargs:function(){var e="";this.has_comment&&!this.child("comment_editor").isOnlyWhiteSpace()&&(e=this.child("comment_editor").serialize());var t,i=this.$id("@notif");return t=i&&i.prop("checked")?1:0,{qid:this.id,input:this.get_value(),sugg_exists:this.sugg_exists,comment:e,notif:t}}})},"./app/view/bug_report.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base,a=i("./view/upload.js");t.BugReportModalLink=n.extend({onLoad:function(){var e=this;this.$id("@send_feedback").on("click",function(t){t.preventDefault(),e.createModal("load_inner").show()})}}),t.BugReportModal=s.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.child("upload_form").success(this.uploadSuccess.bind(this)).failure(this.uploadFailure.bind(this)),this.$id("@editor").focus(),this.$id("@submit_button").click(function(t){t.preventDefault();var i=e.$id("@editor").val().trim(),n=e.$id("@photo_key").val();return e.serverCall("submit_feedback").kwargs({target:e.target,msg:i,photo_key:n}).success(function(){i&&e._closeModal()}).sendOnlyOnce(),!1})},uploadSuccess:function(e){var t=this;this.$id("@photo_key").val(e.photo_key),this.serverCall("upload").kwargs({photo_key:e.photo_key,target:this.target}).success(function(){var e=t.child("screenshot").$id("@remove_screenshot");e.removeClass("hidden"),e.click(function(){t.serverCall("clear_upload").kwargs({target:t.target}).success(function(){t.child("upload_form").success(t.uploadSuccess.bind(t)).failure(t.uploadFailure.bind(t))}).contentFor(t.$id("@iframe")).send()})}).contentFor(this.$id("@iframe")).send()},uploadFailure:function(){o(".drop_zone").removeClass("drag_and_hover"),this.child("upload_form").hideSpinner();var e=this.child("upload_form").$id("@file");if(e){0!==e.get(0).files.length&&(e.get(0).value=null)}}}),t.BugReportMain=a.UploadDialogContents.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@submit_report").click(function(t){t.preventDefault(),e.$id("@submit_report").prop("disabled",!0);var i,n=e.$id("@subject").val(),s=e.$id("@description").val(),a=e.$id("@photo_key").val(),r=e.$id("@project").val(),d=e.$id("@priorities").val();return i=r===e.$id("@queue_project").val()?o.map(e.$id("@select_queues input:checked"),function(e){return e.value}):null,e.serverCall("submit_report").kwargs({target:e.target,subject:n,description:s,photo_key:a,project:r,priority:d,queue_types:i}).success(function(e){window.location.reload()}).sendOnlyOnce(),!1}),this.$id("@project").change(function(t){var i=e.$id("@select_queues");o(this).val()===e.$id("@queue_project").val()?i.removeClass("hidden"):i.addClass("hidden")})},uploadSuccess:function(e){this.$id("@photo_key").val(e.photo_key),this.serverCall("upload").kwargs({photo_key:e.photo_key,target:this.target}).contentFor(this.$id("@upload_screenshot")).send()}}),t.BugReportTableCell=n.extend({onLoad:function(){var e=this;this.$id("@delete_report").click(function(t){return e.serverCall("delete_report").kwargs({report_id:e.report_id}).success(function(e){window.location.reload()}).send(),!1})}})},"./app/view/common.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/inline_editor.js"),s=i("./shared/events/index.js"),a=o.InlineEditor,r=i("./shared/upload.js"),d=i("./shared/toast.js"),l={};t.SuggestedEditSaveButton=n.extend({onLoad:function(){var e=this;this.$id("@accept").click(function(){return e.serverCall("publish_edit").liveMutate().send(),!1})}}),t.Content=n.extend({onLoad:function(){this.$content=this.$id("@content"),this.$editor=this.$id("@editor"),this.bindEditorCallbacks(),this.editorFetched=this.editor_loaded,this.editorLoaded=this.editor_loaded},toggle:function(e){this.emitEvent({type:s.Types.QTEXT_EXPANDABLE_STATE,payload:{content_type:this.content_type,oid:this.oid}});var t=this.$content.hasClass("hidden");null!=e&&(t=e),t?this.showContent():this.showEditor()},showContent:function(){this.$content.removeClass("hidden"),this.$editor.addClass("hidden")},showEditor:function(){if(!this.editorLoaded)return this.$id("@loading").removeClass("hidden"),void this.fetchEditor();this.$content.addClass("hidden"),this.$editor.removeClass("hidden")},fetchEditor:function(){var e=this;this.editorFetched||(this.editorFetched=!0,this.serverCall("editor_component").contentFor(this.$editor).success(function(){e.$id("@loading").addClass("hidden"),e.editorLoaded=!0,e.emitEvent(s.helpers.inlineEditorEdit(e.content_type,e.oid)),e.showEditor()}).send())},editorCallbacks:function(e){"edit"==e?this.toggle(!1):"cancel"==e?this.toggle(!0):"submitted"==e?this.toggle(!0):"toggle"==e&&this.toggle()},bindEditorCallbacks:function(){var e=this,t=e.content_type+"-"+e.oid,i=l[t];e.editorCallbacks(i),e.handleEvent(s.Types.INLINE_EDITOR_STATE,function(t){var i=t.payload.contentType+"-"+t.payload.oid;l[i]=t.payload.state,t.payload.contentType==e.content_type&&t.payload.oid==e.oid&&e.editorCallbacks(t.payload.state)})}});var c=t.SuggestedEditsEditor=a.extend({onLoad:function(){this._super.apply(this,arguments),this.disclaimer_update="",this.answer_attribution_update="";var e=this;this.setToggleCallback(function(){if(e.parent()){var t=e.parent();t.toggleButtons&&t.toggleButtons(),t.$id("@disclaimer").toggle(),t.$id("@nfr").toggle(),t.$id("@answer_attribution").toggle()}e.editorShown&&e.editor.fixEditorButtons()}),e.child("editor").setEditorReadyCallback(function(){e.original_input=e.get_value()})},submitHandler:function(){var e=this;this.input_button_obj.click(function(t){e.trigger_request(),t.preventDefault()})},okToSubmitRequest:function(){return this.editor.hasChanged(this.original_input)||this.always_submit||""!==this.disclaimer_update||""!==this.answer_attribution_update?r.isVideoUploadInProgress()?(this.editor.alertUploadInProgress(),!1):this._super.apply(this,arguments):(d.showError(this.no_change_error_msg),!1)},_get_kwargs:function(){var e="";return this.has_comment&&!this.child("comment_editor").isOnlyWhiteSpace()&&(e=this.child("comment_editor").serialize()),{object_id:this.id,input:this.get_value(),sugg_exists:this.sugg_exists,notif:this.$id("@notif").prop("checked")?1:0,comment:e,disclaimer_update:this.disclaimer_update,answer_attribution_update:this.answer_attribution_update,share_values:{}}}});t.AnswerEditor=c.extend({onLoad:function(){this._super.apply(this,arguments),this.answerShareForm=this.child("answer_share_form"),this.editorShare=this.answerShareForm&&this.answerShareForm.child("editor_share")},_get_kwargs:function(){var e=this._super();return this.editorShare&&(e.share_values=this.editorShare.getValues()),e}}),t.PostEditor=c.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(s.Types.POST_DISCLAIMER,function(t){t.payload.pid==e.id&&(e.disclaimer_update=t.payload.state)})}})},"./app/view/components.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./settings.js").interface_strings,a=i("./shared/client_log.js"),r=i("./shared/window_manager.js"),d=i("./shared/action_log.js");t.TruncatePhraseList=n.extend({onLoad:function(){var e=this;e.$id("@view_all_link").click(function(){return e.$id("@partial_phrases").addClass("hidden"),e.$id("@all_phrases").removeClass("hidden"),!1})}}),t.TruncatedQText=n.extend({enterLoadingState:function(){this.$id("@loading").removeClass("hidden"),this.$id("@more").addClass("hidden")},exitLoadingState:function(){this.$id("@more").removeClass("hidden"),this.$id("@loading").addClass("hidden")}}),t.SimpleUserRequest=n.extend({onLoad:function(){var e=this;this.$id("@link").click(function(t){e.onClick(t),t.preventDefault()})},onClick:function(e){this.upvote&&(a.logEvent("BoardItemUpvote",e.target,{board_item_id:this.board_item_id}),d.logSecondaryAction("BoardItemUpvote",{type:"board_item",board_item_id:this.board_item_id})),this.downvote&&a.logEvent("BoardItemDownvote",e.target,{board_item_id:this.board_item_id}),(this.board_follow_button||this.board_request_follow_button)&&(a.logEvent("BoardFollow",e.target,{board_item_id:this.board_item_id}),d.logSecondaryAction("BoardFollow",{type:"board",bid:this.bid})),this.serverCall("request").liveMutate().send()}}),t.SimpleUserRequestConfirm=n.extend({onLoad:function(){var e=this;this.$id("@link").click(function(){return e._dialog=o.createDialog(e).title(e.title).cancel(null,s.cancel).ok(function(){e.serverCall("request").liveMutate().success(function(e){e.next_url&&r.navigateTo(e.next_url)}).send()},e.button_text).html(e.confirm_text),!1})}}),t.OrderItemButtons=n.extend({onLoad:function(){var e=this;this.$id("@up").click(function(){return e.serverCall("move_up").liveMutate().send(),!1}),this.$id("@down").click(function(){return e.serverCall("move_down").liveMutate().send(),!1})}})},"./app/view/contact_importer.js":function(e,t,i){function n(e,t){var i=!1;return s.each(t,function(t,n){if(n.test(e))return void(i=!0)}),i}var o=i("./settings.js"),s=i("./shared/jquery.js"),a=i("./shared/events/index.js"),r=i("./shared/google_.js"),d=i("./shared/core/component.js").Component,l=[/@yahoo\.(ca|cn|co\.id|co\.in|co\.jp|co\.kr|co\.nz|co\.uk|com|com\.ar|com\.au|com\.br|com\.cn|com\.hk|com\.mx|com\.my|com\.ph|com\.sg|com\.tr|com\.tw|com\.vn|de|dk|es|fr|gr|ie|it|no|pl|se)$/,/@ymail\.com$/,/@rocketmail\.com$/],c=[/@gmail\.com$/,/@googlemail\.com$/],u=t.ImportContactsForm=d.extend({isGoogleAppsEmail:!1,shouldLogImpression:!0,onLoad:function(){var e=this;this.isGoogleAppsEmail=this.is_google_apps_email,this.prevEmail=this.getEmail(),s("input[type=submit]").focus(),this.$id("@email").on("keyup",function(){e.prevEmail!=e.getEmail()&&(e.prevEmail=e.getEmail(),e.validateEmail())}),s("input[type=submit]").on("click",function(){return e.onSubmit()}),this.shouldLogImpression&&this.serverCall("log_impression").kwargs({email:this.getEmail()}).send(),s(document).on("oauth_approved",function(t,i){e.updateAndSubmitForm(i.service,i.accessToken)}),s(document).on("oauth_rejected",function(t,i){e.onOAuthRejected(i.service)})},submitForm:function(){this.$id("@contact_importer_form").submit()},updateAndSubmitForm:function(e,t){this.$id("@service").val(e),this.$id("@access_token").val(t),this.$id("@spinner").show(),this.submitForm()},onOAuthRejected:function(e){},onSubmit:function(){return!this.openOAuthDialog(this.getEmail())},getEmail:function(){return s.trim(this.$id("@email").val())},lastTimeoutId:null,validateEmail:function(){var e=this.getEmail();if(!e)return this.onOAuthEmailEntered("empty"),!1;this.lastTimeoutId&&(clearTimeout(this.lastTimeoutId),this.lastTimeoutId=null);var t=n(e,l),i=n(e,c);this.isGoogleAppsEmail=!1,this.isGoogleAppsDomainCheckQueued=!1,t?this.onOAuthEmailEntered("yahoo"):i?this.onOAuthEmailEntered("gmail"):(this.onUnknownDomainEntered(),this.lastTimeoutId=setTimeout(this.checkGoogleAppsDomain.bind(this),500))},onOAuthEmailEntered:function(e){},onUnknownEmailDomainEntered:function(){},isCheckingGoogleAppsDomain:!1,isGoogleAppsDomainCheckQueued:!1,checkGoogleAppsDomain:function(){if(this.isCheckingGoogleAppsDomain)return void(this.isGoogleAppsDomainCheckQueued=!0);this.isCheckingGoogleAppsDomain=!0;var e=this.getEmail(),t=this;this.serverCall("is_google_apps_domain").kwargs({email:e}).success(function(i){i&&(t.isGoogleAppsEmail=!0),t.onCheckGoogleAppsDomainResponse(e,i),t.isCheckingGoogleAppsDomain=!1,t.isGoogleAppsDomainCheckQueued&&(t.isGoogleAppsDomainCheckQueued=!1,t.checkGoogleAppsDomain())}).send()},onCheckGoogleAppsDomainResponse:function(e,t){},logOAuthAttempt:function(e){this.serverCall("log_contact_importer_oauth_attempt").kwargs({email:e}).send()},onGoogleOAuthCallback:function(e){if(e&&e.error===undefined){var t=e.access_token;this.updateAndSubmitForm("google",t)}else this.onOAuthRejected()},openOAuthDialog:function(e){var t=this;return!(!n(e,c)&&!t.isGoogleAppsEmail)&&(t.logOAuthAttempt(e),r.onInit(function(){var e={callback:t.onGoogleOAuthCallback.bind(t),clientid:o.googleClientId,cookiepolicy:o.googleCookiePolicy,scope:t.scopes};t.prompt_ota_install&&(e.apppackagename=o.androidAppPackageName),window.gapi.auth.signIn(e)}),!0)},getEmailDomain:function(e){return n(e,l)?"yahoo":n(e,c)||this.isGoogleAppsEmail?"google":"other"}}),h=u.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@contact_importer_form").submit(this.onFormSubmit.bind(this))},onFormSubmit:function(){return!this.child("submit").$id("@import_contacts").is(":disabled")},unsupportedMessageTimeoutId:null,clearUnsupportedMessageTimeout:function(){this.unsupportedMessageTimeoutId&&(clearTimeout(this.unsupportedMessageTimeoutId),this.unsupportedMessageTimeoutId=null)},onOAuthEmailEntered:function(e){this.$id("@spinner").hide(),this.$id("@email_import_error").hide(),this.$id("@unsupported_domain").hide(),this.$id("@form_error").hide(),this.enableSubmitButton(!0),this.clearUnsupportedMessageTimeout()},onUnknownDomainEntered:function(){this.$id("@spinner").show(),this.$id("@email_import_error").hide(),this.$id("@form_error").hide(),this.enableSubmitButton(!1),this.clearUnsupportedMessageTimeout()},onUnsupportedDomainEntered:function(){this.$id("@spinner").hide(),this.$id("@unsupported_domain").show(),this.$id("@email_import_error").show(),this.enableSubmitButton(!1)},onCheckGoogleAppsDomainResponse:function(e,t){if(this.getEmail()==e)if(t)this.$id("@spinner").hide(),this.$id("@unsupported_domain").hide(),this.enableSubmitButton(!0);else{var i=this;this.unsupportedMessageTimeoutId=setTimeout(function(){i.onUnsupportedDomainEntered()},500)}},enableSubmitButton:function(e){e?this.child("submit").$id("@import_contacts").attr("disabled",!1).removeClass("submit_button_disabled").addClass("follow_button"):this.child("submit").$id("@import_contacts").prop("disabled",!0).addClass("submit_button_disabled").removeClass("follow_button")}});t.NuxDialogImportContactsForm=h.extend({shouldLogImpression:!1,onLoad:function(){var e=this;e._super.apply(e,arguments),e.$id("@change_email_link").click(function(){return e.$id("@default_email_container").hide(),e.$id("@change_email_container").show(),!1}),"other"==e.getEmailDomain(e.getEmail())&&e.onUnsupportedDomainEntered(),e.$id("@skip").click(function(){return e.serverCall("record_step").kwargs({step_name:"skip_oauth_dialog"}).success(function(){e.emitEvent({type:a.Types.NUX_DIALOG_SKIP_NEXT_STEP,payload:{}})}).send(),!1})},onOAuthRejected:function(e){this.serverCall("record_step").kwargs({step_name:"reject_oauth"}).send()},onSubmit:function(){var e=this._super.apply(this,arguments);return e?this.serverCall("record_step").kwargs({step_name:"invalid_import_domain"}).send():this.serverCall("record_step").kwargs({step_name:"open_oauth",props:{domain:this.getEmailDomain(this.getEmail())}}).send(),e},submitForm:function(){var e=this.$id("@service").val(),t=this.$id("@access_token").val();return this.importContacts(this.getEmail(),e,t),!1},importContacts:function(e,t,i){var n=this;n.$id("@alt_spinner").show(),n.serverCall("import_contacts").kwargs({email:e,service:t,access_token:i}).liveMutate().success(function(){n.emitEvent({type:a.Types.NUX_DIALOG_NEXT_STEP,payload:{}})}).sendOnlyOnce()}})},"./app/view/embed.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./tooltip.js"),a=i("./view/modal.js").Base,r=i("./truncate.js").truncate;t.EmbedModalLink=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({aid:e.aid}).show(),e.serverCall("record_embed").kwargs({share_info:e.share_info}).send()}),s.attach(this.$id("@embed_disabled"),this.embed_disabled_text)}}),t.EmbedModal=a.extend({onLoad:function(){this._super.apply(this,arguments),this.selectAllOnFocus(this.$id("@code_area")),this.$id("@checkbox").on("click",this.toggleFullAnswer.bind(this))},selectAllOnFocus:function(e){e.focus(function(){var e=o(this);e.select(),window.setTimeout(function(){e.select()},1),e.mouseup(function(){return e.off("mouseup"),!1})})},toggleFullAnswer:function(){this.$id("@full_answer").is(":checked")?(this.$id("@truncated_preview").addClass("hidden"),this.$id("@full_preview").removeClass("hidden"),this.$id("@code_area").val(this.full_answer_code)):(this.$id("@truncated_preview").removeClass("hidden"),this.$id("@full_preview").addClass("hidden"),this.$id("@code_area").val(this.truncated_answer_code))}}),t.AnswerEmbedAnswer=n.extend({onLoad:function(){this.embedly&&(r(this.$id("@question_text").get(0),{lineHeight:"24",lines:3}),r(this.$id("@answer_header").get(0),{lines:1}))}})},"./app/view/error.js":function(e,t,i){var n=i("./webnode2.js"),o=i("./shared/core/component.js").Component,s=i("./shared/w2.context.js").CaptchaInput;t.CaptchaForm=o.extend({contextConstructor:function(){return s},onLoad:function(){n.Error.shown=!0,n.Error.hide();var e=this;e.captchaContext=e.getContext(s),e.captchaContext.on("isCaptchaFilled",function(t,i){if(i){var n=e.captchaContext.get("captchaResponse");e.serverCall("verify_captcha").kwargs({captcha_response:n}).success(function(e){e.response&&window.location.reload(!0)}).send()}})}})},"./app/view/feed.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/core/component.js").Component,s=i("./view/fixable2.js"),a=i("./truncate.js").truncate,r=i("./shared/events/index.js"),d=i("./shared/action_log.js").ActionableComponent,l=i("./unified_view/question/ask_multi_modal.js").AskMultiModal,c=i("./shared/reactBridge.js").emitEventToReactAfterLoadDelayed,u=i("./shared/log_sender.js"),h=i("./shared/window_manager.js"),p=i("./shared/client.js"),_=i("./settings.js");t.FeedMain=i("./app/view/home.js").HomeMain.extend({onLoad:function(){this._super.apply(this,arguments);var e=this,t=this.$id("@left_col_inner"),i=this.$id("@left_col");n("body").hasClass("messages_redirect")&&e.createModal("load_messages_modal").kwargs({previous_url:h.getURL(),previous_title:h.getTitle()}).webOnlyOptions({closeOnBackgroundClick:!1}).show(),e.notifBanner||i.length>0&&t.length>0&&s.makeFixable(t,{min_height:i.outerHeight()+i.offset().top,min_width:990})}}),t.ExpandableLink=o.extend({onLoad:function(){var e=this;this.$id("@show").click(function(){return e.$id("@inner_tree").removeClass("hidden"),e.$id("@show").addClass("hidden"),!1}),this.$id("@hide").click(function(){return e.$id("@inner_tree").addClass("hidden"),e.$id("@show").removeClass("hidden"),!1})}}),t.ContentPageFeedStoryItemBase=o.extend({onLoad:function(){var e=this;this.$id("@item .truncated_q_text a.more_link").html("").removeClass("more_link").removeAttr("id").addClass("read_more").attr("href",this.target_url),this.$id("@item a.lil_button.rate_up").removeAttr("id").attr("href",this.target_url),this.$id("@item .answer_content").css({cursor:"pointer"}),this.$id("@item_overlay").mousedown(function(){return e.serverCall("on_item_click").send(),!1})}}),t.ProfileFeedStoryItem=o.extend({onLoad:function(){var e=this;e.questionFeedbackLoaded=!1,e.answerFeedbackLoaded=!1,e.quoraShareFeedbackLoaded=!1,this.handleEvent(r.Types.ANSWER_VOTE_STATE,function(t){if(t.payload.aid==e.aid){"downvoted"==t.payload.state?e.showDownvoteFeedback("answer"):e.hideDownvoteFeedback("answer")}}),e.handleEvent(r.Types.QUESTION_VOTE_STATE,function(t){t.payload.qid==e.qid&&("downvoted"==t.payload.state?e.showDownvoteFeedback("question"):e.hideDownvoteFeedback("question"))}),e.handleEvent(r.Types.QUORA_SHARE_VOTE_STATE,function(t){t.payload.share_id==e.share_id&&("downvoted"==t.payload.state?e.showDownvoteFeedback("quora_share"):e.hideDownvoteFeedback("quora_share"))}),e.handleEvent(r.Types.QUESTION_CANT_ANSWER_STATE,function(t){if(t.payload.qid==e.qid){var i="passed"==t.payload.state;e.$id("@item").toggleClass("cant_answer",i)}})},scrollFeedbackToViewport:function(){var e=this.$id("@feed_item").offset().top;n(window).scrollTop()>e&&n("html, body").animate({scrollTop:e-80},1e3)},showDownvoteFeedback:function(e){var t=this;t.scrollFeedbackToViewport(),"question"==e?(t.$id("@feed_item").addClass("hidden"),t.$id("@question_feedback").removeClass("hidden"),!1===t.questionFeedbackLoaded&&t.serverCall("load_downvote_feedback").kwargs({feedback_type:"question"}).contentFor(t.$id("@question_feedback")).success(function(){t.questionFeedbackLoaded=!0}).send()):"answer"==e?(t.$id("@feed_item").addClass("hidden"),t.$id("@answer_feedback").removeClass("hidden"),!1===t.answerFeedbackLoaded&&t.serverCall("load_downvote_feedback").kwargs({feedback_type:"answer"}).contentFor(t.$id("@answer_feedback")).success(function(){t.answerFeedbackLoaded=!0}).send()):"quora_share"==e&&(t.$id("@feed_item").addClass("hidden"),t.$id("@answer_feedback").removeClass("hidden"),!1===t.quoraShareFeedbackLoaded&&t.serverCall("load_downvote_feedback").kwargs({feedback_type:"quora_share"}).contentFor(t.$id("@quora_share_feedback")).success(function(){t.quoraShareFeedbackLoaded=!0}).send())},hideDownvoteFeedback:function(e){this.$id("@feed_item").removeClass("hidden"),"question"==e?this.$id("@question_feedback").addClass("hidden"):"answer"==e&&this.$id("@answer_feedback").addClass("hidden")},getHash:function(){return this.hash}}),t.AMAFeedQuestionItem=o.extend({onLoad:function(){var e=this;e.handleEvent(r.Types.QUESTION_CANT_ANSWER_STATE,function(t){if(t.payload.qid==e.qid){"passed"==t.payload.state&&e.$id("@ama_question_item").addClass("hidden")}})}}),t.FeedBottomIndicator=o.extend({onLoad:function(){var e=this,t=this.child("feed_bottom");t&&t.onPressed&&t.onPressed(function(){e.reload()})},reload:function(){window.location.reload(!0)}}),t.AMASuggestionCard=d.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.is_group_ama?a(e.$id("@ama_suggestion_card .group_name").get(0),{lines:1}):(a(e.$id("@ama_suggestion_card .name").get(0),{lines:1}),a(e.$id("@ama_suggestion_card .sig").get(0),{lines:2}))}}),t.AMASelfServeSuggestionCard=d.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@ama_suggestion_card").on("click",function(){return u.log("react_ask_question_flow_experiment",{targetType:e.ask_question_target_type}),e.use_react_ask_question_flow?void c("openModalFlow",{transitionName:"askQuestionFlowTransition",containerProps:{easyDismissEnabled:!0,legacy:!0},initialModalProps:{name:"AskQuestion",queryVariables:{canShowTranslationStep:!1,targetType:e.ask_question_target_type,isTribeOid:!1,isUserOid:!0,isSessionOid:!1,targetOid:e.host_uid}},initialFlowData:{queryText:"",targetType:e.ask_question_target_type,targetOid:e.host_uid,sourceLocation:e.source,transitionData:{},controllerSetting:_.controller,actionSetting:_.action},postDismissCallback:function(e){e&&e.redirectUrl&&h.navigateTo(e.redirectUrl,p.isNativeApp()?"present":"replace")}}):(l.open(e,"ask_user",{host_uid:e.host_uid,page_type:e.page_type,source_window_id:e.source_window_id}),!1)})}}),t.QuestionAnswerVerboseDesktop=o.extend({onLoad:function(){var e=this;e.handleEvent(r.Types.FEED_ANSWER_INLINE_EXPAND,function(t){if(t.payload.aid==e.aid){var i=e.$id("@content");i.addClass("expanded_feed_content"),i.addClass("expanded_q_text"),e.$id("@truncated_action_bar").addClass("hidden"),e.$id("@expanded_action_bar").removeClass("hidden")}})}}),t.ReshareContentReason=o.extend({onLoad:function(){var e=this;e.handleEvent(r.Types.QUORA_SHARE_VOTE_STATE,function(t){t.payload.share_id==e.original_share_id&&"upvoted"==t.payload.state&&e.serverCall("maybe_send_reshare_upvote_notif").send()}),e.handleEvent(r.Types.RESHARE_ADDED,function(t){t.payload.share_id==e.original_share_id&&e.serverCall("maybe_send_reshared_your_reshare_notif").send()})}})},"./app/view/feed/ama.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.AMAListItem=n.extend({onLoad:function(){var e=this;e.$id("@item_button").click(function(){e.is_following||e.serverCall("show_pmsg").liveMutate().send(),e.is_following=!e.is_following})}})},"./app/view/feed/answer.js":function(e,t,i){var n=i("./app/view/feed/question.js"),o=i("./shared/core/component.js").Component;t.EditableQuestionAnswerStory=n.QuestionStoryEditable.extend({getEditor:function(){return this.$id("@question_answer_story_editable")},getStory:function(){return this.$id("@answer_story")}}),t.AnswerWithActionBar=o.extend({onLoad:function(){var e=this;e.$id("@answer_story").on("click",function(){e.$id("@truncated_action_bar").addClass("hidden"),e.$id("@action_bar_expanded").removeClass("hidden")})}})},"./app/view/feed/question.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=i("./shared/util.js").firstScrollingParent,a=i("./shared/jquery.js");t.QuestionStoryEditable=n.extend({onLoad:function(){this.$editorElem=this.getEditor(),this.$storyElem=this.getStory();var e=this;this.handleEvent(o.Types.QUESTION_EDITING_STATE,function(t){t.payload.qid==e.qid&&("edit"==t.payload.state?e.openEditor():"request"==t.payload.state?e.closeEditor():"cancel"==t.payload.state&&e.closeEditor())}),this.editor_fetched=!1},getEditor:function(){return this.$id("@question_story_editable")},getStory:function(){return this.$id("@question_story")},loadEditor:function(){this.editor_fetched=!0,this.serverCall("load_editor").contentFor(this.$editorElem).send()},openEditor:function(){var e=s(this.$storyElem.get(0));e!==document.body&&a(e).scrollTop(0),this.$storyElem.addClass("hidden"),this.$editorElem.removeClass("hidden"),this.editor_fetched||this.loadEditor()},closeEditor:function(){this.$editorElem.addClass("hidden"),this.$storyElem.removeClass("hidden")}}),t.QuestionStoryEditableToggled=n.extend({onLoad:function(){this.$id("@feed_question_update").on("click",this.updateQuestion.bind(this)),this.$id("@feed_question_cancel").on("click",this.closeEditor.bind(this))},updateQuestion:function(){this.emitEvent({type:o.Types.QUESTION_EDITING_STATE,payload:{qid:this.qid,state:"request"}})},closeEditor:function(){this.emitEvent({type:o.Types.QUESTION_EDITING_STATE,payload:{qid:this.qid,state:"cancel"}})}})},"./app/view/funnel.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.FunnelState=n.extend({onLoad:function(){var e=this;e.$id("@show_unstarted").click(function(){e.$id("@unstarted").show(),e.$id("@show_unstarted").hide()}),e.$id("@refresh").click(function(){window.location.reload()})}}),t.ResetFunnelLink=n.extend({onLoad:function(){var e=this;e.$id("@reset").click(function(){e.serverCall("reset_funnel").success(function(){window.location.reload()}).send()})}}),t.ActivateFunnelLink=n.extend({onLoad:function(){var e=this;e.$id("@activate").click(function(){e.serverCall("activate_funnel").liveMutate().send()})}})},"./app/view/google_.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.GoogleConnectCallbackPage=n.extend({onLoad:function(){window.close()}})},"./app/view/growl.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=!1;t.GrowlBase=n.extend({onLoad:function(e){var t=this;if(this.growl=this.$id("@growl"),t.age_sec<(e?1.5:15)){var i=!e||t.delay_sec;t.showAfter(t.delay_sec,i),t.hideAfter(t.visible_sec+t.delay_sec),document.hasFocus()||o(window).one("focus",function(){s&&(clearTimeout(t.hideTimer),t.hideAfter(t.visible_sec))})}this.growl.mouseover(function(e){t.growl.hasClass("fade_out")||(clearTimeout(t.hideTimer),t.growl.removeClass("fade_out"),t.customMouseOver())}),this.growl.mouseout(function(e){t.hideAfter(1)})},showAfter:function(e,t){var i=this;i.showTimer=setTimeout(function(){i.show(t)},1e3*e)},show:function(e){var t=this;s&&(e=!1),s=!0,e&&this.growl.addClass("fade_in"),this.growl.removeClass("fade_out").removeClass("hidden"),e&&setTimeout(function(){t.growl.removeClass("fade_in")},200)},hideAfter:function(e){this.hideTimer=setTimeout(this.hide.bind(this),1e3*e)},hide:function(){var e=this;this.growl.addClass("fade_out"),setTimeout(function(){e.growl.hasClass("fade_out")&&(e.growl.addClass("hidden").removeClass("fade_out"),s=!1)},1250)},customMouseOver:function(){}}),t.GoToFeedGrowl=t.GrowlBase.extend({onLoad:function(e){this._super.apply(this,arguments);var t=o(".FeedNavItem"),i=t.outerHeight(),n=t.outerWidth();o(".GoToFeedGrowl").css({left:-n/2,top:i+5})}})},"./app/view/home.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/debounce.js").debounce,a=i("./unified_view/toggle.js"),r=i("./shared/events/index.js"),d=i("./shared/viewport.js"),l=i("./shared/window_manager.js"),c=i("./shared/log_sender.js"),u=Math.random();t.HomeMain=n.extend({onLoad:function(){}}),t.HomeFeed=n.extend({onLoad:function(){var e=this,t=l.getURL();-1==t.indexOf("?qp_story=")&&-1==t.indexOf("?digest_story=")&&-1==t.indexOf("?ask_question=")&&-1==t.indexOf("?translate_question")||(l.replaceURL("/"),o("#feed_visibility_wrapper").removeClass("invisible")),this.handleEvent(r.Types.FEED_PAGING_DONE,function(){e.child("home_main_feed").triggerSwitch()}),c.log("feed_scroll_to_end",{event:"feed_load",logging_id:u}),window.addEventListener("scroll",s(function(e){window.innerHeight+window.scrollY>=document.body.scrollHeight&&c.log("feed_scroll_to_end",{event:"feed_end",logging_id:u})},100,{trailing:!0,maxWait:500}))}}),t.ContentPageFeed=a.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments),setTimeout(this.recordImpression.bind(this),0)},recordImpression:function(){d.isElementInViewport(this.$id("@wrapper").get(0))?c.log("funnel_impression",{impression_type:"qp_feed_impression"}):setTimeout(this.recordImpression.bind(this),200)}}),t.DesktopNuxDoneListener=n.extend({onLoad:function(){this.handleEvent(r.Types.HOME_MULTIFEED_REFRESH,function(e){l.navigateTo("/")})}})},"./app/view/layout.js":function(e,t,i){function n(e,t,i){var n=null;a.each(window.YT.players,function(i,o){o.playerId==t&&(o.state=e.data,o.state==window.YT.PlayerState.PLAYING&&o.onReady&&(o.onReady(o),o.onReady=null),n=o.player.getVideoData().video_id)}),e.data==window.YT.PlayerState.PLAYING&&o(t),i&&"function"==typeof i&&i(e.data,t,n)}function o(e){window.YT&&window.YT.players&&a.each(window.YT.players,function(t,i){i.playerId!=e&&i.player&&a("#"+i.playerId).length&&i.player.pauseVideo()})}var s=i("./shared/core/component.js").Component,a=i("./shared/jquery.js"),r=i("./shared/youtube.js"),d=i("./w2.livenode.js"),l=i("./view/livenode.js").addContentPadding,c=i("./shared/keystrokes.js"),u=i("./shared/keyboard_event_handler.js"),h=i("./shared/events/index.js"),p=i("./shared/dom.js");t.QTextImageEnlarger=s.extend({onLoad:function(){var e=this;p.onDocClick(function(t){var i=a(t);if(i.is(".qtext_image, .ui_qtext_image"))return void e.openModal(t);if(i.is(".photo_modal_bg, .photo_modal_close"))for(var n in e.masters)e.hideModal(e.masters[n]);else;})},getContainer:function(e,t){var i=this;return i.masters={},i.masters[e]||(i.masters[e]=a("
").addClass("photo_modal_container").append(a("
").addClass("photo_modal_bg")).append(a("
").addClass("photo_modal_close")).append(a("").addClass("photo_modal_img").attr("src",e)).append(a("").addClass("photo_modal_img_large").attr("src",t)))},openModal:function(e){function t(){S&&T&&(f.find(".photo_modal_img_large").css("visibility","visible"),f.find(".photo_modal_img").css("visibility","hidden"))}var i=this,n=a(e),o=n.attr("src"),s=n.attr("master_src"),r=n.hasClass("zoomable_in"),d=n.parents(".truncated_q_text").length>0,l=d;if(r&&s&&!l){var c=parseInt(n.attr("master_w")),h=parseInt(n.attr("master_h")),p=a(window).width(),_=a(window).height(),f=i.getContainer(o,s),m=!1;h>3*_&&h/c>3&&(m=!0),c>p&&(h*=(p-40)/c,c=p-40),h>_&&(c*=(_-40)/h,h=_-40);var g=n.offset().left,v=n.offset().top-a(window).scrollTop(),b=Math.round((p-n.width())/2-g),y=Math.round((_-n.height())/2-v),w=c/n.width();f.find(".photo_modal_img").css("left",g).css("top",v).css("width",n.width()).css("height",n.height()),m&&f.find(".photo_modal_img").css("visibility","hidden"),f.appendTo("body"),n.css("visibility","hidden");var E=a(document).scrollTop();a("body").css({position:"fixed",width:"100%",top:-E});var C=f.find(".photo_modal_close").outerWidth();m?f.find(".photo_modal_close").css("left",(p+parseInt(n.attr("master_w")))/2-C).css("top",(_-h)/2):f.find(".photo_modal_close").css("left",(p+c)/2-C).css("top",(_-h)/2),i.handler=function(e){27==e.keyCode&&(e.preventDefault(),i.hideModal(f))},u.push(i.handler),setTimeout(function(){f.find(".photo_modal_bg, .photo_modal_close").addClass("active"),m?f.find(".photo_modal_bg").css("height",20+parseInt(n.attr("master_h"))):f.find(".photo_modal_img").css("transform","translate3d("+b+"px,"+y+"px,0) scale("+w+")").css("-moz-transform","translate3d("+b+"px,"+y+"px,0) scale("+w+")").css("-ms-transform","translate3d("+b+"px,"+y+"px,0) scale("+w+")").css("-o-transform","translate3d("+b+"px,"+y+"px,0) scale("+w+")").css("-webkit-transform","translate3d("+b+"px,"+y+"px,0) scale("+w+")")},1);var S=!1,T=!1;setTimeout(function(){T=!0,t()},333),m&&f.css("position","fixed").css("overflow","scroll"),f.find(".photo_modal_img_large").on("load",function(){a(this).css("top",(_-h)/2),m?a(this).css("position","relative").css("left",(p-n.attr("master_w"))/2):a(this).css("left",(p-c)/2).css("width",c).css("height",h),S=!0,t()})}},hideModal:function(e){u.remove(this.handler),e.find(".photo_modal_bg, .photo_modal_close").removeClass("active"),e.find(".photo_modal_img_large").remove(),e.find(".photo_modal_img").css("visibility","visible"),e.find(".photo_modal_img").css("-webkit-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("-moz-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("-ms-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("-o-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("ms-transform","translate3d(0,0,0) scale(1)"),setTimeout(function(){a(".qtext_image, .ui_qtext_image").css("visibility","visible");var t=a("body")[0].style.top,i=Math.abs(parseInt(t));a("body").css({position:"",width:"",top:""}),i&&a(document).scrollTop(i),e.remove()},333)}}),t.QTextEmbedEnlarger=s.extend({onLoad:function(e){var t=this;e&&p.onDocClick(function(e){var i,n=a(e);n.attr("data-embed")?i=n.attr("data-embed"):(n=n.parent(),i=n&&n.attr("data-embed")),i&&n.hasClass("thumbnail")&&t.loadEmbed(n,i)})},loadEmbed:function(e,t){window.YT||(window.YT={},window.YT.players=[],window.YT.next_id=0);var i=this;r.onInit(function(){if(!window.YT.Player)return void setTimeout(i.loadEmbed.bind(i,e,t),100);if(e.hasClass("thumbnail")){e.append(t).removeClass("thumbnail");var s="YTPlayer-"+window.YT.next_id++;e.find(":first-child").attr("id",s);var a=new window.YT.Player(s,{events:{onStateChange:function(e){return n(e,s,i.onYTStateChange.bind(i))}}});window.YT.players.push({player:a,playerId:s,state:-1}),o(s)}})},onYTStateChange:function(e,t,i){this.emitEvent({type:h.Types.YT_PLAYER_STATE_CHANGE,payload:{playerState:e,playerId:t,videoId:i},scope:h.scope.GLOBAL})}}),t.GridGuide=s.extend({onLoad:function(){this.setupKeyboardShortcut()},toggle:function(){this.$id("@grid-guide").is(":visible")?this.$id("@grid-guide").fadeOut(150):this.$id("@grid-guide").fadeIn(150)},setupKeyboardShortcut:function(){c.on([71,82,73,68],this.toggle.bind(this))}}),t.BrowserWarning=s.extend({onLoad:function(){l()}}),t.LogoutNavElement=s.extend({onLoad:function(){var e=this;this.$id("@logout_link").click(function(){return e.$id("@logout_form").submit(),d.stopLiveUpdates(),!1})}}),t.Layout=s.extend({onLoad:function(){var e=this;this.FULL_BACKDROP_CLASS="full_back_drop",this.handleEvent(h.Types.LAYOUT_SET_BACKDROP,function(t){e.setFullBackdrop(t.payload)}),a(document).mousedown(function(){e.backDropActive&&e._removeBackDrop()}),u.push(function(t){27===t.keyCode&&(t.preventDefault(),e._removeBackDrop())})},setFullBackdrop:function(e){e.show?this._addBackDrop():this._removeBackDrop()},_addBackDrop:function(){this.$id("@full_body_blur").addClass(this.FULL_BACKDROP_CLASS),this.backDropActive=!0},_removeBackDrop:function(){var e=this,t=this.$id("@full_body_blur");this.backDropActive=!1,p.addAnimationClass(t,"closing",function(){t.removeClass(e.FULL_BACKDROP_CLASS+" closing")})}})},"./app/view/login.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.LogoutAllSessionsButton=n.extend({onLoad:function(){var e=this;e.$id("@logout").click(function(t){return e.serverCall("logout_all_sessions").liveMutate().send(),!1})}})},"./app/view/messages.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base,a=i("./view/modal.js"),r=i("./w2.modal.js"),d=i("./shared/viewport.js"),l=i("./shared/events/index.js"),c=i("./third_party/autosize.js"),u=i("./view/selector.js").Selector,h=i("./shared/window_manager.js"),p=100;t.MessagesMain=n.extend({onLoad:function(){var e=this;e.resizeMessages(),o(window).resize(e.resizeMessages.bind(e)),setTimeout(function(){e.show_old_anon_content_email_modal&&e.createModal("load_inner").show()},20)},resizeMessages:function(){var e=this.$id("@threads"),t=o(window).height(),i=e.offset().top;e.height(t-i)}}),t.ComposeMessageModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({to_uid:e.to_uid}).webOnlyOptions({closeOnBackgroundClick:!1}).show()})}}),t.ComposeMessageModal=s.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@change_person").on("click",function(t){e.change(),t.preventDefault()}),this.load()},load:function(){this.object_id&&this.setTo(this.object_id)},getData:function(){return this.$id("@compose_message_to_uid").val()&&(this.object_id=this.$id("@compose_message_to_uid").val()),!(!this.object_id||this.child("editor").isOnlyWhiteSpace())&&{to_uid:this.object_id,msg:this.child("editor").serialize()}},onSubmit:function(){if(!this.submitDisabled){var e=this,t=e.getData();!1!==t&&this.serverCall("submit_message").kwargs(t).success(function(){e._closeModal()}).send()}},change:function(){this.child("people_selector").setQuery(""),this.$id("@pick_people").removeClass("hidden"),this.$id("@picked_person").addClass("hidden"),this.$id("@to_name").html(""),this.child("people_selector").focus(),this.disableSubmit()},setTo:function(e){isNaN(parseInt(e))||(this.$id("@pick_people").addClass("hidden"),this.$id("@picked_person").removeClass("hidden"),this.$id("@compose_message_to_uid").val(e),this.getName(e),this.enableSubmit())},getName:function(e){var t=this;this.serverCall("get_name").kwargs({to_uid:e}).contentFor(this.$id("@to_name")).success(function(){t.child("editor").focus()}).send()}}),t.HideMessagesModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_dialog_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({thread_id:e.thread_id}).show()})}}),t.HideMessagesModal=s.extend({onSubmit:function(){if(!this.submitDisabled){var e=this;this.serverCall("hide_thread").liveMutate().success(function(){e._closeModal(),h.navigateTo("/messages")}).send()}}}),t.MarkUnreadModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_dialog_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({thread_id:e.thread_id}).show()})}}),t.MarkUnreadModal=s.extend({onSubmit:function(){if(!this.submitDisabled){var e=this;this.serverCall("mark_thread_as_unread").liveMutate().success(function(){e._closeModal(),h.navigateTo("/messages")}).send()}}}),t.ModalMessagesThreadItem=n.extend({onLoad:function(){var e=this,t=0;e.$id("@item").on("click",function(i){i.preventDefault(),t=o(this).attr("name"),e.$id("@unread_icon").addClass("hidden"),e.emitEvent({type:l.Types.MESSAGE_THREAD_CLICKED,payload:{threadId:t},scope:l.scope.GLOBAL})})}}),t.ModalMessageRecipientSelector=u.extend({onResultWasSelected:function(e){this._onResultWasSelected=e},resultWasSelected:function(e){this.setQuery(""),this.$input.blur(),this._onResultWasSelected&&this._onResultWasSelected(e.data.uid)}});var _=t.MessagesModalBase=a.MultiStep.extend({onLoad:function(){this.isActive=!0,this.currentScrollHeight=0,this._super.apply(this,arguments)},getCallBacks:function(){var e=this,t=0;return{MessagesModalThreadList:{isLastStep:!1,closeOnBackgroundClick:!1,init:function(){window.history.pushState(null,"","/messages"),document.title=e.page_title,e.handleEvent(l.Types.MESSAGE_THREAD_CLICKED,function(i){t=i.payload.threadId,e._loadNext()}),e.$id("@submit_button").on("click",function(t){t.preventDefault(),e._loadNext()}),e.$id("@show_unread_only").on("click",function(t){t.preventDefault(),e.$id("@show_unread_only").addClass("hidden")})},getStepData:function(){return{threadId:t,previous_url:e.previous_url,previous_title:e.previous_title}}},MessagesModalThreadDetail:{isLastStep:!0,closeOnBackgroundClick:!1,init:function(){e.threadId=e.$id("@thread_id").val(),window.history.pushState(null,"","/messages/thread/"+e.threadId),o(window).on("popstate",function(t){t.preventDefault(),e.isActive&&e.onBack()}),o(".thread_list a").attr("target","_blank"),setTimeout(function(){e.scrollMessageThreadToHeight()},50),e.$id("@thread").on("DOMNodeInserted",function(t){t.preventDefault();var i=t.target;(o(i).children().children().is(".ModalThreadGroupMessage")||o(i).children().children().is(".ModalThreadSingleMessage"))&&setTimeout(function(){e.scrollMessageThreadToHeight()},10)}),o(".message_textarea").attr("rows","1"),c(o(".message_textarea"))},getStepData:function(){return{previous_url:e.previous_url,previous_title:e.previous_title}}},MessagesModalComposer:{closeOnBackgroundClick:!1,init:function(){window.history.pushState(null,"","/messages/new"),o(window).on("popstate",function(t){t.preventDefault(),e.isActive&&e.onBack()}),e.$id("@change_person").on("click",function(t){e.change(),t.preventDefault()}),e.$id("@footer_back_button").on("click",function(){e.onBack()}),o(".modal_message_recipient_selector").focus(),e.load()},getStepData:function(){return{to_uid:e.$id("@compose_message_to_uid").val(),previous_url:e.previous_url,previous_title:e.previous_title}}}}},scrollMessageThreadToHeight:function(e){if(e=e||this.currentScrollHeight,this.$id("@thread")[0]){var t=this.$id("@thread")[0].scrollHeight-e;o(".modal_body").animate({scrollTop:t})}},load:function(){var e=this;this.to_uid&&this.setTo(this.to_uid),this.child("people_selector").onResultWasSelected(function(t){e.resultWasSelected(t)})},getData:function(){return this.$id("@compose_message_to_uid").val()&&(this.to_uid=this.$id("@compose_message_to_uid").val()),!(!this.to_uid||""==this.$id("@message_editor").val())&&{to_uid:this.to_uid,msg:this.$id("@message_editor").val()}},onSubmit:function(){if(!this.submitDisabled){var e=this,t=e.getData();!1!==t&&this.serverCall("submit_message").kwargs(t).success(function(){e._loadNext()}).send()}},change:function(){this.child("people_selector").setQuery(""),this.$id("@pick_people").removeClass("hidden"),this.$id("@picked_person").addClass("hidden"),this.$id("@to_name").html(""),this.child("people_selector").focus(),this.disableSubmit()},resultWasSelected:function(e){this.setTo(e)},setTo:function(e){isNaN(parseInt(e))||(this.$id("@pick_people").addClass("hidden"),this.$id("@picked_person").removeClass("hidden"),this.$id("@compose_message_to_uid").val(e),this.getName(e))},getName:function(e){var t=this;this.serverCall("get_name").kwargs({to_uid:e}).contentFor(this.$id("@to_name")).success(function(){t.$id("@message_editor").focus()}).send()},onClose:function(){this._maybeRestorePreviousURLAndTitle(),this._closeModal()},onCancel:function(){this._maybeRestorePreviousURLAndTitle(),this._closeModal()},_maybeRestorePreviousURLAndTitle:function(){var e=this.previous_url||"/",t=this.previous_title||"Home - Quora";window.history.pushState(null,"",e),document.title=t},_closeModal:function(){this.isActive=!1,r.Modal.modalFor(this).executeOnCloseCallBack(),this._super.apply(this,arguments),d.setPageScroll(!0)}});t.MessagesModalThreadDetail=_.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@show").on("click",this.loadMoreMessages.bind(this))},loadMoreMessages:function(e){this.msg_count=this.msg_count+p;var t=this.$id("@thread"),i=this.$id("@thread_placeholder");this.currentScrollHeight=t[0].scrollHeight,i.html(t.html()),t.empty(),this.serverCall("load_more_messages").kwargs({msg_count:this.msg_count}).contentFor(this.$id("@thread")).success(function(){i.empty()}).send(),this.msg_count>=this.total_msg_count&&this.$id("@show").addClass("hidden")}})},"./app/view/moderation/appeal.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base;t.AppealLink=n.extend({onLoad:function(){var e=this;this.$id("@show_appeal_modal").click(function(){return e.showAppealModal(),!1})},showAppealModal:function(){this.createModal("appeal_modal").kwargs({oid:this.oid,transition_id:this.transition_id,should_indicate_update:this.should_indicate_update}).show()}}),t.AppealModal=s.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@submit_button").addClass("submit_button_disabled");var e=this.$id("@policy_checkbox"),t=this;e.click(function(e){e.currentTarget.checked?(t.$id("@appeal_details").removeClass("hidden"),t.should_indicate_update||t.$id("@submit_button").removeClass("submit_button_disabled")):(t.$id("@appeal_details").addClass("hidden"),t.$id("@submit_button").addClass("submit_button_disabled"))}),t.$id("@appeal_type").change(function(){t.$id("@submit_button").removeClass("submit_button_disabled")});var i=this.$id("@answer_tag_details_link"),n=this.$id("@answer_tag_details_content");i.click(function(e){n.hasClass("hidden")?(n.removeClass("hidden"),i.text(t.collapse_details)):(n.addClass("hidden"),i.text(t.show_details))})},onSubmit:function(){this.appeal()},appeal:function(){var e=this.child("appeal_comment").serialize(),t=o("input:radio:checked").val(),i={comment:e,appeal_type:t};this.serverCall("send_appeal").liveMutate().kwargs(i).success(this._closeModal()).send()}})},"./app/view/moderation/flag.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base,a=i("./shared/events/index.js"),r=i("./shared/window_manager.js");t.AddModerationFlag=n.extend({onLoad:function(){var e=this;e.$id("@show_flag_dialog").on("click",function(t){e.in_menu||(t.preventDefault(),t.stopPropagation()),e.one_click_report?e.serverCall("one_click_report").liveMutate().send():e.showFlagDialog()})},showFlagDialog:function(){this.createModal("flag_modal").kwargs({targets:this.targets}).show()}}),t.AddFlagModal=s.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@show_more_reasons a").click(function(){return e.$id("@show_more_reasons").toggleClass("hidden"),e.$id("@more_reasons").toggleClass("hidden"),!1}),this.$id("@report_row").on("click","input.flag_input",function(t){e.$id("@report").prop("disabled",!1).removeClass("submit_button_disabled"),e.$id("@comment").removeClass("hidden"),e.child("comment").focus(),e.$id("@required_comment_warning").addClass("hidden"),e.$id("@required_report_reason_warning").addClass("hidden");var i=parseInt(o(t.target).eq(0).val(),10),n=parseInt(e.other_reason_id,10),s=parseInt(e.factually_incorrect_reason_id,10),a=parseInt(e.plagiarism_reason_id,10);i==n||i==s||i==a?e.$id("@optional_label").addClass("hidden"):e.$id("@optional_label").removeClass("hidden")})},onSubmit:function(){this.report()},report:function(){var e=this,t={flag_reason:this.getFlagReason(),comment:this.child("comment").serialize()};this.flag_info=t;var i=t.flag_reason==this.other_reason_id||t.flag_reason==this.factually_incorrect_reason_id;t.flag_reason?i&&this.child("comment").isOnlyWhiteSpace()?this.$id("@required_comment_warning").removeClass("hidden"):null!==t.flag_reason&&this.serverCall("flag_object").kwargs(t).liveMutate().success(function(t){e._closeModal(),t&&"/"==t[0]?r.navigateTo(t):e.shouldAddDownvote()&&e.addDownvote();var i="report",n=e.targets[0];"answer"===n.type?e.emitEvent(a.helpers.feedNegativeFeedback(n.aid,e.message,i,n.aid)):"question"===n.type?e.emitEvent(a.helpers.feedNegativeFeedback(n.qid,e.message,i,n.qid)):"hyperlink"===n.type?e.emitEvent(a.helpers.feedNegativeFeedback(n.link_id,e.message,i,n.link_id)):"board_item"===n.type&&e.emitEvent(a.helpers.feedNegativeFeedback(n.board_item_id,e.message,i,n.board_item_id))}).send():this.$id("@required_report_reason_warning").removeClass("hidden")},shouldAddDownvote:function(){for(var e=0;e0&&e.length>0&&s.makeFixable(e,{min_height:t.outerHeight()+t.offset().top,min_width:990})}}),t.SettingsNavListContents=n.extend({onLoad:function(){this._super.apply(this,arguments)}})},"./app/view/network/selector.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./view/selector.js").Selector;t.InvitePeopleSelector=o.extend({onLoad:function(){this._super.apply(this,arguments),this.$input.focus()},resultWasSelected:function(e){this.emitEvent({type:n.Types.NETWORK_INVITE_USER,payload:{uid:e.data.uid,email:e.data.email}})}})},"./app/view/notifications.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js"),s=i("./shared/events/index.js"),a=i("./shared/jquery.js");t.NotificationsMain=n.extend({onLoad:function(){o.makeFixable(this.$id("@notifs_nav"),{min_width:990})}}),t.NotificationsClearButton=n.extend({onLoad:function(){var e=this;this.$id("@clear").on("click",function(t){t.preventDefault();var i=a(".js_notif_dropdown .js_notif_item").length;e.serverCall("mark_as_seen").liveMutate().kwargs({limit:i}).success(function(e){e||s.DocumentProxy.dispatch({type:s.Types.NOTIFS_HIDE_DROPDOWN,payload:{}})}).send()})}}),t.MarkAllAsReadLink=n.extend({onLoad:function(){this.$id("@link").on("click",this.markAllRead.bind(this))},markAllRead:function(e){e.preventDefault(),this.emitEvent({type:s.Types.NOTIFS_MARK_ALL_READ,payload:{},scope:s.scope.GLOBAL}),this.$id("@wrapper").toggleClass("hidden"),this.serverCall("request").liveMutate().send()}})},"./app/view/notifications/base.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/events/index.js"),s=i("./shared/action_log.js").ActionableComponent;t.NotifBase=s.extend({onLoad:function(){this._super.apply(this,arguments),this.handleEvent(o.Types.NOTIFS_MARK_ALL_READ,this.removeUnseen.bind(this));var e=this;this.handleEvent(o.Types.NOTIF_MARK_AS_READ,function(t){t.payload.sncid==e.sncid&&e.markAsSeen(null)}),this.actionBar&&this.$id("@content_toggle").on("click",function(t){t.preventDefault(),e.$id("@notif_content").removeClass("hidden"),e.$id("@content_toggle").addClass("hidden")}),this.$id("@notif a").on("click",function(t){if(!n(this).parent().parent().hasClass("overflow_link")&&!n(this).parent().hasClass("multi_state_button")){"#"==n(this).attr("href")&&t.preventDefault();var i=n(this).attr("id"),o=i&&i.indexOf("overflow_menu_item")>=0;e.$id("@notif").hasClass("unseen")&&e.markAsSeen(o)}})},removeUnseen:function(){this.$id("@notif").removeClass("unseen").addClass("seen")},markAsSeen:function(e){var t=this;this.removeUnseen(),this.serverCall("mark_as_seen").kwargs({is_overflow_menu_item:e}).success(function(e){e||t.emitEvent({type:o.Types.NOTIFS_HIDE_DROPDOWN,payload:{}})}).send()}})},"./app/view/notifications/header.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/window_manager.js");t.TitleNotificationsCount=n.extend({onLoad:function(e){e||this.setTitle()},setTitle:function(){var e=o.getTitle(),t=e,i="",n=this.notif_count+this.inbox_count;n&&(i="("+n+") "),t=e.replace(/^\(((\d+)?\|)?\d+\) |/,i),e!=t&&o.setTitle(t)}})},"./app/view/nux.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.HeaderProgressBar=n.extend({onLoad:function(){window.isReactPage?setTimeout(this.setup.bind(this),500):this.setup()},setup:function(){this.$id("@progress_bar").css({width:this.getWidth()});var e=this;this.handleEvent(o.Types.NUX_PROGRESS_BAR_STEP,function(t){var i=t.payload.step||this.curr;e.update(i)})},getWidth:function(){var e=this.$id("@progress_bar_wrapper"),t=parseInt(e.css("min-width"),10),i=parseInt(e.css("width"),10),n=this.curr/this.total*i;return Math.min(i,Math.max(n,t))},update:function(e){this.curr=e,this.$id("@progress_bar").animate({width:this.getWidth()})}}),t.HeaderProgressBarBeacon=n.extend({onLoad:function(){this.emitEvent({type:o.Types.NUX_PROGRESS_BAR_STEP,payload:{step:this.curr}})}})},"./app/view/nux/dialog.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./w2.dialog.js").Dialog,r=i("./w2.modal.js").Modal,d=i("./shared/viewport.js"),l=i("./shared/log_sender.js"),c=i("./shared/window_manager.js"),u=i("./shared/datetime.js");t.ModalNuxDialogCloseIndicator=n.extend({onLoad:function(){this.emitEvent({type:s.Types.NUX_DIALOG_CLOSE,payload:{}})}}),t.ModalNuxDialog=n.extend({onLoad:function(e){this.lastStep=null,d.setPageScroll(!1);var t=this;this.handleEvent(s.Types.NUX_DIALOG_CLOSE,function(e){e.payload.no_hide||t.hide()}),this.handleEvent(s.Types.NUX_FEED_REFRESH,function(e){t.$id("@background").hide()}),e&&l.log("nux_dialog_impression",{}),o(window).height()<600&&o(".dialog .dialog_wrapper").css("position","static")},hide:function(){this.$id("@modal_nux_wrapper").hide(),d.setPageScroll(!0)}}),t.InternalModalNuxDialogRenderer=t.ModalNuxDialog.extend({onLoad:function(e){var t=this;this.curr_step=this.step_num,o("body").keydown(function(e){37==e.keyCode&&t.curr_step>0?t.changeStep(t.curr_step,--t.curr_step):39==e.keyCode&&t.curr_stepthis.num_steps+1&&this.closeDialog(),this.gotoStep(e)},closeDialog:function(){var e=this;this.emitEvent({type:s.Types.NUX_DIALOG_CLOSE,payload:{no_hide:e.nux_redirect_url!==undefined}})},gotoNextStep:function(){this.closeDialogAndGoToStep(this.step_num+1)},skipNextStep:function(){this.step_num+2<=this.num_steps?this.emitEvent({type:s.Types.NUX_PROGRESS_BAR_STEP,payload:{step:this.step_num+1}}):this.closeDialog(),this.serverCall("skip_step").kwargs({step_num:this.step_num+1}).liveMutate().send()},stepUrl:function(e){return"#step="+e},standaloneRefreshFeed:function(){this.serverCall("standalone_refresh_feed").liveMutate().send();var e=a.dialogFor(this);e?e.close_():r.getCurrentModal().close()}}),t.NuxDialogRefreshFeedStep=t.NuxDialogStep.extend({onLoad:function(){if(this._super.apply(this,arguments),this.num_attempt=0,this.MAX_ATTEMPT=3,this.initial_time_wait=3e3,this.use_placeholder_feed_refresh&&this.emitEvent({type:s.Types.NUX_FEED_REFRESH,payload:{}}),this.nux_redirect_url!==undefined)this.gotoNextStep();else if(this.duration!==undefined&&null!==this.duration){var e=this.duration*u.SECOND;this.waitThenGoToNextStep(e)}else this.maybeGoToNextStep()},waitThenGoToNextStep:function(e){setTimeout(this.gotoNextStep.bind(this),e)},maybeGoToNextStep:function(){var e=this.initial_time_wait*(this.num_attempt+1);"internal_page"!=this.page_context&&setTimeout(this.shouldShowFeed.bind(this),e)},shouldShowFeed:function(){var e=this;e.num_attempt+=1,e.num_attempt>e.MAX_ATTEMPT?(l.log("nux_feed_refresh_logger",{result:"timeout"}),e.gotoNextStep()):e.serverCall("should_show_feed").success(function(t){t?(l.log("nux_feed_refresh_logger",{result:"success"}),e.gotoNextStep()):e.maybeGoToNextStep()}).error(function(){e.serverCall("log_error"),e.gotoNextStep()}).send()},gotoStep:function(e){var t=this;this.serverCall("goto_step").kwargs({step_num:e,num_attempt:t.num_attempt}).success(function(){return t.nux_redirect_url!==undefined?c.navigateTo(t.nux_redirect_url):s.DocumentProxy.dispatch({type:s.Types.HOME_MULTIFEED_REFRESH,payload:{}}),!1}).error(function(){return s.DocumentProxy.dispatch({type:s.Types.HOME_MULTIFEED_REFRESH,payload:{}}),!1}).send()}});var h=t.NuxDialogContinueButton=n.extend({onLoad:function(){this.$id("@next").on("click",this.onClick.bind(this))},finishStep:function(){this.$id("@next").hasClass("submit_button_disabled")||(this.standalone?s.DocumentProxy.dispatch({type:s.Types.NUX_DIALOG_STANDALONE_DONE,payload:{}}):s.DocumentProxy.dispatch({type:s.Types.NUX_DIALOG_NEXT_STEP,payload:{}}))},onClick:function(){return this.finishStep(),!1}});t.NuxDialogInferredFriendsContinueButton=h.extend({onLoad:function(){this._super.apply(this,arguments),this.fuid_map={};for(var e=0;e=1)return!1;var t=Object.keys(this.tids).map(function(e){return parseInt(e,10)});this.serverCall("button_clicked").kwargs({tids:t}).liveMutate().success(this.finishStep.bind(this)).error(this.finishStep.bind(this)).send()},updateButton:function(e){var t=this.min_interests-e;t>=1?(this.child("continue_button").setDisabled(!0),this.child("continue_button").$id("@label").text(this.num_topics_texts[t])):(this.child("continue_button").setDisabled(!1),this.child("continue_button").$id("@label").text(this.button_continue_text))}}),t.DynamicTopicGrid=n.extend({onLoad:function(){var e=this;this.handleEvent(s.Types.TOPICS_GRID_ADD,function(t){t.payload.tid&&e.addTopic(t.payload.tid)}),this.handleEvent(s.Types.TOPICS_GRID_REMOVE,function(t){t.payload.tid&&e.removeTopic(t.payload.tid)}),this.handleEvent(s.Types.TOPICS_GRID_UPDATE_SHOWN,function(t){if(t.payload.newSuggestions)for(var i=0;i');var t=this.$id("@more").children(".new_items").last();this.serverCall("load_row").kwargs({tid:e}).contentFor(t).sendOnlyOnce()},getFollowingCount:function(){return this.followedTids.length},removeTopic:function(e){var t=this.followedTids.indexOf(e);-1!=t&&this.followedTids.splice(t,1)}}),t.DynamicInterestsGrid=t.DynamicTopicGrid.extend({addTopic:function(e){this._super.apply(this,arguments),this.addRow(e),this.serverCall("follow_topic").kwargs({tid:e}).send()},removeTopic:function(e){this._super.apply(this,arguments),this.serverCall("unfollow_topic").kwargs({tid:e}).send()}}),t.InterestsGridItems=n.extend({onLoad:function(){this.emitEvent({type:s.Types.TOPICS_GRID_UPDATE_SHOWN,payload:{newSuggestions:this.new_suggestions}})}}),t.ExpertiseTopicListItemRemoveButton=n.extend({onLoad:function(){this.$id("@expertise-remove-button").click(this.dismiss.bind(this))},dismiss:function(e){return e.preventDefault(),this.serverCall("remove_expertise_topic").kwargs({tid:this.tid}).liveMutate().send(),!1}}),t.LanguageListItemRemoveButton=n.extend({onLoad:function(){this.$id("@language-remove-button").click(this.dismiss.bind(this))},dismiss:function(e){return e.preventDefault(),this.serverCall("remove_language_credential").kwargs({cred_id:this.cred_id}).liveMutate().send(),!1}}),t.NuxDialogFollowExpertiseContinueButton=t.NuxDialogFollowMinimumTopicsContinueButton.extend({onClick:function(e){e.preventDefault(),this.serverCall("button_clicked").liveMutate().success(this.finishStep.bind(this)).error(this.finishStep.bind(this)).send()}}),t.LanguageListItem=n.extend({onLoad:function(){var e=this;e.$item=e.$id("@language_item"),e.$item.on("click",function(){e.$item.toggleClass("selected")})}}),t.NuxDialogFollowFromFacebookContinueButton=t.NuxDialogContinueButton.extend({onClick:function(){this.serverCall("button_clicked").liveMutate().success(this.finishStep.bind(this)).error(this.finishStep.bind(this)).send()}})},"./app/view/nux/find_friends.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js").Dialog,s=i("./facebook.js"),a=i("./shared/facebook.js"),r=i("./shared/events/index.js"),d=i("./unified_view/live_paged_list.js").PagedList;t.FacebookFindFriendsButton=s.FacebookConnectButton.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@facebook_follow_button").on("click",this.onClick.bind(this))},onClick:function(){return a.isLoaded()&&(this.serverCall("button_clicked").send(),this.connect()),!1},onLogin:function(e){this.showLoading(),this._super.apply(this,arguments)},closeDialog:function(){this.standalone&&(o.dialogFor(this).close_(),this.parent()&&this.parent().standaloneRefreshFeed())},_onLogin:function(e){var t=this.serverCall("connect_facebook").kwargs({fb_access_token:e.accessToken,fb_uid:e.userID,expires:e.expiresIn});this.live_mutate&&t.liveMutate(),t.success(this.closeDialog.bind(this)).error(this.closeDialog.bind(this)).send()},onLoginFailed:function(){this.serverCall("record_connect_failure").send()},showLoading:function(){this.$id("@normal_text").hide(),this.$id("@loading_text").show(),this.$id("@row").addClass("complete")}}),t.FriendFollowIndicatorLink=n.extend({onLoad:function(){this.$toggle=this.$id("@toggle"),this.$toggle.on("click",this.onClick.bind(this)),this.isSelected=this.$toggle.hasClass("selected");var e=this;this.handleEvent(r.Types.NUX_DIALOG_FRIENDS_UPDATE,function(t){t.payload.addAll?e.toggleSelection(!0):t.payload.removeAll&&e.toggleSelection(!1)})},toggleSelection:function(e){this.isSelected=e,this.$toggle.toggleClass("selected",e),this.$toggle.toggleClass("unselected",!e)},onClick:function(){this.toggleSelection(!this.isSelected),this.isSelected?this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{addFriend:this.fuid}}):this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{removeFriend:this.fuid}})}}),t.FriendToggleCheckbox=n.extend({onLoad:function(){this.checkbox=this.$id("@friend_row").find(":checkbox"),this.checkbox.on("change",this.onChange.bind(this));var e=this;this.$id("@friend_row").on("click",function(){e.onChange()}),this.handleEvent(r.Types.NUX_DIALOG_FRIENDS_UPDATE,function(t){t.payload.addAll?e.toggleChecked(!0):t.payload.removeAll&&e.toggleChecked(!1)})},toggleChecked:function(e){this.checkbox.prop("checked",e)},onChange:function(){this.checkbox.prop("checked")?this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{addFriend:this.fuid}}):this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{removeFriend:this.fuid}})}}),t.UnfollowedInferredFriendsToggleLink=n.extend({onLoad:function(){this.$id("@add").on("click",this.onAddClick.bind(this)),this.$id("@remove").on("click",this.onRemoveClick.bind(this));var e=this;this.handleEvent(r.Types.NUX_DIALOG_FRIENDS_UPDATE,function(t){t.payload.updateAll&&e.updateFriendsList()})},changeAll:function(e){this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{addAll:e,removeAll:!e}})},updateFriendsList:function(){this.action&&this.changeAll("add_all"==this.action)},onAddClick:function(){this.action="add_all",this.changeAll(!0),this.$id("@add").hide(),this.$id("@remove").show(),this.serverCall("button_clicked").kwargs({button_name:this.action}).send()},onRemoveClick:function(){this.action="remove_all",this.changeAll(!1),this.$id("@add").show(),this.$id("@remove").hide(),this.serverCall("button_clicked").kwargs({button_name:this.action}).send()}}),t.InferredFriendsList=d.extend({onUpdate:function(e){this._super.apply(this,arguments),this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{updateAll:!0}})}})},"./app/view/people_selector.js":function(e,t,i){var n=i("./view/selector.js").Selector,o=i("./view/selector.js").MultiSelector;t.LegacyPeopleSelector=n.extend({resultWasSelected:function(e){this.parent().setTo(e.data.uid),this.setQuery(""),this.$input.blur()}}),t.PeopleMultiSelector=o.extend({whenOnSavedResultsChanged:function(e){this._onSavedResultsChanged=e},onSavedResultsChanged:function(){this._onSavedResultsChanged&&this._onSavedResultsChanged(this.saved_results)}})},"./app/view/photo.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./shared/jquery.js"),a=i("./shared/errors.js"),r=i("./shared/window_manager.js");t.EditPhotoDialogLink=n.extend({onLoad:function(){var e=this;this.$id("@open_edit_photo").click(function(){return e.editPhoto(),!1}),e.prompt_add_photo&&e.editPhoto()},editPhoto:function(){var e=this;this._dialog||(this._dialog=o.createDialog(this,{showXButton:!0,closeOnClickOut:!0,width:550}).title(this.dialog_title).load("set_dialog_contents").close(function(){e._dialog=null}))}}),t.InlineEditPhotoChoice=n.extend({onLoad:function(){var e=this;this.$id("@choices").on("click",".choose_pic",function(t){var i=s(t.target).attr("choice");return e.serverCall("choose_photo").kwargs({choice:i}).liveMutate().success(function(){e.next_url?r.navigateTo(e.next_url):o.Dialog.dialogFor(e).close_()}).send(),e.$id("@choices").text(e.setting_text),!1})}}),t.InlineUploadPhotoWeb=n.extend({onLoad:function(){this.$id("@download").on("click",this.onClick.bind(this)),this.$id("@url").on("input",this.onChange.bind(this)),this.downloading=!1},onChange:function(){var e=this.$id("@url").val();this.$id("@download").toggleClass("hidden",!e)},onClick:function(){if(!this.downloading){var e=this.$id("@url").val();if(e){this.downloading=!0;var t=new Image;t.onload=this.downloadImage.bind(this,e),t.onerror=this.downloadImageError.bind(this),t.src=e}}},downloadImageError:function(){this.downloading=!1,alert(this.invalid_image_text),this.$id("@url").val("")},downloadImage:function(e){if(!this._contentForTarget)return void a.logJsError("InlineUploadPhotoWeb","contentFor target not set.");var t=this;this.serverCall("download").kwargs({target:this.target,url:e}).contentFor(this._contentForTarget).liveMutate().except("image_error",function(e){alert(e.message),o.Dialog.dialogFor(t).close_()}).except("thumbs_already_set",function(){o.Dialog.dialogFor(t).close_()}).success(this.onShowPhotoChoice.bind(this)).send()},focus:function(){this.$id("@url").focus()},setContentForTarget:function(e){this._contentForTarget=e},setShowPhotoChoiceCallback:function(e){this._showPhotoChoice=e},onShowPhotoChoice:function(){this._showPhotoChoice&&this._showPhotoChoice()}})},"./app/view/pmsg/pmsg.js":function(e,t,i){var n=i("./view/pmsg.js");t.FlagConfirmationPmsg=n.PMsg.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@undo").click(function(t){return e.undo(),!1})},undo:function(){this.serverCall("undo").liveMutate().send()}})},"./app/view/query/filters.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js"),s=i("./view/selector.js").Selector;t.SearchFilters=n.extend({onLoad:function(){var e=this;o.makeFixable(e.$id("@sidebar_filters"),{min_height:e.$id("@sidebar_filters").outerHeight()+e.$id("@sidebar_filters").offset().top,min_width:990})}}),t.SearchFilterAuthorSelector=s.extend({resultWasSelected:function(e){this.parent().addFilterToKey(e.data.uid)}}),t.SearchFilterTopicSelector=s.extend({resultWasSelected:function(e){this.parent().addFilterToKey(e.data.topic_routing_name)}})},"./app/view/query/query.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./w2.dialog.js"),a=i("./shared/viewport.js"),r=i("./shared/action_log.js");t.QueryResult=r.ActionableComponent.extend({onLoad:function(){this._super.apply(this,arguments),this.setDvar("query_id",this.query_id),this.setDvar("index",this.index);var e="_blank";this.compact&&(e="_parent"),this.$id('@title a[href!="#"]').attr("target",e),this.$id('@content a[href!="#"]').attr("target",e),this.checkHighlight(),this.unseen.bound||(document.addEventListener("scroll",this.recordPrivateViews.bind(this)),setTimeout(this.recordPrivateViews.bind(this),400),this.unseen.bound=!0),this.unseen.items[this.cid]=this,this.view_item=[this.type,this.object_id]},navigateToObject:function(){var e=this.$id("@title a").attr("href");window.open(e,"_parent")},checkHighlight:function(){var e=this.$id("@title").get(0),t=this.$id("@content").get(0);(null==e||null==t||(e.innerHTML+t.innerHTML).indexOf("matched_term")<0)&&this.serverCall("log_highlight_error").send()},unseen:{bound:!1,items:{},lastCheckTime:0,rateLimit:500},recordPrivateViews:function(){var e=+new Date;if(!(e0&&t[0].serverCall("log_private_views").kwargs({view_items:i}).send()}}}),t.QueryResultRankingMetadata=n.extend({onLoad:function(){var e=this;this.$id("@metadata").click(function(){var t=e.$id("@metadata").parent().hasClass("expanded");o(".metadata").parent().removeClass("expanded"),t||e.$id("@metadata").parent().addClass("expanded")})}}),t.QueryResults=n.extend({onLoad:function(){var e=this;this.$id("@create_topic_link").click(function(){return s.createDialog(e).load("create_topic_dialog"),!1})}})},"./app/view/question.js":function(e,t,i){var n=i("./shared/core/component.js"),o=n.Component,s=i("./shared/debounce.js").debounce,a=i("./view/dialog.js"),r=i("./shared/impression_tracker.js"),d=i("./tooltip.js"),l=i("./shared/jquery.js"),c=i("./shared/events/index.js"),u=i("./shared/viewport.js"),h=i("./shared/window_manager.js"),p=i("./view/inline_editor.js").InlineEditor,_=i("./shared/scroll_animation_handler.js"),f=i("./view/fixable2.js"),m=i("./shared/log_sender.js"),g=i("./unified_view/toggle.js"),v=i("./shared/question_page_reading_time.js"),b=i("./shared/question_answer_page_reading_time.js"),y=i("./shared/google_tag_services.js"),w=c.Types,E=t.NewGridQuestionPage=o.extend({onLoad:function(){var e=this;e.handleEvent(w.QUESTION_DELETE_STATE_CHANGE,function(t){t.payload.qid==e.qid&&h.reload()})}}),C=r.createTracker(function(e){m.log("question_page_monitoring",e)}),S=.5,T=1e3,k=r.createTracker(function(e,t,i){m.log("adx_impression",e.impression_data)},{ratioThreshold:S,minTimeInViewMs:T,exitViewport:!1,oneOffTracking:!0});t.QuestionMain=E.extend({onLoad:function(e){this._super.apply(this,arguments),e&&this.record_impression&&setTimeout(function(){m.log("funnel_impression",{impression_type:"question_page_impression"})},1e3);var t=this;r.startWindowTracker(function(e){e.page_oid=t.qid,e.target_type=1,m.log("viewport_info_on_unload",e)});var i={qid:this.qid,component_type:"question_main"};C.observe(this.$id("@grid").get(0),i)}}),t.RelatedQuestions=g.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e={qid:this.qid,component_type:"related_questions"};C.observe(this.$id("@related_questions").get(0),e)},switchStart:function(){this._super.apply(this,arguments),this.should_show_right_rail_adx_ads&&this.$id("@inline_ask_button").addClass("hidden")},switchEnd:function(){this._super.apply(this,arguments),this.emitEvent({type:c.Types.RELATED_QUESTIONS_EXPAND,payload:{elem:this.$switchShow}})}}),t.RelatedQuestionsList=o.extend({onLoad:function(){var e=this,t=!1;if(!this.inline&&!this.is_expanded&&!e.should_show_right_rail_adx_ads){var i=e.$id("@related_questions_list").get(0),n=0;l(".EquivalentQuestionsInOtherNetworks")[0]&&(n=150);var o=e.$id("@related_questions_list").height()+l(".SiteHeader").height()+n+30;if(o>l(window).height()&&(t=!0),t){var s=l(i).find(".related_question").slice(8);i&&f.makeFixable(i,{scroll_dep:!0,min_scroll_callback:function(){return o},min_height:0,footer:l(".first_content_page_feed").get(0)}),_.add(window,function(){window.scrollY>o?s.addClass("hidden"):s.removeClass("hidden")})}else i&&f.makeFixable(i,{scroll_dep:!0,min_height:o,min_scroll:l(i).offset().top-83,footer:l(".first_content_page_feed").get(0),max_scroll_callback:function(){return document.documentElement.scrollHeight-1200}})}}}),t.QuestionArea=o.extend({onLoad:function(){this._super.apply(this,arguments),this._detailsOverLimit=!1,this._textOverLimit=!1;var e=this;this.handleEvent(c.Types.QUESTION_EDITING_STATE,function(t){t.payload.qid==e.qid&&("edit"==t.payload.state?e.editLinkClicked():"cancel"==t.payload.state?e.cancelLinkClicked():"text_limit"==t.payload.state?e._textOverLimit=t.payload.is_over:"details_limit"==t.payload.state&&(e._detailsOverLimit=t.payload.is_over))}),e.$id("@question_update").click(function(t){t.preventDefault(),e.emitEvent({type:c.Types.QUESTION_EDITING_STATE,payload:{qid:e.qid,state:"request"}}),e.$id("@form_button_container").addClass("hidden"),e.block_details_edit&&e.$id("@details_container").removeClass("hidden")}),e.$id("@question_cancel").click(function(t){t.preventDefault(),e.emitEvent({type:c.Types.QUESTION_EDITING_STATE,payload:{qid:e.qid,state:"trigger_cancel"}}),e.$id("@form_button_container").addClass("hidden"),e.block_details_edit&&e.$id("@details_container").removeClass("hidden")})},editLinkClicked:function(){this.$id("@form_button_container").removeClass("hidden"),this.block_details_edit&&this.$id("@details_container").addClass("hidden")},cancelLinkClicked:function(){this.$id("@form_button_container").addClass("hidden"),this.block_details_edit&&this.$id("@details_container").removeClass("hidden")},updateButton:function(){this.$id("@question_update").toggleClass("disabled",this._textOverLimit||this._detailsOverLimit),this.block_details_edit&&this.$id("@details_container").removeClass("hidden")}});var x=p.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(c.Types.QUESTION_EDITING_STATE,function(t){t.payload.qid==e.id&&("edit"==t.payload.state?e.editorShown||e.toggle_editor():"cancel"==t.payload.state?e.editorShown&&e.toggle_editor():"request"==t.payload.state?e.trigger_request():"trigger_cancel"==t.payload.state&&e.trigger_cancel())})},onEditLinkClick:function(){this.emitEvent({type:c.Types.QUESTION_EDITING_STATE,payload:{qid:this.id,state:"edit"}})},cancelEditor:function(){this._super.apply(this,arguments),this.emitEvent({type:c.Types.QUESTION_EDITING_STATE,payload:{qid:this.id,state:"cancel"}})}});t.QuestionTextInlineEditor=x.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.editor.setLengthChangeCallback(function(t){e.emitEvent({type:c.Types.QUESTION_EDITING_STATE,payload:{qid:e.id,state:"text_limit",is_over:t}})})}}),t.FeedQuestionTextInlineEditor=t.QuestionTextInlineEditor.extend({toggle_editor:function(){}}),t.QuestionDetailsInlineEditor=x.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.editor.setLengthChangeCallback(function(t){e.emitEvent({type:c.Types.QUESTION_EDITING_STATE,payload:{qid:e.id,state:"details_limit",is_over:t}})})}}),t.FeedQuestionDetailsInlineEditor=t.QuestionDetailsInlineEditor.extend({toggle_editor:function(){}}),t.QuestionDeleteUndeleteLink=o.extend({onLoad:function(){var e=this;this.$id("@undelete_question_link").click(function(){return e.createModal("question_undelete_modal").onSubmit(function(){e._request("undelete_question")}).show(),!1})},_request:function(e){var t=this;this.serverCall(e).kwargs({qid:this.qid}).success(function(){t.emitEvent(c.helpers.changeQuestionDeletionState(t.qid))}).liveMutate().send()}}),t.QuestionDeleteDialog=a.AddCommentDialog.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.setSuccessCallback(function(){e.emitEvent(c.helpers.changeQuestionDeletionState(e.object_id))})},getPars:function(){return(!this.comment_required||!this.editor.isOnlyWhiteSpace())&&{comment:this.editor.serialize(),review:this.review}}}),t.AnswerPermaLink=o.extend({onLoad:function(){this.tooltip&&d.attach(this.$id("@link"),this.tooltip)}}),t.AnswerUndeleteBanner=o.extend({onLoad:function(){var e=this;e.$id("@answer_undelete").on("click",function(t){e.createModal("load_answer_undelete_modal").onSubmit(function(){e.serverCall("unremove_answer").kwargs({aid:e.aid}).liveMutate().send()}).show()}),e.$id("@answer_edit").on("click",function(t){e.emitEvent(c.helpers.inlineEditorEdit("answer",e.aid))})}}),t.CreateAnswerWikiLink=o.extend({onLoad:function(){this.$id("@create_answer_wiki").click(function(e){l("#answer_wiki").toggleClass("hidden"),e.preventDefault()})}}),t.QuestionAnswerMain=o.extend({onLoad:function(e){e&&setTimeout(function(){m.log("funnel_impression",{impression_type:"answer_page_impression"})},1e3),this.recordStep("share_impression")},recordStep:function(e){this.serverCall("record_step").kwargs({step_name:e}).send()}});var A=E;t.QuestionAnswerPageMain=A.extend({onLoad:function(e){var t=this;this._super.apply(this,arguments),t.prompt_topic_bio?t.createModal("credentials_modal").kwargs({aid:t.aid}).show():t.prompt_share_answer&&t.createModal("share_answer_modal").kwargs({aid:t.aid}).show(),e&&setTimeout(function(){m.log("funnel_impression",{impression_type:"answer_page_impression"})},1e3),this.recordStep("share_impression"),b.startLogging(t.aid)},recordStep:function(e){this.serverCall("record_step").kwargs({step_name:e}).send()}});var L=t.AnswerPagedListItem=o.extend({onLoad:function(){this.waitMs=50,0===this.index?this.setupCustomSignupWallTrigger():1==this.index&&l(document).on("scroll",s(this.surveyScrollTrigger.bind(this),this.waitMs)),v.registerAnswerComponent(this.child("answer"),this.aid)},setupCustomSignupWallTrigger:function(){this.triggerPercent!==undefined&&l(document).on("scroll",s(this._maybeTriggerSignupWall.bind(this),this.waitMs))},_maybeTriggerSignupWall:function(){var e=n.getLiveDomElement(this.cid),t=u.percentScrolledPastViewport(e);(this.triggerPercent0}});t.AnswerPageAnswer=L.extend({onLoad:function(){this.setupCustomSignupWallTrigger(),-1!=h.getURL().indexOf("?pa_story=")&&h.removeURLParam("pa_story")}}),t.QuestionPageGoogleXAd=o.extend({onLoad:function(){var e=this;y.onInit(function(){googletag.cmd.push(function(){googletag.defineSlot(e.slot_name,[300,250],e.div_gpt_ad_id).addService(googletag.pubads()),googletag.pubads().enableSingleRequest(),googletag.pubads().collapseEmptyDivs(),"non_personalized"===e.behavior&&googletag.pubads().setRequestNonPersonalizedAds(1),googletag.pubads().addEventListener("slotRenderEnded",function(t){t.isEmpty||k.observe(e.$id("@ad").get(0),{impression_data:{qid:e.qid,advertiserId:t.advertiserId,campaignId:t.campaignId,creativeId:t.creativeId,size:t.size}})}),googletag.enableServices()}),googletag.cmd.push(function(){googletag.display(e.div_gpt_ad_id)})}),l(document).on("scroll",s(this.fixAdxAdUnit.bind(this),10)),e.handleEvent(w.RELATED_QUESTIONS_EXPAND,function(){e.fixAdxAdUnit()})},fixAdxAdUnit:function(){var e=83,t=l(".layout_2col_side")[0];window.innerHeight>t.clientHeight+e?(t.style.position="sticky",t.style.top=e+"px"):t.style.position="inherit"}})},"./app/view/question/add_answer.js":function(e,t,i){var n=i("./shared/core/component.js"),o=n.Component,s=i("./shared/jquery.js"),a=i("./view/inline_editor.js").InlineEditor,r=i("./shared/window_manager.js"),d=i("./view/modal.js").Base,l=i("./shared/action_log.js"),c=i("./shared/client_log.js"),u=i("./shared/log_sender.js"),h=i("./shared/upload.js");t.AnswerAdd=o.extend({onLoad:function(){var e=this;e.$id("@toggle_zen").click(function(){e.toggleZen()}),e.$id("@answer_add").find(".submit_button").click(function(){e.$id("@answer_add").hasClass("is_zen")&&e.toggleZen()});var t=this.child("editor_section").child("editor");t.whenOnLoaded(t.focusEditorInputWhenReady.bind(t))},toggleZen:function(){function e(e){27==e.keyCode&&t.toggleZen()}var t=this;t.$id("@answer_add").hasClass("is_zen")?(t.serverCall("zen_mode_exited").send(),s(document).off("keyup",e)):(t.serverCall("zen_mode_entered").send(),s(document).keyup(e)),s("body").toggleClass("zen_mode"),t.$id("@answer_add").toggleClass("is_zen"),t.$id("@zen_bg").toggleClass("hidden")}});var p=t.AnswerEditor=a.extend({onLoad:function(){this.editor=this.child("editor"),this.answerShareForm=this.child("answer_share_form"),this.editorShare=this.answerShareForm&&this.answerShareForm.child("editor_share");var e=this;this.editor.prevent_load_drop_zone=!0,this._super.apply(this,arguments),this.disclaimer_update="",this.script_banner=this.child("languageBanner"),this.editor.setFocusCallback(function(){e.focusEditor()}),this.script_banner&&this.editor.setMeaningfulChangeCallback(function(){e.script_banner.maybeRenderBanner(e.editor.doc.toPlaintext())}),this.editor.isInteractive()||this.focusEditor(),this.updated_question_modal_shown=!1,u.log("answer_editor_opened",{pageFramework:"webnode",editorFramework:"webnode",editorType:"inline"}),this.is_homepage&&u.log("home_feed_answer_gen",{framework:"webnode",event:"editor_opened"})},focusEditor:function(){this.editor.support_drag_and_drop_upload&&(this.dragAndDropFormLoaded||(this.dragAndDropFormLoaded=!0,this.editor.loadDragAndDropForm()))},focusEditorInputWhenReady:function(){var e=this;this.editor.setEditorReadyCallback(function(){e.editor.hideFakeEditor()})},showShareWarningDialog:function(){var e=this,t=this.editorShare.getValues();this.editorShare.serverCall("warning_dialog_shown").send(),this.createModal("share_warning_modal").kwargs({share_tw:t.tw}).onSubmit(function(){e.shouldShowShareWarningDialog=!1,e.input_button_obj.click()}).show()},submitHandler:function(){var e=this;this.input_button_obj.click(function(t){if(h.isVideoUploadInProgress())return e.editor.alertUploadInProgress(),!1;if(e.getEditor()&&e.isEditorEmpty())return!1;var i={};if(e.editorShare&&(i=e.editorShare.getValues()),i.tw&&e.shouldShowShareWarningDialog)return e.showShareWarningDialog(),!1;e.is_homepage&&u.log("home_feed_answer_gen",{framework:"webnode",event:"click_submit_answer"}),e.trigger_request(),t.preventDefault()})},ajax_callback:function(e){return e.ans_url&&r.navigateTo(e.ans_url),e&&e.show_updated_question_modal?(this.save_draft(!0),this.createModal("load_changed_modal").kwargs({submit_id:this.input_button_obj.attr("id"),qid:e.qid}).show(),this.updated_question_modal_shown=!0,void(this.locked=!1)):(r.sameDomainURL(e.url)&&r.navigateTo(e.url),e.unconfirmed_email&&this.createModal("load_unconfirmed_email_modal").show(),this._super.apply(this,arguments))},maybeLogAction:function(e){c.logEvent("AddAnswer",n.getAnyElement(this),{qid:this.id}),l.logSecondaryAction("AnswerAdd",null)},logSaveDraft:function(){var e=n.getAnyElement(this);c.logEvent("QuestionSaveDraft",e,{qid:this.id})},_get_kwargs:function(){var e={id:this.id,input:this.get_value(),disclaimer_update:this.disclaimer_update,updated_question_modal_shown:this.updated_question_modal_shown,redirect_to_answer_page:this.redirect_to_answer_page};return this.editorShare&&(e.share_values=this.editorShare.getValues()),e},getSaveDraftKwargs:function(){return this._super.apply(this,arguments)}});t.AnswerInFeedEditor=p.extend({ajax_callback:function(e){this.$id("@inline_editor_form").parents(".answer_editor").addClass("hidden"),this._super.apply(this,arguments)}}),t.AnswerDraftPageEditor=p.extend({onLoad:function(){this._super.apply(this,arguments),this.should_toggle_on_submit=!1,this.editor=this.child("editor"),this.editor.focus()}}),t.AnswerEditorMetadataItem=o.extend({onLoad:function(){var e=this,t=this.$id("@toggle");t.click(function(){return e.$id("@item").toggleClass("ghosted"),t.text()===e.show_text?(e.showItem(),t.text(e.hide_text)):(e.hideItem(),t.text(e.show_text)),!1})},showItem:function(){return!1},hideItem:function(){return!1}}),t.ChangedQuestionModal=d.extend({onSubmit:function(){var e=this;this._closeModal(),s("#"+e.submit_id).click()},onCancel:function(){s(".answer_editor").removeClass("hidden"),this._closeModal()},onClose:function(){s(".answer_editor").removeClass("hidden"),this._closeModal()}})},"./app/view/question/answer_tag.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./tooltip.js"),s=i("./w2.dialog.js"),a=i("./unified_view/modal.js").ModalBase,r=s.Dialog;t.AnswerTagAdminActions=n.extend({onLoad:function(){this.enabled||this.$id("@tag_options").addClass("hidden")}}),t.AnswerTagOption=n.extend({onLoad:function(){var e=this;this.$id("@select_tag").click(function(){return e._dialog=s.createDialog(e).title(e.dialog_title).load("add_tag_dialog"),!1})}}),t.AnswerSoftCollapseMenuListItem=n.extend({onLoad:function(){var e=this;e.$id("@toggle_soft_collapse").on("click",function(t){t.preventDefault(),e.serverCall("toggle_soft_collapse").liveMutate().send()})}}),t.AddTagDialog=n.extend({onLoad:function(){var e=this;this.$id("@cancel").click(function(){return r.dialogFor(e).close_(),!1}),this.$id("@add_tag").click(function(){var t=null;if(e.should_show_editor){t=e.child("editor").serialize()}var i=e.$id("@locked").is(":checked");return e.serverCall("add_tag").kwargs({comment:t,lock:i}).liveMutate().success(function(){r.dialogFor(e).close_()}).send(),!1})}}),t.AnswerTag=n.extend({onLoad:function(){var e=this;this.$id("@show_comment").click(function(){return e.$id("@comment").removeClass("hidden"),e.$id("@show_comment").addClass("hidden"),!1}),o.attach(this.$id("@remove"),this.remove_short_text),this.$id("@remove").click(function(){return e.createModal("remove_tag_modal").kwargs({aid:e.aid,tag:e.tag}).show(),!1})}}),t.SoftenAnswerTag=n.extend({onLoad:function(){var e=this;this.$id("@remove").click(function(){return e.createModal("remove_tag_modal").kwargs({aid:e.aid,tag:e.tag}).show(),!1})}}),t.RemoveTagModal=a.extend({onSubmit:function(){var e=this.child("editor"),t=e.serialize();this.serverCall("remove_tag").kwargs({comment:t}).liveMutate().send(),this.close()}}),t.AnswerCollapsedTag=n.extend({onLoad:function(){var e=this;this.$id("@show_comment").click(function(t){t.preventDefault(),e.$id("@comment").removeClass("hidden"),e.$id("@show_comment").addClass("hidden")})}})},"./app/view/question/cant_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=i("./shared/client_log.js"),a=i("./shared/perf.js");t.CantAnswerLink=n.extend({onLoad:function(){var e=this;this.$id("@cant_answer").on("click",function(t){return e._userPerceivedAction=a.startUserPerceived({hmac:e.getHmac(),method:"mark_as_cant_answer"}),s.logEvent("QuestionPass",t.target),e.emitEvent(o.helpers.addQuestionCantAnswer(e.id)),e._userPerceivedAction&&(a.finishAction(e._userPerceivedAction),e._userPerceivedAction=null),e.cantAnswer(),!1})},cantAnswer:function(){return this.serverCall("mark_as_cant_answer").disableDefaultUserPerceivedLogging().liveMutate({optimisticUpdate:!0}).send(),!1}}),t.A2ACantAnswerLink=n.extend({onLoad:function(){var e=this;this.$id("@cant_answer").on("click",function(){return e._userPerceivedAction=a.startUserPerceived({hmac:e.getHmac(),method:"decline"}),e.emitEvent(o.helpers.addQuestionCantAnswer(e.id)),e._userPerceivedAction&&(a.finishAction(e._userPerceivedAction),e._userPerceivedAction=null),e.decline(),!1})},decline:function(){return this.serverCall("decline").disableDefaultUserPerceivedLogging().liveMutate({optimisticUpdate:!0}).send(),!1}}),t.UndoCantAnswerLink=n.extend({onLoad:function(){var e=this;this.$id("@undo_cant_answer").on("click",function(){return e.emitEvent(o.helpers.removeQuestionCantAnswer(e.id)),e.undoCantAnswer(),!1})},undoCantAnswer:function(){return this.serverCall("undo_mark_as_cant_answer").liveMutate().send(),!1}})},"./app/view/question/lookup_bar.js":function(e,t,i){var n=i("./webnode2.js"),o=i("./settings.js"),s=i("./shared/core/webnode.js"),a=i("./shared/jquery.js"),r=i("./view/selector.js").WithServerCallMessageMixin,d=i("./shared/window_manager.js"),l=i("./shared/events/index.js"),c=i("./shared/debounce.js").debounce,u=i("./shared/dom.js"),h=i("./shared/siteuri.js").URI,p=i("./shared/cookies.js"),_=i("./third_party/autosize.js"),f=i("./app/view/site_header/logged_in.js").LoggedInSiteHeaderContext,m=i("./unified_view/question/ask_question.js").AskQuestionButton,g=i("./shared/reactBridge.js").emitEventToReactAfterLoadDelayed,v=i("./shared/client.js"),b=i("./shared/log_sender.js"),y=null;t.LookupBarSelector=r.extend({onLoad:function(){var e=this;y=e,this._super.apply(this,arguments),e.context=e.getContext(f),e.logged_in&&e.context.set("question_query_empty",this.isQueryEmpty()),this.$results_wrapper=this.$id("@results_wrapper"),this.$results_container.removeClass("hidden"),e.displayedRevision=0,e.currentRevision=0,e.currentOutstandingRequests=0,e.lastIssuedQuery=null,e.lastSeenQuery=null,e.lastRevisionNeedsUpdate=!1,e.cache={},e.cacheSize=0,e.focused=!0,e.shouldSimScroll=!0,e.$wrapper=e.$id("@wrapper"),e.shouldHighlightOnFocus=!e.should_autofocus,e.editingQuestionDetails=!1,e.targetType=null,e.targetOid=null,e.adding_followup=!1,e.hasResults=!1,a(document).mousedown(function(t){e.$wrapper.is(t.target)||0!==e.$wrapper.has(t.target).length||a(t.target).closest(".SiteHeader.search_focused")[0]?e.$id("@details_wrapper").has(t.target).length>0?e.showResults(!1):(e.focused||b.log("search_monitoring",{type:"bar_open"}),e.shouldSimScroll=!1,e.focused=!0,0!==e.query.trim().length?e.hasResults?e.showResults(!0):e._setQuery(e.$input.val()):e.showResults(!1)):(e.focused=!1,e.setHighlight(!1),e.showResults(!1),"forced"===e.askMode&&(e.isQueryEmpty()?(e.setAskMode(!1),e.setQuery("")):e.askMode=!0))}),e.$input.click(function(){if(e.shouldHighlightOnFocus||e.setHighlight(!0),e._queryIsPunctation(e.query)&&"forced"===e.askMode){var t=e.opening_question_punctuation.length;e.$input[0].setSelectionRange(t,t)}}),e.askMode=!1,e.showingInterstitial=!1,e.source=null,e.currentSession=0,this.handleEvent(l.Types.LOOKUP_BAR_QUESTION_DETAILS_STATE,function(t){"focused"==t.payload.state?e.showResults(!1):"shown"==t.payload.state?(e.$id("@details_wrapper").removeClass("hidden"),e.editingQuestionDetails=!0):"hidden"==t.payload.state&&(e.$id("@details_wrapper").addClass("hidden"),e.editingQuestionDetails=!1,e.$input.focus())}),this.handleEvent(l.Types.ASK_QUESTION_MODAL_SUCCESS,function(t){e.$input.val("")}),e.debouncedUpdate=c(function(){e.lastIssuedQuery!=e.lastSeenQuery?(e.query=e.lastSeenQuery,e.lastIssuedQuery=null,e.updateResults()):e.lastIssuedQuery=null},e.serverCallTimeout)},inputFocusHandler:function(){this._super.apply(this,arguments),this.shouldHighlightOnFocus&&(this.setHighlight(!0),this.isQueryEmpty()||!this.hasResults||this.editingQuestionDetails||this.showResults(!0))},inputBlurHandler:function(){if(this._super.apply(this,arguments),this.logged_in){var e=this;document.activeElement.id==e.$input.attr("id")||e.focused||(e.setHighlight(!1),e.shouldHighlightOnFocus=!0)}},handleEscKey:function(){this._super.apply(this,arguments),this.logged_in&&this.setHighlight(!1)},capitalize:function(e){return e?e=e.charAt(0).toUpperCase()+e.slice(1):e},setInputVal:function(e,t){var i=this.$input[0].selectionStart,n=this.$input[0].selectionEnd;t&&(i+=t,n+=t),this.$input.val(e),e.length>0&&this.$input[0].setSelectionRange(i,n)},_queryIsPunctation:function(e){return e===this.opening_question_punctuation+this.closing_question_punctuation||e===this.opening_question_punctuation&&e.length>0||e===this.closing_question_punctuation&&e.length>0},_setQuery:function(e,t){var i=this.capitalize(e);if(t||this.askMode&&i!==e){var n="";(e||t)&&-1==e.indexOf(this.opening_question_punctuation)&&(n=this.opening_question_punctuation);var o="";(e||t)&&-1==e.indexOf(this.closing_question_punctuation)&&(o=this.closing_question_punctuation),e=n+i+o,this.setInputVal(e,n.length)}else this.askMode&&"forced"!==this.askMode&&this._queryIsPunctation(e)&&(e="",this.setInputVal(e));if(this.length_limit&&this.logged_in){var s=e.length>this.length_limit;this.context.set("question_title_over_limit",s)}this._super.apply(this,[e])},addToCache:function(e,t){if(e in this.cache||this.cacheSize++,this.cache[e]=t,this.cacheSize>this.max_cache_size){var i=this.currentRevision+1,n=null;for(var o in this.cache)this.cache[o][1]=10&&this.query.split(" ").length>=3?this.showInterstitial("good"):this.showInterstitial("bad"),this.logMiscAction("LookupBarSetAskModeClickthrough"),this.lastRevisionNeedsUpdate=!1,this.focused=!0,this.showResults(!0))},logMiscAction:function(e){var t=this.child("results");if(t){var i=t.child("search");i&&i.processAction(e)}},submit:function(e){this.logged_in?this.should_go_to_search_on_enter?(this.logMiscAction("LookupBarPressEnterSearch"),this.goToSearch(e)):this.logMiscAction("LookupBarPressEnterNothing"):(this.logMiscAction("LookupBarPressEnterSearch"),this.goToSearch(e))},goToSearch:function(e){if(this.query.trim()){var t=h("/search?q="+encodeURIComponent(this.query).replace(/%20/g,"+")+this.keepFilters);e?d.navigateTo(t.unicode(),"present"):d.navigateTo(t.unicode())}},getQuestionDetails:function(){var e=this.child("question_details");return e?e.serialize():""},setSource:function(e){this.source=e},updateServerMessage:function(e,t){var i=this;return e?(t.url&&(i.logMiscAction("LookupBarAddQuestionSuccess"),d.navigateTo(t.url)),!1):"confirm_email"===t.type?(i.createModal("email_confirmation_dialog_contents").onSubmit(function(){i.serverCall("resend_email_confirmation").send()}).show(),!1):(i.logMiscAction("LookupBarAddQuestionFail"),i.context.set("force_enable_button",!0),i.$input.focus(),!(!t||!t.message)&&(this.$id("@server_message_title").text(t.message.title),t.message.note&&this.$id("@server_message_note").text(t.message.note),!0))},setAskingTarget:function(e,t){this.targetType=e,this.targetOid=t,this.emitEvent({type:l.Types.LOOKUP_BAR_SET_ASKING_TARGET,payload:{isCleared:null==this.targetType}})}}),t.LookupBarAskQuestionModalButton=m.extend({onClick:function(){var e=this,t=y.query;if(b.log("react_ask_question_flow_experiment",{}),this.use_react_ask_question_flow)return b.log("react_ask_question_flow_open",{page_variant:"webnode",flow_variant:"react",source_location:e.source}),void g("openModalFlow",{transitionName:"askQuestionFlowTransition",containerProps:{easyDismissEnabled:!0,legacy:!0},initialModalProps:{name:"AskQuestion",queryVariables:{canShowTranslationStep:!0,targetType:null,targetOid:0,isTribeOid:!1,isUserOid:!1,isSessionOid:!1},queryText:t},initialFlowData:{queryText:t,targetType:null,targetOid:0,sourceLocation:e.source,transitionData:{},controllerSetting:o.controller,actionSetting:o.action},postDismissCallback:function(e){e&&e.redirectUrl&&d.navigateTo(e.redirectUrl,v.isNativeApp()?"present":"replace")}});b.log("react_ask_question_flow_open",{page_variant:"webnode",flow_variant:"webnode",source_location:e.source}),y.setHighlight(!1),this.showModal(t),this.serverCall("log_ask_question_modal_opened").kwargs({source:this.source,page_type:this.page_type,initial_query:t}).send()}})},"./app/view/question/lookup_bar_details.js":function(e,t,i){var n=i("./unified_view/qtext2/editor.js").Editor,o=i("./shared/events/index.js"),s=i("./app/view/site_header/logged_in.js").LoggedInSiteHeaderContext;t.AskBarDetails=n.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.context=e.getContext(s),e.setLengthChangeCallback(function(t){e.context.set("question_details_over_limit",t),e.context.set("question_details_is_empty",e.isOnlyWhiteSpace())}),this.handleEvent(o.Types.LOOKUP_BAR_QUESTION_DETAILS_STATE,function(t){"focused"==t.payload.state?e.focus():"hidden"==t.payload.state&&(e.clear(),e.context.set("question_details_is_empty",!0))})}})},"./app/view/question/merge/_merge.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.QuestionMergeCandidates=n.extend({onLoad:function(){var e=this;e.$insertionEl=e.$id("@insert_candidate"),e.$showAllLinkEl=e.$id("@show_all_link"),e.$showAllLinkEl.click(function(t){t.preventDefault(),e.$id("@candidates .candidate").removeClass("hidden"),e.$showAllLinkEl.addClass("hidden")})},selectQID:function(e){var t,i=this;t=i.$id("@candidates input[type=radio][value="+e+"]"),t.length?t.map(function(){var e=o(this),t=o("label[for='"+e.attr("id")+"']");e.prop("checked",!0),e.change(),o(this).parent().insertAfter(i.$insertionEl),t.removeClass("hidden")}):i.serverCall("get_checkbox_content").kwargs({qid:e}).contentFor(i.$insertionEl).success(function(){i.$id("@candidates input[type=radio][value="+e+"]").prop("checked",!0),i.$id("@candidates input[type=radio][value="+e+"]").change(),i.$insertionEl.children().map(function(){o(this).insertAfter(i.$insertionEl)})}).send()},getSelectedQIDs:function(){var e,t=[];return e="@candidates input[type=radio]:checked:not(:disabled)",this.$id(e).map(function(){t.push(parseInt(this.value))}),t}}),t.QuestionMergeCanonicalPicker=n.extend({onLoad:function(){var e=this;e.$radios=e.$id("@picker input[type=radio]"),e.$radios.change(function(t){e.$radios.map(function(){var e=o(this),t=o("label[for='"+e.attr("id")+"']");t.toggleClass("selected",e.is(":checked")),t.toggleClass("not_selected",!e.is(":checked"))})})},getSelectedQID:function(){var e=this.$id("@picker input[type=radio]:checked");if(e)return parseInt(e.val())}}),t.OriginallyAnsweredBanner=n.extend({onLoad:function(){var e=this;e.$id("@remove").click(function(t){t.preventDefault(),e.serverCall("remove_banner").liveMutate().send()})}})},"./app/view/question/merge/modal.js":function(e,t,i){var n=i("./shared/window_manager.js"),o=i("./view/modal.js"),s=i("./shared/util.js");t._QuestionMergeModal=o.MultiStep.extend({onSubmitSuccess:function(e){n.navigateTo(e)},getCallBacks:function(){var e=this;return{QuestionMergeModalSelectorStep:{isLastStep:!1,getStepData:function(){var t=e.data_cache[e.key],i=e.child("candidates").getSelectedQIDs();return i.push(t.qid),s.extend(t,{selectedQIDs:i})},onSubmit:function(){if(e.child("candidates").getSelectedQIDs().length){e.disableSubmit();var t=e.data_cache.QuestionMergeModalSelectorStep,i=e.child("candidates").getSelectedQIDs();e.serverCall("submit").kwargs({qids:i,canonical_qid:t.qid}).success(function(t){e.onSubmitSuccess(t.url)}).liveMutate().send()}}}}}})},"./app/view/question/merge/selector.js":function(e,t,i){var n=i("./view/selector.js").Selector;t.QuestionMergeESSelector=n.extend({resultWasSelected:function(e){var t=this;t.parent().child("candidates").selectQID(e.data.qid),t.setQuery("")},getExtraKwargs:function(){return{ignore_qids:this.parent().child("candidates").getSelectedQIDs()}}})},"./app/view/question/not_helpful.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.CollapseAnswerLink=n.extend({onLoad:function(){var e=this;this.$id("@undo_not_collapsible").click(function(t){return e.serverCall("undo_not_collapsible").kwargs({aid:e.aid}).liveMutate().send(),!1}),this.$id("@make_uncollapsible").click(function(t){return e.serverCall("make_uncollapsible").kwargs({aid:e.aid}).liveMutate().send(),!1})}})},"./app/view/question/review_queue_view_helpers.js":function(e,t,i){var n=i("./app/view/topic_selector.js").TopicSelector,o=i("./shared/events/index.js");t.ReviewQueueAddQuestionTopicTempSelector=n.extend({addIgnoreOid:function(e){e&&this.ignore_tids.push(e)},maybeAddTopic:function(e,t){t&&-1==this.ignore_tids.indexOf(e)&&(this.addIgnoreOid(e),this.emitEvent({type:o.Types.QUESTION_TOPIC_SELECTION_ADD,payload:{selector_cname:this.cname,name:t}}))},topicWasSelected:function(e,t){this.maybeAddTopic(e,t),this.multi_topic_select?this.updateResults():(this.setQuery(""),this.blur())},createTopicWasSelected:function(e){this.maybeAddTopic(null,e),this.multi_topic_select?this.updateResults():(this.setQuery(""),this.blur())}})},"./app/view/question/suggested_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.AnswerSuggestedEditDiscardButtonInline=n.extend({onLoad:function(){var e=this;this.$id("@submit").click(function(){return e.serverCall("discard_suggested_edit").kwargs({aid:e.aid}).liveMutate().send(),!1})}})},"./app/view/question/wanted_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./shared/action_log.js").ActionableComponent,r=i("./view/selector.js").Selector,d=i("./view/editable_list.js").EditableList,l=i("./unified_view/a2a.js").A2ASelectorResultsMixin,c=i("./settings.js").interface_strings;t.A2AFiltersListContentItem=n.extend({onLoad:function(){var e=this;e.$id("@filter_item").click(function(t){var i=t.currentTarget;o(".A2AFiltersListContentItem").removeClass("nav_item_selected"),o(i).addClass("nav_item_selected");var n=o(".suggestions_page_wrapper"),s=o(".filters_list"),a=e.parent()&&e.parent().parent();a&&a.is_editing||(n.addClass("working"),s.addClass("u-disabled"),e.serverCall("filtered_list").kwargs({tid:e.tid}).contentFor(n).success(function(){n.removeClass("working"),s.removeClass("u-disabled")}).send())})}}),t.WantedAnswerSelector=r.extend(l),t.WantedAnswerSuggestions=n.extend({onLoad:function(){var e=this;this.child("selector")&&this.child("selector").focus(),this.handleEvent(s.Types.A2A_SELECTOR_TOGGLE,function(t){t.payload.show?e.$id("@cancel_button").removeClass("hidden"):e.$id("@cancel_button").addClass("hidden")})},a2aHeaderCountClicked:function(){this.$id("@a2a_suggestions").hide(),this.$id("@outstanding_requests").show()},a2aHeaderTitleClicked:function(){this.$id("@a2a_suggestions").show(),this.$id("@outstanding_requests").hide()}}),t.WantedAnswerSuggestionsWrapper=n.extend({onLoad:function(){var e=this;e.handleEvent(s.Types.A2A_EDIT_TOPIC_TOGGLE,function(t){e.topicEditToggle(t.payload.state)})},topicEditToggle:function(e){var t=this;e?(t.$id("@suggestions_overlay").removeClass("hidden"),setTimeout(function(){t.$id("@suggestions_overlay").addClass("active")},50)):(t.$id("@suggestions_overlay").removeClass("active"),setTimeout(function(){t.$id("@suggestions_overlay").addClass("hidden")},300))}}),t.AskedBy=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(){return e.createModal("load_inner").kwargs({qid:e.qid,to_uid:e.to_uid}).show(),!1})}}),t.AnswerAttributionSection=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(){return e.createModal("load_inner").kwargs({aid:e.aid,qid:e.qid}).show(),!1})}}),t.WantedAnswerWithCreditQuestionListItem=a.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.handleEvent(s.Types.QUESTION_CANT_ANSWER_STATE,function(t){t.payload.qid==e.qid&&e.passedRequest(t)})},passedRequest:function(e){var t="passed"==e.payload.state;this.$id("@item").toggleClass("cant_answer",t)}}),t.A2AFiltersList=d.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.handleEvent(s.Types.A2A_MODAL_ADD_TOPIC_FILTER,function(){e.toggleEdit(),e.child("topic_selector").focus()})},toggleEdit:function(){var e=this;e._super.apply(e,arguments),s.DocumentProxy.dispatch({type:s.Types.A2A_EDIT_TOPIC_TOGGLE,payload:{state:e.is_editing}}),e.serverCall("toggle_edit_topics").kwargs({qid:e.qid,is_editing:e.is_editing}).send()},update:function(e){var t=this;t.is_editing?(t.$id("@wrapper").addClass("is_editing"),t.editLink.text(c.done)):(t.$id("@wrapper").removeClass("is_editing"),t.editLink.text(this.edit_text),e||s.DocumentProxy.dispatch({type:s.Types.A2A_UPDATE_TOPIC,payload:{}}))}}),t.A2AFiltersListItem=n.extend({onLoad:function(){var e=this;this.$id("@remove").click(function(t){t.preventDefault(),e.serverCall("remove").success().liveMutate().send()})}})},"./app/view/quora_meets_bagel.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.QMBPage=n.extend({onLoad:function(){var e=this;e.$id("@container").on("click",".qmb_button",function(t){var i=t.target.id;return e.serverCall("take_qmb_action").kwargs({which_action:i}).success(function(){window.location.reload()}).send(),!1})}})},"./app/view/rss_feed_selector.js":function(e,t,i){var n=i("./view/selector.js").Selector,o=i("./shared/events/index.js");t.RSSFeedSelector=n.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.handleEvent(o.Types.TRIBE_RSS_SOURCE_ADDED,function(){e.setQuery("")})},setAfterResultWasSelectedCallback:function(e){var t=function(t){e(t),this.emitEvent({type:o.Types.TRIBE_RSS_SOURCE_SEARCH_RESULT_SELECTED,payload:{name:t.data.title,url:t.data.url}})};this.afterResultWasSelectedCallback=t}})},"./app/view/settings.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/inline_editor.js").InlineEditor,s=i("./shared/facebook.js"),a=i("./shared/window_manager.js"),r=i("./w2.modal.js"),d=i("./shared/core/rpc.js"),l=i("./view/modal.js").Base,c=i("./shared/fx.js"),u=i("./shared/jquery.js");t.CallbackModal=l.extend({onSubmit:function(){this._super.apply(this,arguments),r.Modal.modalFor(this).executeOnSubmitCallBack()}}),t.SettingsPhoneNumberOption=n.extend({onLoad:function(){var e=this;this.setCountryCodeText(),this.$id("@country_code").on("change",function(){e.setCountryCodeText()}),this.$id("@remove_phone_number").on("click",function(){e.serverCall("remove_phone_number").liveMutate().send()}),this.$id("@add_phone_number").on("click",function(){e.createModal("load_inner_verify_phone_number").onSubmit(function(t){e.serverCall("connect").liveMutate().send()}).show()})},setCountryCodeText:function(){var e=this,t=this.countries;u("select > option").each(function(){var i=e.$id("@country_code option:selected").text(),n=this.text,o=this.value;if(i==n)e.$id("@country_code option:selected").text(o);else for(var s in t){var a=t[s],r=a[0],d=a[1];n==d&&e.$id('@country_code option[value="'+n+'"]').text(r)}})}}),t.SettingsAccountEmailOption=n.extend({onLoad:function(){var e=this;this.$id("@add_another_email_link").click(function(t){return e.$id("@add_another_email_row").toggleClass("hidden"),e.$id("@add_email_input_row").toggleClass("hidden"),e.$id("@new_email").focus(),!1}),this.$id("@add_another_email").click(function(){var t=e.$id("@new_email").val();return!!t&&(e.serverCall("add_email").kwargs({email:t}).liveMutate().send(),!1)})}});var h=t.SettingsOption=n.extend({onLoad:function(e){var t=this;if(this.$id("@view_option_link").click(function(){return t.serverCall("check_reauth").success(function(){t.expandOption()}).send(),!1}),this.auto_open_url_hash&&e&&a.getHash().substr(0,30)=="#"+this.auto_open_url_hash){this.expandOption();var i=this.$id("@option_content").css("background-color","#E0E0E0");c.highlight(i,1500)}},expandOption:function(){this.$id("@view_option").toggleClass("hidden"),this.$id("@option_content").toggleClass("hidden")}});t.AdultSettingsOptionToggle=n.extend({onLoad:function(){var e=this;this.$id("@no_adult_content").click(function(){return e.serverCall("no_adult_content").liveMutate().send(),!1}),this.$id("@allow_adult_content").click(function(){return e.serverCall("allow_adult_content").liveMutate().send(),!1})}}),t.UserDisclaimerDialogEditor=o.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@inline_editor_cancel").click(function(){return r.Modal.modalFor(e).close(),!1}),this.$id("@inline_editor_submit").click(function(){return r.Modal.modalFor(e).close(),!1})}}),t.ChangePasswordOption=h.extend({onLoad:function(){this._super.apply(this,arguments),this.clear_passwords=function(){this.$id("@new_password").val(""),this.$id("@confirm_password").val("")};var e=this;this.$id("@change_password_submit").click(function(){return e.$id("@new_password").val()!==e.$id("@confirm_password").val()?(e.$id("@password_and_confirmation_mismatch").removeClass("hidden"),e.$id("@password_changed").addClass("hidden"),!1):(e.$id("@change_password_error").addClass("hidden"),e.$id("@password_and_confirmation_mismatch").addClass("hidden"),d.rpc("/settings/change_password_POST").kwargs({new_password:e.$id("@new_password").val()}).success(function(t){var i=t[0],n=t[1];e.clear_passwords(),i?e.$id("@password_changed").removeClass("hidden"):(e.$id("@password_changed").addClass("hidden"),e.$id("@change_password_error").removeClass("hidden"),e.$id("@change_password_error").text(n))}).send(),!1)})}}),t.RemoveDisclaimerOption=h.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@remove_disclaimer_submit").click(function(){return e.serverCall("remove_disclaimer").send(),!1})}}),t.GoogleConnect=n.extend({onLoad:function(){var e=this;this.$id("@google_disconnect_button").click(function(){return e.serverCall("disconnect_google").liveMutate().send(),!1})}}),t.ConfirmEmailModal=l.extend({onSubmit:function(){var e=this;e.serverCall("resend_email_confirmation").success(function(){e._closeModal()}).liveMutate().send()}}),t.RemoveEmailModal=l.extend({onSubmit:function(){var e=this;e.serverCall("remove_email").success(function(){e._closeModal()}).liveMutate().send()}}),t.EmailAddressRow=n.extend({onLoad:function(){var e=this;this.$id("@confirm_email").click(function(){return e.createModal("load_inner_confirm_email").kwargs({email:e.email}).show(),!1}),this.$id("@make_primary").click(function(){return e._serverCallHelper("set_primary_email")}),this.$id("@delete_email").click(function(){return e.createModal("load_inner_remove_email").kwargs({email:e.email}).show(),!1})},_serverCallHelper:function(e){return this.serverCall(e).kwargs({email:this.email}).liveMutate().send(),!1}}),t.BusinessEmailRow=n.extend({onLoad:function(){this.remove=this.$id("@delete_email"),this.remove.on("click",function(e){this.createModal("load_inner_remove_business_email").kwargs({email:this.business_email}).show()}.bind(this))}}),t.MutedRowToggle=n.extend({onLoad:function(){var e=this;this.$id("@unmute").click(function(t){e.serverCall("unmute").kwargs({oid:e.oid}).liveMutate().send(),t.preventDefault()}),this.$id("@mute").click(function(t){e.serverCall("mute").kwargs({oid:e.oid}).liveMutate().send(),t.preventDefault()})}}),t.BlockedUserToggle=n.extend({onLoad:function(){var e=this;this.$id("@unblock").click(function(t){e.createModal("load_unblock_modal").kwargs({oid:e.oid}).show(),t.preventDefault()}),this.$id("@block").click(function(t){e.createModal("load_block_modal").kwargs({oid:e.oid}).show(),t.preventDefault()})}}),t.FacebookAccountConnectedTo=n.extend({onLoad:function(){this.$id("@facebook_disconnect_button").on("click",this.disconnect.bind(this))},disconnect:function(){return this.serverCall("disconnect_facebook").liveMutate().success(function(){s.onInit(function(){window.FB.getLoginStatus(function(){},!0)})}).send(),!1}}),t.OptionLinkBase=n.extend({onLoad:function(){this.isChecked=this.$id("@disable").length>0,this.$checkbox=this.isChecked?this.$id("@disable"):this.$id("@enable"),this.$checkbox.on("click",this.toggleCheckbox.bind(this))},toggleCheckbox:function(){this.serverCall("toggle_option").kwargs({enabled:!this.isChecked}).liveMutate().send();var e=this;return setTimeout(function(){e.$checkbox.prop("checked",!e.isChecked),e.isChecked=!e.isChecked},100),!1}})},"./app/view/share.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/twitter.js"),s=i("./shared/facebook.js"),a=i("./shared/client_log.js");t.CopyToClipboardShareLink=n.extend({onLoad:function(){var e=this;this.$id("@link").click(function(t){t.preventDefault();var i=document.createElement("textarea");document.body.appendChild(i),i.value=e.copy_url,i.select();var n=document.execCommand("copy");i.remove(),e.serverCall("record_copy_link").kwargs({success:n,share_url:e.copy_url,share_info:e.share_info}).send(),n&&e.serverCall("link_copy_success").send()})}}),t.TwitterNetworkShare=n.extend({onLoad:function(){var e=this;o.onInit(function(){window.twttr.events.bind("tweet",function(t){e.isTweeted(t)&&(a.logEvent("ShareTwitter",t.target),e.serverCall("record_tweet").send())})}),e.$id("@share").on("click",function(t){t.preventDefault(),e.openTwitterPopup()}),e.actionButton=e.child("share_twitter"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(){e.openTwitterPopup()})},openTwitterPopup:function(){var e=this,t="500",i="400",n="True",o="width="+t+",height="+i+",resizable="+n;window.open(e.share_url,"_BLANK",o)},isTweeted:function(e){var t=this,i=String(e.target.id),n=String(t.cid);return i.indexOf(n)>-1}}),t.LineNetworkShare=n.extend({onLoad:function(){this.$id("@share").on("click",this.onClick.bind(this))},onClick:function(e){var t=this;window.open(t.line_url,"Share on LINE","height=450,width=500"),e.preventDefault()}}),t.FacebookNetworkShare=n.extend({onLoad:function(){var e=this;s.load(),e.$id("@share").on("click",e.onClick.bind(e)),e.actionButton=e.child("share_facebook"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(t){e.onClick(t)})},onClick:function(e){var t=this;return t.is_debugging_mode&&(console.log(t.share_url),console.log(t.target)),window.FB.ui({method:"feed",display:"popup",link:t.share_url},function(i){i&&i.post_id&&(a.logEvent("ShareFacebook",e.target),t.serverCall("record_facebook_share").send())}),!1}})},"./app/view/share/connect.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/siteuri.js").URI,a=t.socialConnectorBase={connectTwitter:function(e){var t=this;o(document).one("twitter_oauth_approved."+t.cid,function(i,n){var o=n.accessToken;t.serverCall("connect_twitter").kwargs({access_token_key:o.key}).liveMutate().send(),e&&e()});var i=s("/twitter/oauth_window");window.open(i.unicode(),"_BLANK","height=558,width=800")}};t.SocialConnector=n.extend(a)},"./app/view/share/form.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./app/view/share/connect.js").SocialConnector,s=i("./tooltip.js"),a={_state:{},get:function(e){return this._state[e]},set:function(e,t){this._state[e]=t}},r=o.extend({contextProperty:null,onLoad:function(){var e=this;if(this.list_item=this.$id("@share_checkbox_list_item"),this.checkbox=this.$id("@checkbox"),this.action_link=this.$id("@action_link"),this.message_preview=this.$id("@message_preview"),this.message_preview_text=this.$id("@message_preview_text"),this.label_clickable=this.$id("@label_clickable"),!this.is_disabled){var t=a.get(this.contextProperty);this.list_item.toggleClass("is_not_checked",!t),this.checkbox.prop("checked",t)}this.checkbox.on("change",function(){var t=e.isChecked();if(t&&e.needs_action)return e.remedyDisabled(),void e.checkbox.prop("checked",!1);e.logCheckboxChangedJS(t),e.list_item.toggleClass("is_not_checked",!t),a.set(e.contextProperty,t)}),this.label_clickable.on("click",function(){e.checkbox.click()}),this.action_link.on("click",function(){return e.is_disabled?e.remedyDisabled():e.editText(),!1})},logCheckboxChangedJS:function(e){this.serverCall("log_checkbox_changed_js").kwargs({is_checked:e,share_info:this.share_info}).send()},isChecked:function(){return this.checkbox.prop("checked")},remedyDisabled:function(){},beginEditingText:function(){}}),d=r.extend({contextProperty:"shareToTwitter",remedyDisabled:function(){this.connectTwitter()}});t.ShareCheckboxTwitterCompact=d.extend({onLoad:function(){this._super.apply(this,arguments),s.attach(this.list_item,this.default_text)},remedyDisabled:function(){var e=this;this.connectTwitter(function(){e.checkbox.prop("checked",!0)})}}),t.ShareForm=n.extend({getValues:function(){var e=this.child("checkbox_tw");return{tw:e&&e.isChecked()}}})},"./app/view/signup_validation.js":function(e,t,i){var n=i("./input_validate.js").InputValidator,o=i("./unified_view/signup/_signup.js").SignupContext;t.SignupValidator=n.extend({onLoad:function(){this._super.apply(this,arguments),this.signupContext=this.getContext(o),this.signupContext.get("validators")[this.id]=this}})},"./app/view/site_header.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.NonMemberSiteHeaderBase=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.SITE_HEADER_SEARCH_FOCUSED,function(t){e.$id("@header").toggleClass("search_focused",t.payload.focused)})}})},"./app/view/site_header/logged_in.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/hover_menu.js"),a=i("./shared/events/index.js"),r=i("./shared/cookies.js"),d=i("./shared/w2.context.js"),l=i("./shared/window_manager.js");t.LoggedInSiteHeaderContext=d.Context.extend({initialProperties:function(){return{question_query_empty:!0,question_title_over_limit:!1,question_details_over_limit:!1,question_details_is_empty:!0,force_enable_button:null}}}),t.LoggedInSiteHeader=n.extend({contextConstructor:function(){return t.LoggedInSiteHeaderContext},onLoad:function(){var e=this;this.handleEvent(a.Types.SITE_HEADER_SEARCH_FOCUSED,function(t){e.$id("@header").toggleClass("search_focused",t.payload.focused)})}}),t.MoreHoverMenuContents=n.extend({onLoad:function(){var e=this;this.$id("@messages_modal").on("click",function(t){e.createModal("load_messages_modal").kwargs({previous_url:l.getURL(),previous_title:l.getTitle()}).webOnlyOptions({closeOnBackgroundClick:!1}).show(),t.preventDefault()})}}),t.FeedNavBadge=n.extend({onLoad:function(){var e=this;e.should_growl&&e.serverCall("send_growl").send()}}),t.NotifsNavBadge=n.extend({onLoad:function(){var e=this;this.handleEvent(a.Types.NOTIFS_CLEAR_BADGE,function(t){e.$id("@badge").addClass("hidden"),l.setTitle(l.getTitle().replace(/^\(.+?\)/g,""))})}}),t.MoreNavItem=s.HoverMenu.extend({onLoad:function(){var e=this;e._super.apply(this,arguments),e.$id("@link").click(function(){e.serverCall("maybe_log_header_click").liveMutate().send()})}}),t.NotifsNavItemBase=s.HoverMenu.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(a.Types.NOTIFS_HIDE_DROPDOWN,function(){e.cancelHover=!0,e.doHide()})},isInvalidCloseTarget:function(e){var t=this.$id("@link"),i=".SiteHeaderHoverMenuContents";return!!(e.is(t)||e.parents(t).is(t)||e.is(i)||0!==e.parents(i).length)},doShow:function(){this.emitEvent({type:a.Types.NOTIFS_CLEAR_BADGE,scope:a.scope.GLOBAL,payload:{}}),this.serverCall("clear_badge").send(),this._super.apply(this,arguments)}}),t.NotifsHoverMenuContents=n.extend({onLoad:function(){this.$id("@dropdown").on("DOMMouseScroll mousewheel",function(e){var t=this.scrollTop,i=this.scrollHeight,n="DOMMouseScroll"==e.type?4*e.originalEvent.detail:e.originalEvent.deltaY,s=n<0;!s&&n>i-o(this).height()-t?(o(this).scrollTop(i),e.preventDefault()):s&&-n>t&&(o(this).scrollTop(0),e.preventDefault())})}}),t.MobileSiteLink=n.extend({onLoad:function(){this.$id("@mobile_link").click(function(){return r.setCookie("m","1"),window.location.reload(!0),!1})}})},"./app/view/site_header/logged_out.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.LoggedOutSiteHeader=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.SITE_HEADER_SEARCH_FOCUSED,function(t){e.$id("@header").toggleClass("search_focused",t.payload.focused)}),e.$id("@signup").click(function(){return e.serverCall("show_signup_wall_if_not_logged_in").liveMutate().send(),!1}),e.$id("@login").click(function(){return window.loginIntent=!0,e.serverCall("show_signup_wall_if_not_logged_in").liveMutate().send(),!1})}})},"./app/view/static.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.JobsMain=n.extend({onLoad:function(){var e=this;o(".expand_link").click(function(t){t.preventDefault();var i=o(this).attr("id").split("_").pop();e.$id("@expand_"+i).toggleClass("hidden"),o(this).toggleClass("active_section")}),o.easing.easeOutExpo=function(e){return 1-Math.pow(1-e,6)},o(".jobs_listing_button").click(function(t){t.preventDefault();var i=e.$id("@careers");i.length&&o("html, body").animate({scrollTop:i.offset().top-100},2500,"easeOutExpo")})}}),t.FeedbackTopicSelector=n.extend({onLoad:function(){var e=this;if(e.$id("@topic_selector").on("change",function(t){t.preventDefault();var i=parseInt(o(this).val());e.changeSelectorWithVal(i)}),window.location.search){var t=e.findGetParameter("option");e.$id("@topic_selector option").each(function(){t==o(this).val()&&(e.changeSelectorWithVal(parseInt(t)),e.$id("@topic_selector").val(t))})}},findGetParameter:function(e){var t=null,i=[];return window.location.search.substr(1).split("&").forEach(function(n){i=n.split("="),i[0]===e&&(t=decodeURIComponent(i[1]))}),t},changeSelectorWithVal:function(e){var t=this;t.serverCall("choose_selector").kwargs({feedback_type:e}).contentFor(t.$id("@faq_selector")).send(),i("./shared/log_sender.js").log("feedback_topic_selector",{feedback_type:e,is_mobile:!1})}}),t.SuggestedFAQ=n.extend({onLoad:function(){var e=this;e.$id("@need_help_button").on("click",function(){o(this).hide(),e.$id("@general_form").removeClass("hidden")})}}),t.JobListingMain=n.extend({onLoad:function(){this.$id("@apply_button").on("click",this.onClickApplyNow.bind(this))},onClickApplyNow:function(){var e=this;if(e.pixel_action)qp&&qp("track",e.pixel_action),window.location.href=e.apply_url;else if(e.pixel_url){var t=new XMLHttpRequest;t.onreadystatechange=function(){window.location.href=e.apply_url},t.open("GET",e.pixel_url,!0),t.send(null)}else window.location.href=e.apply_url;return!1}}),t.ContestMain=n.extend({onLoad:function(){var e=this;o.easing.easeOutExpo=function(e){return 1-Math.pow(1-e,6)},o(".registration_button").click(function(t){t.preventDefault();var i=e.$id("@registration");i.length&&o("html, body").animate({scrollTop:i.offset().top-100},1500,"easeOutExpo")}),e.$id("@register_wrapper").click(function(t){e.uploadResumeAndRegister()}),e.userCountry=e.$id("@user_country"),e.userCity=e.$id("@user_city"),e.userSchool=e.$id("@user_school"),e.userYear=e.$id("@user_year"),e.userLinkedIn=e.$id("@user_linkedin"),e.userResume=e.$id("@user_resume"),e.requiredErrorMsg=e.$id("@required_error_msg"),e.rulesErrorMsg=e.$id("@rules_error_msg")},uploadResumeAndRegister:function(){var e=this,t={userCountry:e.userCountry.val(),userCity:e.userCity.val(),userSchool:e.userSchool.val(),userYear:e.userYear.val(),userLinkedIn:e.userLinkedIn.val()};if(!(t.userCountry&&t.userCity&&t.userSchool&&t.userYear&&t.userLinkedIn))return void e.requiredErrorMsg.removeClass("hidden");if(e.requiredErrorMsg.addClass("hidden"),!e.$id("@rules_checkbox").is(":checked"))return void e.rulesErrorMsg.removeClass("hidden");if(e.rulesErrorMsg.addClass("hidden"),e.$id("@register_wrapper").toggleClass("hidden"),0!=e.userResume[0].files.length){var i=new FileReader;i.onload=function(i){t.resumeData=i.target.result,e.serverCall("register").kwargs(t).liveMutate().send()},i.readAsDataURL(e.userResume[0].files[0])}else e.serverCall("register").kwargs(t).liveMutate().send()}})},"./app/view/thanks.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.ThanksLink=n.extend({onLoad:function(){var e=this;this.$id("@thanks_link").click(function(){return e.serverCall("send_thanks").liveMutate().send(),!1})}})},"./app/view/thread.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=i("./qtext2/constants.js"),a=i("./third_party/autosize.js");t.ModalThreadMessageInlineEditor=n.extend({onLoad:function(){var e=this;this.disabled=!1,this.editor=this.child("editor"),this.$messageTextarea=this.$id("@message_textarea"),this.$submitButton=this.$id("@inline_editor_submit"),this.editorShown=this.show_editor,this.submitHandler(),e.focus_onload&&e.focusInput(),this.handleEvent(o.Types.MULTIMODAL_SHOW,function(){e.focus_onload&&e.focusInput()}),this.$messageTextarea.attr("rows",1),a(this.$messageTextarea),this.$messageTextarea.on("keypress",function(t){t.keyCode==s.ENTER_KEY&&t.shiftKey||t.keyCode==s.ENTER_KEY&&(t.preventDefault(),e.triggerRequest())})},submitHandler:function(){var e=this;this.$submitButton.click(function(){return e.triggerRequest(),!1})},getValue:function(){return this.is_qtext?this.editor.serialize():this.$messageTextarea.val()},getKwargs:function(){return{id:this.id,input:this.getValue()}},triggerRequest:function(){this.invokeSendMessageServerCall(this.getKwargs())},invokeSendMessageServerCall:function(e){var t=this;if(!this.disabled){this.content_type&&this.emitEvent(o.helpers.inlineEditorSubmit(this.content_type,this.id)),this.disabled=!0,this.$submitButton.addClass("disabled");var i=function(){t.disabled=!1,t.$submitButton.removeClass("disabled")};this.serverCall("send_message").kwargs(e).success(function(e){t.resetEditorState(e),i()}).error(i).except(i).liveMutate().send()}},resetEditorState:function(e){null!==e&&(this.$messageTextarea.val(""),this.$messageTextarea.attr("rows","1"),this.$messageTextarea.css("height","35px")),this._latestSavedState=null},focusInput:function(){this.$messageTextarea.focus()}}),t.ModalMessageThreadList=n.extend({onLoad:function(){this.serverCall("mark_thread_as_read").liveMutate().send()}})},"./app/view/threaded_comments.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./settings.js"),s=i("./shared/debounce.js").debounce,a=i("./shared/w2.context.js"),r=i("./shared/events/index.js"),d=i("./shared/client_log.js"),l=i("./shared/core/component.js"),c=i("./view/inline_editor.js").InlineEditor,u=i("./shared/impression_tracker.js"),h=i("./shared/log_sender.js"),p=i("./shared/window_manager.js"),_=a.Context.extend({initialProperties:function(){return{expanded:!1,visible:!0,showReplyBox:!1}}}),f=u.createTracker(function(e,t,i){h.log("comment_impression",e.impression_data)},{ratioThreshold:.5,minTimeInViewMs:500,exitViewport:!1,oneOffTracking:!0});t.TCommentUnit=n.extend({onLoad:function(){var e=this;this.has_fetched_all_comments=!1,this.prefetch_nonfeatured_comments&&!this.has_fetched_all_comments&&e.should_support_featured&&this.fetchAllComments(),e.handleEvent(r.Types.ANSWER_COMMENT_SORT_ALL,function(t){t.payload.aid==e.oid&&e.should_support_featured&&e.toggleCommentList("all")}),e.handleEvent(r.Types.COMMENT_ADD,function(t){t.payload.object_id==e.oid&&t.payload.comment_type==e.comment_type&&e.should_support_featured&&e.toggleCommentList("featured")}),e.handleEvent(r.Types.COMMENT_WRITING_FOCUS_TOGGLE,function(t){t.payload.object_id==e.oid&&t.payload.comment_type==e.comment_type&&("hide"==t.payload.state?e.$id("@toggle_links").addClass("hidden"):"show"==t.payload.state&&e.$id("@toggle_links").removeClass("hidden"))});var t=e.$id("@toggle_featured"),i=e.$id("@toggle_all");t&&t.click(function(t){t.preventDefault(),e.toggleCommentList("featured"),d.logEvent("CommentToggleRecommended",t.target)}),i&&e.$id("@toggle_all").click(function(t){t.preventDefault(),e.toggleCommentList("all"),e.should_show_view_all_link&&e.$id("@toggle_all").addClass("hidden"),d.logEvent("CommentToggleAll",t.target)}),e.setDvar("tcommentCid",this.cid)},fetchAllComments:function(){var e=this;e.has_fetched_all_comments=!0,e.serverCall("fetch_all_comments").kwargs({oid:e.oid,comment_type:e.comment_type}).contentFor(e.$id("@container_all")).sendOnlyOnce()},_switchThreadContainer:function(e){this.$id("@container_featured").toggleClass("hidden","featured"!==e),this.$id("@container_all").toggleClass("hidden","all"!==e),this.child("placeholder").setHidden("featured"!==e)},toggleAllComments:function(){this.$id("@toggle_featured").removeClass("is_selected"),this.$id("@toggle_all").addClass("is_selected"),this._switchThreadContainer("all"),this.has_fetched_all_comments||this.fetchAllComments()},toggleFeaturedComments:function(){this._switchThreadContainer("featured"),this.$id("@toggle_all").removeClass("is_selected"),this.$id("@toggle_featured").addClass("is_selected")},toggleCommentList:function(e){var t=this;"featured"==e?this.toggleFeaturedComments():this.toggleAllComments();var i={comment_type:t.comment_type,object_id:t.oid,to_sort:e};h.log("answer_comments_toggle_featured",i,{scribeOnly:!0})}}),t.TCommentListWrapper=n.extend({onLoad:function(){this.tcommentContext=this.getContext(_),this.moreLink=this.$id("@comment_list_more_link"),this.collapsedLink=this.$id("@collapsed_link"),this.isMoreLinkActive=!0,this.isFirstExpand=!0,this.offset=this.initial_limit,this.initialMoreLink=this.$id("@initial_more_link"),this.moreLink&&this.moreLink.on("click",this.handleMoreLinkClick.bind(this)),this.tcommentContext&&this.tcommentContext.on("expanded",this.handleVisible.bind(this)),this.initialMoreLink&&this.initialMoreLink.on("click",this.handleInitialMoreLinkClick.bind(this));var e=this.is_root||this.tcommentContext&&this.tcommentContext.get("expanded");this.handleVisible(null,e)},handleInitialMoreLinkClick:function(e){e.stopPropagation(),e.preventDefault(),this.initialMoreLink.toggleClass("hidden"),this.$id("@comment_list").toggleClass("hidden")},handleMoreLinkClick:function(e){e.stopPropagation(),e.preventDefault(),this.isMoreLinkActive&&(this.isMoreLinkActive=!1,this.pageComment())},handleVisible:function(e,t){this.$id("@comment_list_wrapper").toggleClass("hidden",!t),t&&this.lazy_load_children&&this.loadChildren()},pageComment:function(){var e=this;this.moreLink.addClass("hidden"),this.serverCall("page_comment").kwargs({object_id:this.object_id,reply_to_id:this.reply_to_id,level:this.level,offset:this.offset,limit:this.getNextPageLimit(),comment_type:this.comment_type}).success(function(){e.moreLink.removeClass("hidden"),e.isMoreLinkActive=!0,e.offset=e.getNextPageLimit(),(null===e.offset||e.offset>=e.num_children)&&(e.moreLink.addClass("hidden"),e.collapsedLink.removeClass("hidden")),e.isFirstExpand=!1}).error(function(){e.moreLink.removeClass("hidden"),e.isMoreLinkActive=!1}).contentFor(this.$id("@comment_list_first_level_placeholder_"+this.offset)).sendOnlyOnce()},getNextPageLimit:function(){return this.isFirstExpand?this.offset+this.offsetStep:this.offset+this.nextOffsetStep},loadChildren:function(){this.lazy_load_children&&(this.lazy_load_children=!1,this.serverCall("load_child_list").kwargs({object_id:this.object_id,reply_to_id:this.reply_to_id,level:this.level,comment_type:this.comment_type}).contentFor(this.$id("@comment_list_placeholder")).send())}}),t.TComment=n.extend({contextConstructor:function(){return _},parentComment:function(){return this.parent().parent().parent()},onLoad:function(){this.tcommentContext=this.getContext(_),this.tcommentContext.on("expanded",this.handleExpand.bind(this)),this.tcommentContext.on("visible",this.handleVisible.bind(this)),this.tcommentContext.set("expanded",this.force_expanded),this.tcommentContext.set("visible",!0),this.setDvar("tcommentCid",this.cid),this.highlightTargetComment(),f.observe(this.$id("@comment").get(0),{impression_data:{comment_id:this.id,object_type:this.comment_type,object_id:this.object_id,level:this.level,reply_to_id:this.reply_to_id}})},highlightTargetComment:function(){if(this.should_scroll_into_view){var e=this.child("content").$id("@comment_inner");p.scrollIntoView(e.get(0)),e.addClass("highlighted"),setTimeout(function(){e.removeClass("highlighted")},4e3)}},handleExpand:function(e,t){this.$id("@comment_inner").toggleClass("expanded",t)},handleVisible:function(e,t){this.$id("@comment").toggleClass("hidden",!t)}}),t.TCommentReplyBox=n.extend({onLoad:function(){var e=this;this.isSubmittingComment=!1,this.editor=this.child("editor"),this.editor&&(this.editor.setMeaningfulChangeCallback(s(this.save_draft.bind(this),1e3,{maxWait:6e4})),this.editor.setMeaningfulChangeCallback(function(){e.child("add_button").setDisabled(e.editor.isOnlyWhiteSpace())})),this.tcommentContext=this.getContext(_),this.tcommentContext.on("showReplyBox",function(t,i){e.$id("@reply_box").toggleClass("hidden",!i),i&&e.maybeFocusEditor()}),this.$id("@add_comment_link").on("click",function(t){t.preventDefault(),e.addComment()}),this.tcommentContext.set("showReplyBox",!1),this.$id("@reply_box").on("focusout",function(){e.editor.isEmpty()&&(e.tcommentContext.set("showReplyBox",!1),e.emitEvent({type:r.Types.COMMENT_REPLY_FOCUS,payload:{comment_id:e.reply_to_id,comment_type:e.comment_type}}))})},getTComment:function(){var e=this.getDvar("tcommentCid");return l._safeGetComponentByCID(e)},maybeFocusEditor:function(){var e=this;setTimeout(function(){e.editor&&e.editor.focus()},0)},addComment:function(){var e=this;if(this.tcommentContext.set("showReplyBox",!1),!this.editor.isOnlyWhiteSpace()){var t=this.editor.serialize();this.isSubmittingComment=!0,this.serverCall("add_comment").kwargs({oid:this.object_id,comment:t,reply_to_id:this.reply_to_id,level:this.getTComment().level+1}).success(function(i){e.getTComment().child("t_comment_list_wrapper").num_children>0&&e.tcommentContext.set("expanded",!0),e.editor.clear(),e.isSubmittingComment=!1,e.$id("@reply_box").blur(),e.onAddCommentSuccessExtra(),r.DocumentProxy.dispatch({type:r.Types.COMMENT_ADD,payload:{object_id:e.object_id,comment_type:e.comment_type,comment_type_int:e.comment_type_int,comment_input:t,reply_to_id:e.reply_to_id,comment_id:i.comment_id}})}).error(function(){e.isSubmittingComment=!1}).sendOnlyOnce()}},save_draft:function(){this.isSubmittingComment||this.serverCall("save_draft").kwargs({content:this.editor.serialize(),window_id:o.windowId,draft_space:this.draft_space}).send()},onAddCommentSuccessExtra:function(){}}),t.TCommentAddRoot=n.extend({onLoad:function(){var e=this;this.$addRootLink=this.$id("@add_root_link"),this.isSubmittingComment=!1,this.editor=this.child("editor"),this.editor&&(this.editor.setMeaningfulChangeCallback(s(this.save_draft.bind(this),1e3,{maxWait:6e4})),this.editor.setFocusCallback(function(){e.showAddCommentButton()}),this.editor.setBlurCallback(function(){e.editor.isOnlyWhiteSpace()&&e.hideAddCommentButton()}),this.editor.setMeaningfulChangeCallback(function(){e.child("add_button").setDisabled(e.editor.isOnlyWhiteSpace())})),this.$addRootLink.on("click",function(t){t.preventDefault(),e.addComment()})},hideAddCommentButton:function(){this.$addRootLink.addClass("hidden"),this.toggleCommentSwitcher("show")},showAddCommentButton:function(){this.$addRootLink.removeClass("hidden"),this.toggleCommentSwitcher("hide")},getTComment:function(){var e=this.getDvar("tcommentCid");return l._safeGetComponentByCID(e)},toggleCommentSwitcher:function(e){var t=this;t.emitEvent({type:r.Types.COMMENT_WRITING_FOCUS_TOGGLE,payload:{object_id:t.object_id,comment_type:t.comment_type,state:e}})},addComment:function(){var e=this;if(!this.editor.isOnlyWhiteSpace()){this.isSubmittingComment=!0;var t=this.editor.serialize();this.serverCall("add_comment").kwargs({oid:this.object_id,comment:t}).success(function(i){e.editor.clear(),e.hideAddCommentButton(),e.isSubmittingComment=!1,i&&i.unconfirmed_email&&e.createModal("load_unconfirmed_email_modal").show(),i&&i.comment_id&&r.DocumentProxy.dispatch({type:r.Types.COMMENT_ADD,payload:{object_id:e.object_id,comment_type:e.comment_type,comment_type_int:e.comment_type_int,comment_input:t,reply_to_id:e.reply_to_id,comment_id:i.comment_id}})}).error(function(){e.isSubmittingComment=!1}).sendOnlyOnce()}},save_draft:function(){this.isSubmittingComment||this.serverCall("save_draft").kwargs({content:this.editor.serialize(),window_id:o.windowId,draft_space:this.draft_space}).send()}}),t.AnswerTCommentAddRoot=t.TCommentAddRoot.extend({addComment:function(){var e=this;e._super.apply(e,arguments),d.logEvent("AddAnswerComment",l.getAnyElement(this))}}),t.TCommentRepliesCollapsed=n.extend({onLoad:function(){var e=this;this.tcommentContext=this.getContext(_),this.tcommentContext.on("expanded",function(t,i){e.setHidden(i)}),this.$id("@show_child_link").on("click",function(t){t.preventDefault(),e.tcommentContext.set("expanded",!0),d.logEvent("ChildCommentToggle",t.target)}),this.setHidden(this.tcommentContext.get("expanded"))},setHidden:function(e){this.$id("@show_child_link_wrapper").toggleClass("hidden",e)}}),t.TCommentCredibility=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").click(function(t){t.preventDefault(),e.createModal("load_inner").kwargs({object_id:e.object_id,comment_id:e.comment_id,comment_type:e.comment_type}).show()})}}),t.DeleteCommentButton=n.extend({onLoad:function(){var e=this;this.$id("@delete").click(function(t){return e.deleteComment(),!1})},deleteComment:function(){this.serverCall("delete").liveMutate().send()}}),t.CommentReply=n.extend({onLoad:function(){var e=this;this.tcommentContext=this.getContext(_),this.$id("@show_reply_box_link").focus(this.startEditing.bind(this)),this.$id("@show_reply_box_link").on("click",function(t){t.preventDefault(),e.startEditing()}),this.handleEvent(r.Types.COMMENT_REPLY_FOCUS,function(t){t.payload.comment_id==e.comment_id&&t.payload.comment_type==e.comment_type&&e.$id("@show_reply_box_link").toggleClass("hidden")})},startEditing:function(){this.tcommentContext.set("showReplyBox",!0),this.emitEvent({type:r.Types.COMMENT_REPLY_FOCUS,payload:{comment_id:this.comment_id,comment_type:this.comment_type}})}}),t.TCommentFullTextInlineEditor=c.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.$id("@inline_editor_cancel").click(function(){e.cancelEditor(),e.toggleActionBar()})},_get_kwargs:function(){return{id:this.id,input:this.get_value(),comment_type:this.comment_type}},onEditLinkClick:function(){this.editorShown||(this.toggle_editor(),this.toggleActionBar())},toggleActionBar:function(){this.emitEvent({type:r.Types.COMMENT_EDIT_FOCUS,payload:{comment_id:this.id,comment_type:this.comment_type}})}})},"./app/view/threaded_comments/featured.js":function(e,t,i){var n=i("./unified_view/toggle.js"),o=i("./shared/events/index.js");t.FeedInlineAnswerAutoExpandedCommentsToggle=n.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.handleEvent(o.Types.FEED_ANSWER_INLINE_EXPAND,function(t){t.payload.aid==e.aid&&e.triggerSwitch()})}})},"./app/view/topic.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./shared/w2.context.js"),a=i("./settings.js").interface_strings;t.AddTopicAliasPrompt=n.extend({onLoad:function(){var e=this,t=this.addAliasSubmit.bind(this);this.$id("@topic_alias_add").click(t),this.$id("@topic_alias_add_form").submit(t),this.$id("@show_alias_link").click(function(t){t.preventDefault(),e.$id("@add_topic_alias").removeClass("hidden"),e.$id("@show_alias").hide(),e.$id("@topic_alias_input").focus()})},get_value:function(){return this.$id("@topic_alias_input").val()},addAliasSubmit:function(){return this._request(this.get_value()),!1},_request:function(e){var t=this;if(!this.tid||!e)return!1;this.serverCall("add_topic_alias").kwargs({tid:this.tid,alias:e}).success(function(){t.$id("@topic_alias_input").val(""),t.$id("@topic_alias_input").focus()}).liveMutate().send()}}),t.TopicAlias=n.extend({onLoad:function(){var e=this;this.$id("@topic_alias_remove").click(function(){return e.createModal("remove_topic_alias_modal").onSubmit(function(){e._request()}).show(),!1})},_request:function(){if(!this.tid||!this.alias)return!1;this.serverCall("remove_topic_alias").kwargs({tid:this.tid,alias:this.alias}).liveMutate().send()}}),t.TopicDelete=n.extend({onLoad:function(){var e=this;this.$id("@delete_topic_link").click(function(){return e.showDialog(!0),!1}),this.$id("@undelete_topic_link").click(function(){return e.showDialog(!1),!1})},getKwargs:function(e){return{tid:this.tid,comment:e.serialize()}},showDialog:function(e){var t=this.title,i=e?"delete_topic":"undelete_topic",n=e?"delete_dialog":"undelete_dialog",s=this;o.createDialog(s).title(t).ok(function(e){var t=e.dialogComponent.child("editor");if(t.isOnlyWhiteSpace())return!1;s.serverCall(i).kwargs(s.getKwargs(t)).liveMutate().send()},a.ok).cancel(null,a.cancel).load(n)}}),t.HoverTopicMenuMuteLink=n.extend({onLoad:function(){this.hoverMenuContext=this.getContext(s.HoverMenu),this.$link=this.$id("@link");var e=this;this.$link.on("click",function(){return e.$link.hasClass("topic_muted")?e.serverCall("unmute").liveMutate().send():(e.hoverMenuContext&&e.hoverMenuContext.set("hidden",!0),e.serverCall("mute").liveMutate().send()),!1})}})},"./app/view/topic/edit_topic_modal.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.EditTopicsList=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.TOPIC_LIST_REMOVE,function(t){e.removeTid(t.payload.tid)})},removeTid:function(e){this.serverCall("remove").kwargs({tid:e}).liveMutate().send()}}),t.EditTopicsLink=n.extend({onLoad:function(){var e=this;this.$id("@edit_topics").click(function(t){t.preventDefault(),e.createModal("load_modal").kwargs({metadata:e.metadata}).show()})}}),t.TopicRow=n.extend({onLoad:function(){var e=this;e.actionButton=e.child("remove"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(){e.emitEvent({type:o.Types.TOPIC_LIST_REMOVE,payload:{tid:e.tid}})})}}),t.SelectableTopicList=n.extend({getTidSelection:function(){var e={};return this.children().forEach(function(t){e[t.tid]=t.isSelected()}),e}}),t.SelectableTopic=n.extend({onLoad:function(){var e=this;e.$id("@topic").on("click",function(){e.toggleSelected()}),e.$id("@topic_checkbox").on("click",function(){e.toggleSelected()})},isSelected:function(){return this.$id("@topic_checkbox").prop("checked")},toggleSelected:function(){var e=this;e.isSelected()?e.$id("@topic_checkbox").prop("checked",!1):e.$id("@topic_checkbox").prop("checked",!0)}})},"./app/view/topic/merge.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./app/view/topic_selector.js").TopicSelector,a=i("./settings.js").interface_strings;t.TopicMergeSelector=s.extend({topicWasSelected:function(e){var t=function(t){var i=t.dialogComponent.child("editor");if(i.isOnlyWhiteSpace())return!1;this.serverCall("merge").kwargs({to_tid:e,from_tid:this.from_tid,comment:i.serialize()}).liveMutate().send()}.bind(this);o.createDialog(this).title(this.topic_merge_text).ok(t,a.ok).cancel(null,a.cancel).load("merge_dialog")}}),t.TopicMergeUnmerge=n.extend({onLoad:function(){var e=this;this.is_locked_for_user||this.$id("@show_merge").click(function(){return e.$id("@merge").removeClass("hidden"),e.$id("@show_merge").addClass("hidden"),e.child("selector").focus(),!1})}}),t.TopicUnmergeLink=n.extend({onLoad:function(){var e=this;this.$id("@unmerge").click(function(){return e.serverCall("unmerge_topic").kwargs({tid:e.tid}).liveMutate().send(),!1})}})},"./app/view/topic/topic_create.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/window_manager.js"),s=i("./w2.dialog.js").Dialog,a=i("./view/selector.js").Selector,r=i("./view/selector.js").NavigateToResultUrlSelectorMixin;t.TopicNavigateSelector=a.extend(r),t.TopicCreateMain=n.extend({onLoad:function(){var e=this;this.submitted=!1,this.$id("@fake_editor").click(function(){return e.$id("@fake_editor_row").hide(),e.$id("@editor_row").removeClass("hidden"),e.child("editor").focus(),!1}),this.$id("@create").click(function(){var t=e.getTopicName();if(!t||/^\s+$/.test(t)||e.submitted)return!1;e.submitted=!0;var i=e.child("editor").serialize();e.serverCall("create_topic").kwargs({topic_name:t,about:i}).success(function(e){o.sameDomainURL(e)&&o.navigateTo(e)}).liveMutate().send()}),this.$id("@cancel").click(function(){return e.cancelClicked(),!1})},getTopicName:function(){return this.child("selector").query},cancelClicked:function(){}}),t.TopicCreateDialog=t.TopicCreateMain.extend({cancelClicked:function(){s.dialogFor(this).close_()}})},"./app/view/topic/topic_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/multimodal.js").openSingleModalStep;t.TopicListItem=n.extend({onLoad:function(){var e=this;e.actionButton=e.child("remove"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(){e.serverCall("remove_topic").liveMutate().send()})}}),t.QuestionTopicHorizontalList=n.extend({onLoad:function(){var e=this;e.$id("@modal_link").on("click",function(t){t.preventDefault(),o(e,{qid:e.qid,is_anon_page:e.is_anon_page})})}})},"./app/view/topic/topic_ontology.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.AddTopicParent=n.extend({onLoad:function(){var e=this;this.$id("@existing_link").click(function(t){t.preventDefault(),e.$id("@existing_link").addClass("hidden"),e.$id("@existing").removeClass("hidden"),e.child("parent_selector").focus()})}}),t.AddTopicChildren=n.extend({onLoad:function(){var e=this;this.$id("@existing_link").click(function(t){t.preventDefault(),e.$id("@existing_link").addClass("hidden"),e.$id("@existing").removeClass("hidden"),e.child("child_selector").focus()})}}),t.OrganizeChildItem=n.extend({onLoad:function(){var e=this;e.actionButton=e.child("remove"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(){e.serverCall("remove_topic").liveMutate().send()})},toggleInstruction:function(){this.$id("@instruction").toggleClass("hidden")}}),t.ManageParentTopicsLink=n.extend({onLoad:function(){var e=this;e.$id("@link").click(function(t){t.preventDefault(),e.createModal("load").kwargs({tid:e.tid}).show()})}})},"./app/view/topic/topic_redesign.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.TopicPhotoCard=n.extend({onLoad:function(){var e=this;e.$id("@card").click(function(t){return e.onCardClick(),!1})},onCardClick:function(){this.isSelected=!this.isSelected,this.isSelected?this.select():this.deselect()},select:function(){this.$id("@card").addClass(this.selectClass),this.emitEvent({type:o.Types.TOPICS_GRID_ADD,payload:{tid:this.tid}})},deselect:function(){this.$id("@card").removeClass(this.selectClass),this.emitEvent({type:o.Types.TOPICS_GRID_REMOVE,payload:{tid:this.tid}})}})},"./app/view/topic_selector.js":function(e,t,i){var n=i("./view/selector.js").Selector,o=i("./view/selector.js").SelectorResults,s=i("./w2.dialog.js"),a=i("./shared/events/index.js"),r=i("./shared/log_sender.js"),d=t.TopicSelector=n.extend({resultWasSelected:function(e,t,i){if(this.logResultWasSelected(e),"topic"===e.ty||"topic_alias"===e.ty)this.topicWasSelected(e.data.tid,e.data.topic_name,t,i,e);else{if("create_topic"!==e.ty)throw Error();this.createTopicWasSelected(e.data.new_topic_name,t,i)}},topicWasSelected:function(e,t,i,n){},createTopicWasSelected:function(e,t,i){},logResultWasSelected:function(e){var t={type:e.ty,data:e.data,index:this.child("results").selectedIndex};this.should_log&&r.log("topic_selector",{action:"result_selected",query:this.query,action_data:t,selector_type:this.selectorType,selector_id:this.selectorId})}});t.TopicSelectorResults=o.extend({onLoad:function(){this.query&&this.parent().should_log&&r.log("topic_selector",{action:"query",query:this.query,action_data:this.results,selector_type:this.parent().selectorType,selector_id:this.parent().selectorId}),this._super.apply(this,arguments)}}),t.AddTopicSelector=d.extend({showErrorDialog:function(){s.createDialog(this).title(this.dialog_title).ok(null,this.close_button_text).text(this.dialog_message)},topicWasSelected:function(e,t,i,n){this.emitEvent({type:a.Types.QUESTION_TOPIC_SELECTION_ADD,payload:{tid:e}}),this.clear_query_on_select&&this.setQuery(""),this.serverCall("add_topic").kwargs({tid:e}).liveMutate().error(this.showErrorDialog.bind(this)).send(),this.clear_query_on_select||this.updateResults()},createTopicWasSelected:function(e,t,i){this.setQuery(""),this.serverCall("create_and_add_topic").kwargs({new_topic_name:e}).liveMutate().error(this.showErrorDialog.bind(this)).send()}}),t.TopicSelectorForFormField=t.AddTopicSelector.extend({onTopicSelected:function(e){this._onTopicSelectedCallback=e},topicWasSelected:function(e,t,i){this._onTopicSelectedCallback&&this._onTopicSelectedCallback(t,e),this.setQuery("")},createTopicWasSelected:function(e,t){var i=this;i.serverCall("create_and_add_topic").kwargs({new_topic_name:e}).success(function(t){i._onTopicSelectedCallback&&t&&i._onTopicSelectedCallback(e,t),i.setQuery("")}).liveMutate().send()}}),t.LeadgenFormSelector=t.TopicSelectorForFormField.extend({resultWasSelected:function(e,t,i){this.logResultWasSelected(e),this.topicWasSelected(e.data.translated_text)},topicWasSelected:function(e){this._onTopicSelectedCallback&&this._onTopicSelectedCallback(e),this.setQuery("")}}),t.SingleTopicSelectorForReviewQueue=t.TopicSelector.extend({setTopicSelectedCallback:function(e){this.topicSelectedCallback=e},setTopicCreatedCallback:function(e){this.topicCreatedCallback=e},topicWasSelected:function(e,t,i,n){this.setQuery(""),this.topicSelectedCallback(e,t)},createTopicWasSelected:function(e,t,i){this.setQuery(""),this.topicCreatedCallback(e)}})},"./app/view/tribe.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./app/view/topic_selector.js").AddTopicSelector,s=i("./shared/events/index.js"),a=i("./view/inline_editor.js").InlineEditor;t.TribeTopicList=n.extend({onLoad:function(){var e=this;this.handleEvent(s.Types.TOPIC_LIST_REMOVE,function(t){e.removeTid(t.payload.tid)})},removeTid:function(e){this.serverCall("remove").kwargs({tid:e}).liveMutate().send()}}),t.TribeTopicSelector=o.extend({topicWasSelected:function(e){this._super.apply(this,arguments),this.emitEvent({type:s.Types.TOPIC_LIST_ADD,payload:{tid:e}})}}),t.TribePostInlineEditor=a.extend({_onServerCallSuccess:function(e){this.draft_space&&this.draft_space.draft_id!=e&&(this.draft_space.draft_id=e)}})},"./app/view/twitter.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js");t.TwitterConnectCallbackPage=n.extend({onLoad:function(){if(o.setCookie("twitter_oauth_access_key",this.access_token.key,{path:"/twitter/"}),window.opener&&window.opener.document){window.opener.require("shared/jquery")(window.opener.document).trigger("twitter_oauth_approved",{accessToken:this.access_token,userData:this.user_data})}window.close()}})},"./app/view/user.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./w2.dialog.js"),a=i("./settings.js"),r=a.interface_strings;t.UserStatusMain=n.extend({onLoad:function(){o(".inline_editor_create").on("click",function(){o(".admin_qtext").addClass("visible")}),o(".inline_editor_cancel_button").on("click",function(){o(".admin_qtext").removeClass("visible")})}}),t.ProfilePhoto=n.extend({toggleSuggestion:function(){}}),t.BatchRevertControls=n.extend({onLoad:function(){var e=this;this.$id("@select_all_word").click(function(){return e.toggleCheckboxes(),"Select All"==e.$id("@select_all_word").text()?e.$id("@select_all_word").html("Select None"):e.$id("@select_all_word").html("Select All"),!1}),this.$id("@revert").click(function(){return e.batchRevert(),!1})},batchRevert:function(){var e=this,t=[];return o(".user_log_operations_to_revert input:checked").each(function(e){t.push(o(this).attr("name"))}),0!==t.length&&(this._dialog=s.createDialog(this).title(this.dialog_title).cancel(null,r.cancel).ok(function(i){var n=i.dialogComponent,o=n.child("editor");if(!o.isOnlyWhiteSpace()){var s=o.serialize();e.serverCall("batch_revert").kwargs({revert_strings:t,comment:s}).liveMutate().send()}}).load("batch_revert_dialog"),!1)},toggleCheckboxes:function(){var e=o(".user_log_operations_to_revert .pagedlist_hidden input:not(:disabled)").length;o(".user_log_operations_to_revert input:not(:disabled)").length-e!=o(".user_log_operations_to_revert input:checked").length?(o("input:not(:disabled)").prop("checked",!0),o(".user_log_operations_to_revert .pagedlist_hidden input").each(function(e){o(this).prop("checked",!1)})):o("input:not(:disabled)").prop("checked",!1)},getKwargs:function(e,t){return{revert_strings:e,comment:t.serialize()}}}),t.UnconfirmedEmailBlockedEditor=n.extend({onLoad:function(){var e=this;this.$id("@resend").click(function(){return e.serverCall("resend_email_confirmation").send(),!1})}})},"./app/view/user/content.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./app/view/topic_selector.js").TopicSelector,s=i("./shared/window_manager.js"),a=i("./shared/core/component.js").Component;t.UserContentFilter=a.extend({onLoad:function(){var e=this;this.$id("@filter_links a").click(function(){var t=n(this);if(t.hasClass("selected"))return!1;var i=t.attr("data-value"),o={};o[e.data_key]=i;var a=s.makeUpdatedURL(o);return s.navigateTo(a),!1})}}),t.UserContentFilterTopics=a.extend({onLoad:function(){var e=this;this.$id("@all_topics").click(function(){return e.$id("@all_topics").hasClass("selected")||e.clearChosenTopic(),!1}),e.actionButton=e.child("remove"),e.actionButton&&"function"==typeof e.actionButton.onPressed&&e.actionButton.onPressed(function(){e.clearChosenTopic()})},clearChosenTopic:function(){var e={};e[this.data_key]=null;var t=s.makeUpdatedURL(e);s.navigateTo(t)}}),t.UserContentFilterTopicSelector=o.extend({topicWasSelected:function(e,t,i,n,o){if(t){var a={};a.topic=o.data.topic_routing_name;var r=s.makeUpdatedURL(a);s.navigateTo(r)}}})},"./app/view/user/profile.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./tooltip.js"),s=i("./shared/window_manager.js"),a=i("./view/editable_list.js").EditableList,r=i("./app/view/topic_selector.js").TopicSelectorForFormField;t.VerificationBadge=n.extend({onLoad:function(){o.attach(this.$id("@badge"),this.tooltip_text)}}),t.BlockUserBadge=n.extend({onLoad:function(){var e=this;e.$id("@block_badge").on("click",function(t){e.createModal("load_unblock_modal").kwargs({target_uid:e.target_uid}).show(),t.preventDefault()})}}),t.NGProfileNameEditor=n.extend({onLoad:function(){this.$id("@update").click(this.updateName.bind(this)),this.$id("@edit").click(this.toggleEditor.bind(this)),this.$id("@cancel").click(this.toggleEditor.bind(this))},toggleEditor:function(){var e=this;return this.$id("@initial").toggleClass("hidden"),this.$id("@editor").toggleClass("hidden"),this.$id("@name").focus(),this.$id("@name").val(""),this.$id("@name").val(e.full_name),!1},updateName:function(){var e=this.$id("@name").val(),t=this;return this.serverCall("update").kwargs({name:e}).success(function(e){e?(t.toggleEditor(),s.reload()):t.toggleEditor()}).liveMutate().send(),!1}}),t.ProfileExperienceList=a.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.shouldLoadModal&&e.createModal("load_modal").show(),e.$id("@modal_link_title").on("click",function(){e.createModal("load_modal").show()}),e.$id("@modal_link").on("click",function(){e.createModal("load_modal").show()})}});var d=t.LanguageSelector=r.extend({resultWasSelected:function(e,t,i){this.topicWasSelected(e.data.tid,e.data.name,t,i)}});t.ProfileLanguageSelector=d.extend({resultWasSelected:function(e,t,i){this.setQuery(""),this.serverCall("add_language").kwargs({tid:e.data.tid}).liveMutate().send()}})},"./app/view/user/setup_.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./shared/events/index.js"),a=!1;t.ChecklistStep=n.extend({onLoad:function(){var e=this,t=e.should_show_x;this.$id("@step_link").click(function(i){i.preventDefault(),a||(a=!0,e._dialog=o.createDialog(e).opt("width",500).opt("left","50%").opt("dialogClass","dialog_nux").opt("showXButton",t).title(e.dialog_title).load("get_step_dialog").close(e.onDialogClose.bind(e)))}),this.handleEvent(s.Types.NUX_DIALOG_STANDALONE_DONE,function(){e._dialog&&e._dialog.close_()})},onDialogClose:function(){a=!1,this.serverCall("mark_dialog_step_complete").send()}}),t.ChecklistLinkStep=n.extend({onLoad:function(){var e=this;this.$id("@step_link").click(function(){e.serverCall("log_link_click").send()})}})},"./app/view/user/topics.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./view/modal.js").Base,s=i("./app/view/topic_selector.js").AddTopicSelector,a=i("./app/view/topic/edit_topic_modal.js").EditTopicsList;t.EditKnowsAboutTopicsModal=o.extend({onLoad:function(){this._super.apply(this,arguments),this.topicsChanged=!1;var e=this;this.handleEvent(n.Types.PROFILE_TOPICS_UPDATED,function(){e.topicsChanged=!0})},_closeModal:function(){this._super.apply(this,arguments),this.topicsChanged&&window.location.reload()}}),t.KnowsAboutTopicsList=a.extend({removeTid:function(){this._super.apply(this,arguments),this.emitEvent({type:n.Types.PROFILE_TOPICS_UPDATED,payload:{}})}}),t.EditKnowsAboutTopicsModalSelector=s.extend({topicWasSelected:function(){this._super.apply(this,arguments),this.emitEvent({type:n.Types.PROFILE_TOPICS_UPDATED,payload:{}})},createTopicWasSelected:function(){this._super.apply(this,arguments),this.emitEvent({type:n.Types.PROFILE_TOPICS_UPDATED,payload:{}})}})},"./app/view/user_stats.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./view/hover_menu.js").HoverMenu,r=i("./shared/window_manager.js");t.StatsMain=n.extend({onLoad:function(){this.handleEvent(s.Types.USER_STATS_SHOW,this.show.bind(this));var e=this;this.handleEvent(s.Types.USER_STATS_UPDATE_ATTRIBUTES,function(t){e.updateAttributes(t.payload)})},show:function(){this.$id("@stats_main").removeClass("fade_in")},updateGraph:function(e,t){this.child("graphs_section").updateGraphs(e,this.interval_type,t)},updateContentList:function(){this.serverCall("render_new_content_list_wrapper").args(this.content_type,this.interval_type).contentFor(this.$id("@stats_side")).send()},updateAttributes:function(e){var t=!1,i=!1;if(4!==this.content_type||this.oid!==e.oid){if("oid"in e&&this.oid!=e.oid&&(this.oid=e.oid,t=!0,4===this.content_type))return void this.updateGraph(e.content_type,this.oid);if("interval_type"in e&&(e.interval_type=parseInt(e.interval_type),this.interval_type!=e.interval_type&&(this.interval_type=e.interval_type,t=!0,i=!0)),"content_type"in e&&(e.content_type=parseInt(e.content_type),this.content_type!=e.content_type&&(this.content_type=e.content_type,t=!0,i=!0)),t){var n=null;i||(n=this.oid),this.updateGraph(this.content_type,n)}i&&this.updateContentList()}}}),t.Filter=a.extend({registerClickHandlers:function(){var e=this;this._super.apply(this,arguments),this.$id("@menu").on("click",".option",function(t){e.updateAttributes(o(t.target).attr("name")),e.$id("@link").text(o(t.target).text()),o(t.target).parent().siblings().removeClass("selected"),o(t.target).parent().addClass("selected"),t.preventDefault()})},updateAttributes:function(){}}),t.FilterIntervalType=t.Filter.extend({updateAttributes:function(e){this.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{interval_type:e}})}}),t.FilterContentType=t.Filter.extend({updateAttributes:function(e){this.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{content_type:e}})}}),t.TabbedStatsNavController=n.extend({onLoad:function(){var e=this;o(".tabbed_nav_wrapper .content_type_tab").click(function(t){t.preventDefault();var i=o(this).attr("id");o(".tabbed_nav_wrapper .content_type_tab").removeClass("active"),o(this).addClass("active"),o("#"+i).addClass("active"),e.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{content_type:i}})})}}),t.ContentListWrapper=n.extend({onLoad:function(){var e=this.$id("@content_list_wrapper"),t=e.outerHeight(),i=o(window).height(),n=e.offset().top,a=i-n-32;a>t&&e.css("height",a),this.emitEvent({type:s.Types.USER_STATS_SHOW,payload:{}})}}),t.ContentListItem=n.extend({onLoad:function(){var e=this;this.$id("@content_external_link").click(function(e){e.stopPropagation()}),this.$id("@link").click(function(){if(e.$id("@link").hasClass("is_active")){var t=e.$id("@title").data("content-url");t&&r.navigateTo(t,"present")}else o(".is_active").removeClass("is_active"),e.$id("@link").addClass("is_active");e.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{oid:e.oid,content_type:e.content_type}})})}}),t.RSGraph=n.extend({onLoad:function(){var e=this,t=new Rickshaw.Color.Palette({scheme:this.colors}),i=this.getHeight(),n=this.width;for(var o in this.data_json)this.data_json[o].color=t.color();var s=new Rickshaw.Graph({element:this.$id("@rsgraph").get(0),series:this.data_json,width:n,height:i,renderer:"bar",stroke:!0,min:this.min,max:this.max,xmin:this.xmin,xmax:this.xmax,interpolation:"step-after",nearestPoint:!1});s.render(),new Rickshaw.Graph.Axis.Y({graph:s,tickFormat:this.ypercent?function(e){return(100*e).toFixed(1)+"%"}:null}).render(),new Rickshaw.Graph.Axis.Time({graph:s}).render();new Rickshaw.Graph.HoverDetail({graph:s,formatter:function(t,i,n){return e.hover_text+": "+n}})},getHeight:function(){var e=o(window).height(),t=o(".graphs").offset().top,i=e-t-32;return i>this.height?i:this.height}}),t.Graphs=n.extend({onLoad:function(){var e=this,t=window.location.hash;this.metrics.forEach(function(t){e.child("headsup_section").$id("@"+t).click(function(i){var n=o(i.target);return n.hasClass("heads_up_item")||(n=n.parents(".heads_up_item")),n.hasClass("is_active")||(n.siblings(".is_active").removeClass("is_active"),n.addClass("is_active")),e.active_metric!=t&&(o(".stats_graph").addClass("hidden"),e.child("stats_graphs").$id("@graph_"+t).removeClass("hidden"),e.active_metric=t),i.preventDefault(),!1})}),this.metrics.forEach(function(i){"#"+i==t&&e.child("headsup_section").$id("@"+i).click()})},updateGraphs:function(e,t,i){var n=this;o(".heads_up_item").first().addClass("is_active"),this.serverCall("render_new_graphs").args(e,t,i).contentFor(this.$id("@graphs"),{useLoadingSpinner:!1}).send(),this.serverCall("get_new_counts").args(e,t,i).success(function(e){e.forEach(function(e){null===e[1]?n.child("headsup_section").$id("@"+e[0]).addClass("hidden"):(n.child("headsup_section").$id("@"+e[0]).removeClass("hidden"),n.child("headsup_section").$id("@"+e[0]+">.big_num").text(e[1]),n.child("headsup_section").$id("@"+e[0]+">.num_label").text(e[2])),o(".heads_up_item").first().addClass("is_active")})}).send()}})},"./app/view/vc.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./w2.dialog.js"),a=i("./settings.js").interface_strings;t.RevertDialog=n.extend({onLoad:function(){this.radioChangeListener()},radioChangeListener:function(){o("input:radio").change(function(){o("input:radio").each(function(){o(this).prop("checked")&&o(".content").html(o(this).val())})})},validateReason:function(){return!0}}),t.OperationRevert=n.extend({onLoad:function(){var e=this;e.$id("@operation_revert").click(function(){return s.createDialog(e).title(e.dialog_title).ok(function(t){var i=t.dialogComponent.child("editor");e.serverCall("revert_revision").kwargs(e.getKwargs(i)).liveMutate().send()},e.ok_text).cancel(null,a.cancel).load("revert_dialog"),!1})},getKwargs:function(e){return{oid:this.oid,comment:e.serialize()}}}),t.AddQuestionRedirectRevertLink=n.extend({onLoad:function(){var e=this;e.$id("@revert").click(function(t){t.preventDefault(),s.createDialog(e).title(e.dialog_title).ok(function(t){var i=t.dialogComponent.child("editor");e.serverCall("revert").kwargs({to_qid:e.to_qid,from_qid:e.from_qid,comment:i.serialize()}).liveMutate().send()},e.ok_text).cancel(null,a.cancel).load("revert_dialog")})}})},"./app/view/write.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js"),s=i("./view/modal.js").Base,a=i("./shared/window_manager.js");t.WriteMain=n.extend({onLoad:function(){var e=this,t=this.$id("@left_col_inner"),i=this.$id("@left_col");e.notifBanner||i.length>0&&t.length>0&&o.makeFixable(t,{min_height:i.outerHeight()+i.offset().top,min_width:990})}}),t.PersonalRequestsMain=n.extend({onLoad:function(){if(this.scroll_to_lowpri){var e=this.$id("@lowpri_header").prop("offsetTop");e&&window.scrollTo(0,e+70)}}}),t.RemoveAllDraftsLink=n.extend({onLoad:function(){var e=this;this.$id("@confirmation_dialogue").on("click",function(t){return e.createModal("load_inner").show(),!1})}}),t.WritePageBatchActionConfirmationModal=s.extend({onSubmit:function(){this.removeAll()},removeAll:function(){var e=this;this.serverCall("remove_all").liveMutate().success(function(t){e._closeModal(),a.reload()}).send()}})},"./facebook.js":function(e,t,i){function n(e,t,i){FB.login(function(n){if("connected"==n.status){var o=n.authResponse;e&&o.userID!=e?i(o.userID):t(o.userID,o.accessToken,o.expiresIn)}},{scope:"publish_actions"})}var o=i("./shared/facebook.js"),s=i("./shared/core/component.js").Component,a=i("./shared/events/index.js");t.maybePromptToPublish=function(e,t,i){if(!o.isLoaded())return o.asyncUpdatePermissions(),!1;var s=null;return FB.getAuthResponse()&&(s=FB.getAuthResponse().userID),s&&e?s==e?o.hasPermission("publish_actions")?t():n(e,t):i(s):n(e,t,i),!1};var r=s.extend({onLoad:function(){o.load(),this.$id("@facebook_connect_button").on("click",this.onClickFacebookConnectButton.bind(this))},connect:function(){var e=this;FB.login(function(t){t&&"connected"==t.status?e.onLogin(t.authResponse):e.onLoginFailed()},{scope:this.perms})},onClick:function(){},onLogin:function(e){},onLoginFailed:function(){},onClickFacebookConnectButton:function(){return o.isLoaded()&&(this.connect(),this.onClick()),!1}});t.FacebookConnectButton=r.extend({onLogin:function(e){this._onLogin(e)},_onLogin:function(e){this.serverCall("connect_facebook").kwargs({fb_access_token:e.accessToken,fb_uid:e.userID,expires:e.expiresIn}).liveMutate().send()}}),t.FacebookConnectButtonZapdos=t.FacebookConnectButton.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@facebook_connect_button").on("click",function(){e.dismissWall()})},dismissWall:function(){var e=this;e.emitEvent({type:a.Types.ZAPDOS_WALL_DISMISS,payload:{cardType:e.card_type}})}})},"./gating.js":function(e,t){e.exports=window.Q.gating},"./init.js":function(e,t,i){i("./third_party/json2.js");var n=i("./shared/window_manager.js"),o=i("./shared/onload.js"),s=i("./shared/events/index.js"),a=i("./visibility.js"),r=i("./shared/jquery.js");i("./w2.errors.js");var d=function(){var e=a.getFrameElement();if(e&&"true"===e.getAttribute("autoresize")){var t=r(document),i=t.width(),n=t.height();r(e).width(i).height(n)}};window.addEventListener("resize",d),r(document).ready(d),i("./qtext.js").init(),s.GlobalProxy.subscribe(s.Types.LOGOUT_USER,function(){n.reload()}),o.execAfterLoadDelayed(function(){r(document).on("fire_facebook_conversion_pixel",function(e,t){new Image(1,1).src="https://www.facebook.com/offsite_event.php?id="+t+"&value=0.01&currency=USD"})})},"./input_validate.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.InputValidator=n.extend({init:function(){this._super.apply(this,arguments),this.isValid=null},onLoad:function(){var e,t=this.input(),i=this;t.on("change blur",function(){var n=t.val();n!==e&&(e=n,i.validate())}),this._managerComponent().__validators=this._managerComponent().__validators||[],this._managerComponent().__validators.push(this)},input:function(){return this.parent().$id(this.id)},_managerComponent:function(){return this.parent()},validate:function(e){var t=this;if(e=e||{},this.input().val()){this.hideAllErrors();var i={value:this.input().val()},n=this.additional_kwargs();for(var o in n)i[o]=n[o];this.serverCall("validate").kwargs(i).success(function(i){t.hideAllErrors(),i.valid?(t.isValid=!0,t.hideAllErrors(),t.input().removeClass("error"),"function"==typeof e.valid&&e.valid(i.message)):(t.isValid=!1,i.message&&(t.setWidth(t.$id("@invalid_message")),t.$id("@invalid_message").text(i.message),t.invalidMessage=i.message),t.hideAllErrors(),t.showErrorOnComponent("@validator .invalid"),"function"==typeof e.invalid&&e.invalid(i.message))}).send()}else this.hideAllErrors(),this.isValid=null},additional_kwargs:function(){return{}},populate_if_valid:function(e,t){var i=this;this.serverCall("validate").kwargs({value:e}).success(function(n){n.valid&&(i.isValid=!0,t.val(e))}).send()},setWidth:function(e){var t=parseInt(this.input().width())-4;t>0&&e.css("width",t+"px")},hideAllErrors:function(){this.$id("@validator .invalid").hide(),this.$id("@validator .valid").hide(),this.input().removeClass("error"),o("textarea").removeClass("error")},showErrorOnComponent:function(e){this.$id(e).show(),this.input().addClass("error"),o("textarea").addClass("error")}}),t.InputValidator.validate=function(e,t){t=t||{},e.__validators&&e.__validators.length?e.__validators[0].validate(t):"function"==typeof t.valid&&t.valid()}},"./interface/settings.js":function(e,t,i){var n=i("./settings.js");t.action=n.action,t.batchedServerCallUrl=n.batchedServerCallUrl,t.componentInspector=n.componentInspector,t.controller=n.controller,t.debug=n.debug,t.enableFrameBusting=n.enableFrameBusting,t.interface_strings=n.interface_strings,t.isLoggedIn=n.isLoggedIn,t.logComponentTime=n.logComponentTime,t.serverCallUrl=n.serverCallUrl,t.windowId=n.windowId,t.postUrlSuffix=n.postUrlSuffix},"./login.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/events/index.js"),s=i("./shared/core/component.js").Component,a=i("./shared/window_manager.js"),r=i("./shared/siteuri.js").URI,d=i("./settings.js"),l=i("./unified_view/signup/_signup.js").SignupContext,c=i("./view/modal.js").Base,u=i("./shared/w2.context.js").CaptchaInput,h=i("./shared/toast.js"),p=i("./shared/login_handler.js"),_=i("./shared/reactBridge.js").handleEventFromReact,f=i("./shared/siteuri.js");t.LoginButton=s.extend({onLoad:function(){this.$id("@login_link").click(function(e){var t=r("/?next="+encodeURIComponent(a.getURL()));return a.navigateTo(t.unicode()),!1})}});var m=t.InlineLogin=s.extend({onLoad:function(){var e=this;e.checkingPassword=!1,e.hasLoggedIn=!1,e.resetPasswordCaptchaLoaded=!1,e.resetPasswordCaptchaCompleted=!1,e.captchaResponse=null;var t=function(t){13==(t.keyCode||t.which)&&e.$id("@submit_button").click()},i=t.bind(e);e.$id("@password").keydown(i),e.$id("@email").keydown(i),e.$id("@resend_confirmation").click(function(t){return e.serverCall("resend_confirmation_link").kwargs({email:e._email()}).success(function(){e.hideAllErrors()}).send(),!1}),e.$id("@reset_password_link").click(e.resetPasswordHandler.bind(this)),e.$id("@forgot_password_link").click(e.resetPasswordHandler.bind(this)),e.handleEvent(o.Types.CAPTCHA_RESPONSE_CHANGED,function(t){""!=t.payload.response&&(e.resetPasswordCaptchaCompleted=!0,e.captchaResponse=t.payload.response,e.verifyCaptchaAndResetPassword(e.captchaResponse))}),e.$id("@email").on("input",function(){setTimeout(function(){e.updatePreview()},10)}),e.$id("@submit_button").click(function(){return e.checkPassword(),!1}),e.$id("@submit_button").on("touchend",function(){return e.checkPassword(),!1}),e.$id("@login_link").click(function(){return e.$id("@login_form").removeClass("hidden"),e.$id("@email").focus(),!1});var s=this.getContext(l);s&&this.$id("@email_not_found_error a").click(function(){var e={email:this.$id("@email").val(),password:this.$id("@password").val()};return s.set("loginData",e),!1}.bind(this)),n(document).ready(function(){e.updatePreview()})},resetPasswordHandler:function(e){var t=this;e.preventDefault(),t.resetPasswordCaptchaLoaded?t.resetPasswordCaptchaCompleted?t.verifyCaptchaAndResetPassword(t.captchaResponse):(t.$id("@reset_password_captcha").focus(),h.showError(t.translated_complete_captcha_text)):t.serverCall("load_reset_password_captcha").contentFor(t.$id("@reset_password_captcha")).success(function(){t.resetPasswordCaptchaLoaded=!0}).send()},verifyCaptchaAndResetPassword:function(e){var t=this;t.serverCall("reset_password").kwargs({email:t._email(),captcha_response:e}).success(function(){t.hideAllErrors()}).send()},updatePreview:function(){this._updatePreviewMemCache=this._updatePreviewMemCache||{};var e=this,t=e._email(),i=e._updatePreviewMemCache,n=function(n){i[t]=n,e.customSuccessUpdatePreviewCallback?(e.customSuccessUpdatePreviewCallback(n),e.removeButtonDisabled()):(e.$id("@login_form").removeClass("hidden"),e.$id("@password").focus(),e.$id("@name").text(n.name),e.removeButtonDisabled(),e.hideAllErrors())};if(i[t])return void n(i[t]);e.serverCall("preview_info").kwargs({email:t}).success(n).except("email_not_found",function(t){return e.hideAllErrors(),e.showErrorOnComponent("@email_not_found_error","@email"),e.addButtonDisabled(),!1}).except("no_email",function(t){e.hideAllErrors(),e.addButtonDisabled()}).except("email_unconfirmed",function(t){e.hideAllErrors(),e.showErrorOnComponent("@email_not_confirmed_error","@email"),e.removeButtonDisabled()}).except("refused",function(t){e.hideAllErrors(),e.removeButtonDisabled()}).send()},removeButtonDisabled:function(){this.$id("@submit_button").removeClass("submit_button_disabled")},addButtonDisabled:function(){this.$id("@submit_button").addClass("submit_button_disabled")},loginKwargs:function(){return{email:this.$id("@email").val(),password:this.$id("@password").val()}},loginSuccessCallback:function(e){if(this.customSuccessLoginCallback)this.customSuccessLoginCallback(e);else{var t=e;this.hideAllErrors(),d.uid!=t&&"post_reload"!=d.pageMode||this.emitEvent(o.helpers.loginUser())}this.addButtonDisabled()},checkPassword:function(){this.hideAllErrors();var e=this;e.hasLoggedIn||e.checkingPassword||(e.checkingPassword=!0,e.serverCall("do_login").kwargs(e.loginKwargs()).success(function(t){e.hasLoggedIn=!0,e.checkingPassword=!1,e.loginSuccessCallback(t)}).except("email_not_found",function(){e.checkingPassword=!1,e.hideAllErrors(),e.showErrorOnComponent("@email_not_found_error","@email")}).except("incorrect_password",function(){e.checkingPassword=!1,e.hideAllErrors(),e.showErrorOnComponent("@incorrect_password_error","@password")}).except("account_deleted",function(){e.checkingPassword=!1,e.hideAllErrors(),e.showErrorOnComponent("@account_deleted")}).except("email_unconfirmed",function(){e.checkingPassword=!1,e.hideAllErrors(),e.showErrorOnComponent("@email_not_confirmed_error","@email")}).except("banned_user",function(){e.checkingPassword=!1,e.hideAllErrors(),e.serverCall("login_user_is_banned").kwargs(e.loginKwargs()).send()}).except("too_many_attempts",function(){e.checkingPassword=!1,e.hideAllErrors(),e.serverCall("login_user_rate_limited").kwargs(e.loginKwargs()).send()}).except("password_leaked",function(){e.checkingPassword=!1,e.serverCall("load_password_leaked_dialog").kwargs({email:e._email()}).contentFor(e.$id("@email_password_leak_error")).success(function(){e.hideAllErrors(),e.$id("@login_form .login_options").addClass("hidden"),e.$id("@email_password_leak_error").removeClass("hidden")}).send()}).except("force_password_reset",function(){e.checkingPassword=!1,e.serverCall("load_force_password_reset_dialog").kwargs({email:e._email()}).contentFor(e.$id("@email_password_leak_error")).success(function(){e.hideAllErrors(),e.$id("@login_form .login_options").addClass("hidden"),e.$id("@email_password_leak_error").removeClass("hidden")}).send()}).except("two_factor_authentication",function(){e.checkingPassword=!1,e.hideAllErrors(),e.createModal("login_user_two_factor_authentication").kwargs({email:e._email()}).show()}).sendOnlyOnce())},_email:function(){return this.$id("@email").val()},hideAllErrors:function(){this.$id("@email_not_found_error").addClass("hidden"),this.$id("@email_not_confirmed_error").addClass("hidden"),this.$id("@incorrect_password_error").addClass("hidden"),this.$id("@email_password_leak_error").addClass("hidden"),this.$id("@email").removeClass("input_validation_error"),this.$id("@password").removeClass("input_validation_error"),this.$id("@login_form .login_options").removeClass("hidden")},showErrorOnComponent:function(e,t){this.$id(e).removeClass("hidden"),this.$id(t+"_menu").removeClass("hidden"),this.$id(t).addClass("input_validation_error")}});t.ResetPasswordCaptcha=s.extend({contextConstructor:function(){return u},onLoad:function(){this.emitEvent({type:o.Types.CAPTCHA_REQUIRED,payload:{}}),this.captchaContext=this.getContext(u),this.captchaContext.on("captchaResponse",this.onCaptchaResponseChanged.bind(this))},onCaptchaResponseChanged:function(e,t){this.emitEvent({type:o.Types.CAPTCHA_RESPONSE_CHANGED,payload:{response:t}})}}),t.VerifyUser2FAModal=c.extend({onLoad:function(){this._super.apply(this,arguments)},onSubmit:function(){this._closeModal()}}),t.LoginSignal=s.extend({onLoad:function(e){if(!e){this.uid?this.emitEvent(o.helpers.loginUser()):this.emitEvent(o.helpers.logoutUser())}}}),t.LoginListener=s.extend({onLoad:function(){var e=this;o.GlobalProxy.subscribe(o.Types.LOGIN_USER,function(t){if(p.shouldListenForLogins()){var i={};t.payload.pmsg&&(i.__pmsg__=t.payload.pmsg);var n,o=e.next,s=[];for(n in i)s.push(n+"="+encodeURIComponent(i[n]));s.length>0&&(o+=-1==o.indexOf("?")?"?":"&",o+=s.join("&")),a.navigateTo(o)}}),_(o.Types.WINDOW_URL_REPLACED,function(t){if(t.newUrl){var i=t.newUrl;f.isSiteAbsoluteUrl(i)||(i=new f.SiteURI(i).absolute()),e.next=i}})}});var g=t.LoggedOutHomeLogin=m.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@email").focus(),this.$id("@cancel_link").on("click",this.toggleLoginOptions.bind(this))},showErrorOnComponent:function(e,t){this._super.apply(this,arguments),this.$id("@login_form .login_options").addClass("hidden")},toggleLoginOptions:function(){return this.$id("@login_form").addClass("hidden"),!0}});t.OAuthLogin=g.extend({customSuccessLoginCallback:function(e){this.hideAllErrors(),this.serverCall("get_permissions_page_response").success(function(e){a.navigateTo(e.next_url)}).send()}}),t.LeakedPasswordMessage=s.extend({onLoad:function(){var e=this;this.$id("@reset_password_link").click(function(){e.serverCall("reset_password").kwargs({email:e.email}).send()})}}),t.ForcePasswordResetMessage=s.extend({onLoad:function(){var e=this;this.$id("@reset_password_link").click(function(){e.serverCall("reset_password").kwargs({email:e.email}).success(function(t){t&&e.serverCall("show_confirmation").contentFor(e.$id("@instructions")).kwargs({email:e.email}).send()}).send()})}})},"./main.js":function(e,t,i){i("./init.js"),i("./shared/init.js"),i("./shared/w2.timing.js").logTime("mainScriptEnd")},"./qtext.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./tooltip.js");t.init=function(){n(document).on("mouseover","a[data-qt-tooltip]",function(e){var t=n(this);return!t.attr("data-tooltip")&&(t.attr("data-tooltip","attached"),o.attach(t,t.attr("data-qt-tooltip"),{attach_to_body:!0}),setTimeout(function(){t.trigger("mouseenter")},10),!1)})}},"./qtext2.js":function(e,t,i){var n=i("./unified_view/qtext2/editor/mobile.js"),o=i("./unified_view/qtext2/toolbar.js"),s=i("./shared/reactBridge.js").emitEventToReactAfterLoadDelayed;t.handleToolbarAction=function(e,t){s("qtextNativeToolbarAction",{eventName:e,args:t}),o.activeToolbar&&o.activeToolbar.trigger(e,t)},t.handleRestoreState=function(e){"{}"!==JSON.stringify(e)&&(s("qtextNativeRestoreState",{state:e}),n.activeEditor&&n.activeEditor.restoreState(e))},t.saveDraft=function(){s("qtextNativeSaveDraft",{}),n.activeEditor&&n.activeEditor.saveDraft()},t.clearDraft=function(){s("qtextNativeClearDraft",{}),n.activeEditor&&n.activeEditor.clearDraft()},t.focus=function(){n.activeEditor&&n.activeEditor.focus()}},"./qtext2/config.js":function(e,t){var i={isIOS:!1,isMobile:!1,isIPad:!1,isMSEdge:!1,isGecko:!1,isWebkit:!1,isFirefox:!1,webkitVersion:0,isIOSApp:!1,isAndroid:!1,isAndroidApp:!1,isNativeApp:!1,isUIWebView:!1,isIOSMobileWeb:!1,buildNumber:0,osVersion:0,debug:!1},n={deleteVideoButton:"Delete",deleteVideoMessage:"Video will be deleted",deleteVideoSvg:"",deleteVideoTitle:"Are you sure you want to delete your video?",doneUploadingTitle:"Uploaded",pauseUploadingButton:"Pause",pauseUploadingTitle:"Uploading",playVideoSvg:"",resumeUploadingButton:"Resume Uploading",resumeUploadingTitle:"Upload Paused",retryUploadingButton:"Retry",uploadErrorSvg:"",uploadErrorTitle:"Something went wrong",uploadingSvg:"",videoIndicatorSvg:"",videoNotPresent:"Your video is on a different device",videoNotPresentSvg:"",videoEnabled:!1,videoEditorSupported:!1,tabbedEditorToolbar:!1,enableSmartQuotes:!1,qtext_hyperlink_embed:!1,imageRemoveButtonEnabled:!1};window.hasOwnProperty("scrollTo")||(window.scrollTo=function(){}),t.config={clientInfo:Object.assign({},i),options:Object.assign({},n),setClientInfo:function(e){this.clientInfo=Object.assign({},i,e)},setOptions:function(e){this.options=Object.assign({},n,e)}}},"./qtext2/constants.js":function(e,t){t.CONTENT_TYPES={TEXT:"text/plain",HTML:"text/html",PUBLIC_HTML:"public.html",TEXT_URI:"text/uri-list"},t.FRACTIONS={"⅐":[1,7],"⅑":[1,9],"⅒":[1,10],"⅓":[1,3],"⅔":[2,3],"⅕":[1,5],"⅖":[2,5],"⅗":[3,5],"⅘":[4,5],"⅙":[1,6],"⅚":[5,6],"⅛":[1,8],"⅜":[3,8],"⅝":[5,8],"⅞":[7,8]},t.ELLIPSIS="…",t.OPEN_SINGLE_QUOTE="‘",t.CLOSE_SINGLE_QUOTE="’",t.OPEN_DOUBLE_QUOTE="“",t.CLOSE_DOUBLE_QUOTE="”",t.SINGLE_PRIME="′",t.DOUBLE_PRIME="″",t.EN_DASH="–",t.EM_DASH="—",t.LEFT_ARROW="←",t.RIGHT_ARROW="→",t.WORD_START_REGEX=/\s|[({[]/,t.ENTER_KEY=13},"./qtext2/container.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./qtext2/util.js").Util,s=n.extend({__init__:function(e){this.kind=e,this.node=o.create("DIV"),this.node.className=this.kind,this.children=[]},init:function(){},insertAfter:function(e,t){if(e.parent&&e.parent.removeChild(e),t){var i=t.node.nextSibling;this.node.insertBefore(e.node,i),this.children.splice(this.children.indexOf(t)+1,0,e)}else this.node.appendChild(e.node),this.children.push(e);e.parent=this},insertBefore:function(e,t){e.parent&&e.parent.removeChild(e),t?(this.node.insertBefore(e.node,t.node),this.children.splice(this.children.indexOf(t),0,e)):(this.node.appendChild(e.node),this.children.push(e)),e.parent=this},appendChild:function(e){this.insertBefore(e)},appendChildren:function(e){e.forEach(this.appendChild.bind(this))},hasChild:function(e){return-1!==this.children.indexOf(e)},removeChild:function(e){if(this.hasChild(e)){var t=this.children.indexOf(e);this.children.splice(t,1),o.safeRemoveChild(e.node,this.node)}},removeChildren:function(){for(var e,t=this.firstChild();t;)e=t.nextSibling(),this.removeChild(t),t=e},previousSibling:function(){return this.node.previousSibling&&this.Class.get(this.node.previousSibling)},nextSibling:function(){return this.node.nextSibling&&this.Class.get(this.node.nextSibling)},firstChild:function(){return 0===this.children.length?null:this.children[0]},lastChild:function(){return 0===this.children.length?null:this.children[this.children.length-1]}});s.create=function(e,t){var i;return o.assert(!t.__init__,"Do not override __init__"),t.__init__=function(){this._super(e),this.init.apply(this,arguments),this.Class=i,i.add(this,this.node)},i=s.extend(t),i.add=function(e,t){o.setData(t,"kind",e.kind),t.qtextContainer=e},i.get=function(e){return o.assert(i.is(e)),e.qtextContainer},i.is=function(t){return!!t&&(1==t.nodeType&&o.getData(t,"kind")==e)},i},t.Container=s},"./qtext2/keys.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./qtext2/config.js").config,s=t.isMac=/Mac/.test(window.navigator.platform),a={8:"BACKSPACE",9:"TAB",13:"RETURN",27:"ESCAPE",35:"END",36:"HOME",37:"LEFT",38:"UP",39:"RIGHT",40:"DOWN",46:"DELETE",106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r=function(e){return-1!=[35,36,37,38,39,40].indexOf(e.which)},d=function(e){return e.shiftKey&&16==e.which},l=n.extend({__init__:function(e){e=e.toUpperCase(),this.alt=/ALT-/.test(e),this.ctrl=/CTRL-/.test(e)||!s&&/CMD-/.test(e),this.meta=/META-/.test(e)||s&&/CMD-/.test(e),this.shift=/SHIFT-/.test(e),this.character=e.split("-").pop()},toString:function(){var e="";return this.alt&&(e+="ALT-"),this.ctrl&&(e+="CTRL-"),this.meta&&(e+="META-"),this.shift&&(e+="SHIFT-"),e+=this.character}}),c=function(e){var t=a[e.which]||String.fromCharCode(e.which).toUpperCase(),i="";return e.altKey&&(i+="ALT-"),e.ctrlKey&&(i+="CTRL-"),e.metaKey&&(i+="META-"),e.shiftKey&&(i+="SHIFT-"),i+=t},u=n.extend({__init__:function(){this._handlers=[]},on:function(e,t){var i=new l(e);if(i in this._handlers)throw new Error("Already attached handler for "+i);this._handlers[i]=t},trigger:function(e){var t=c(e);o.clientInfo.isIOSApp&&"SHIFT-RETURN"===t&&(t="RETURN");var i=this._handlers[t];return!i||i(e)}});t.getShortcutHint=function(e){var t=new l(e),i="";return s?(t.meta&&(i+="⌘"),t.ctrl&&(i+="^"),t.alt&&(i+="⌥"),t.shift&&(i+="⇧")):(t.ctrl&&(i+="Ctrl-"),t.alt&&(i+="Alt-"),t.shift&&(i+="Shift-")),i+t.character[0]+t.character.slice(1).toLowerCase()},t.isNavigation=r,t.isOnlyShiftKey=d,t.Hub=u,t.SPECIAL_KEYS=a},"./qtext2/modifiers.js":function(e,t){t.allModifiers=function(){return["bold","italic","underline","link","citation","math","code","image","video","embed","tweet","playable","iframe","external_source","uploading","hyperlink_embed"]};var i=t.mutuallyExclusiveSet=function(){return["link","citation"]};t.nonEditableSet=function(){return["video","image","embed","tweet","playable","iframe","external_source","uploading","hyperlink_embed"]},t.editableSet=function(){return["bold","italic","underline","link","citation","math","code"]};var n=t.restrictedSets=function(){return[["image","embed","tweet","video","playable","iframe","external_source","uploading","hyperlink_embed"],["math"],["code"]]},o=t.canSetModifier=function(e,t){var o=e.parent;return(!o||-1!=o.allowedModifiers().indexOf(t))&&((-1==i().indexOf(t)||!i().some(function(i){return i!=t&&e.hasModifier(i)}))&&!n().some(function(i){return!(-1==i.indexOf(t)||!e.hasDifferentModifier(i))||!(-1!=i.indexOf(t)||!e.hasAnyModifier(i))}))};t.canForceModifier=function(e,t){if(o(e,t))return!0;var s=e.parent;return(!s||-1!=s.allowedModifiers().indexOf(t))&&(-1!=i().indexOf(t)||n().some(function(e){return-1!=e.indexOf(t)}))}},"./qtext2/position.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=n.extend({__init__:function(e,t){this.span=e,this.offset=t},toJSON:function(){var e=this.span.parent;return{spanIdx:e.children.indexOf(this.span),sectionIdx:e.parent.children.indexOf(e),offset:this.offset}},clone:function(){return new o(this.span,this.offset)},atSpanStart:function(){return 0===this.offset},atSpanEnd:function(){return this.offset==this.span.getLength()},atSectionStart:function(){var e=this.span.parent;return this.atSpanStart()&&this.span==e.firstChild()},atSectionEnd:function(){var e=this.span.parent;return this.atSpanEnd()&&this.span==e.lastChild()},atDocStart:function(){var e=this.span.parent,t=e.parent;return this.atSectionStart()&&e==t.firstChild()},atDocEnd:function(){var e=this.span.parent,t=e.parent;return this.atSectionEnd()&&e==t.lastChild()},equals:function(e){return e.span===this.span&&e.offset===this.offset},charBefore:function(){return this.atSectionStart()?null:this.prevPositionInSection().charAfter()},hasCharBefore:function(){var e=this.charBefore();return!!e&&0!==e.trim().length},charAfter:function(){if(this.atSectionEnd())return null;var e=this.span,t=this.offset;return this.atSpanEnd()&&(e=e.nextSibling(),t=0),e.getText()[t]},hasCharAfter:function(){var e=this.charAfter();return!!e&&0!==e.trim().length},previousWordBoundary:function(e){e=e||/\W/;var t=this.span,i=this.offset-1,n=t.getText();if(this.atDocStart())return this;if(this.atSectionStart())return t.previous().last();for(;t;){for(;i>0;){if(n[i-1].match(e))return new o(t,i);i--}t=t.previousSibling(),t&&(n=t.getText(),i=n.length)}return this.span.parent.first()},nextWordBoundary:function(e){e=e||/\W/;var t=this.span,i=this.offset+1,n=t.getText();if(this.atDocEnd())return this;if(this.atSectionEnd())return t.next().first();for(;t;){for(;in&&a?a.first().relativePositionInSection(e-(n-i)):null},prevPositionInSection:function(e){return e=e||1,this.relativePositionInSection(-1*e)},nextPositionInSection:function(e){return this.relativePositionInSection(e||1)},alternatePosition:function(){if(this.atSpanStart()){var e=this.span.previousSibling();if(e)return e.last()}else if(this.atSpanEnd()){var t=this.span.nextSibling();if(t)return t.first()}return this}});t.Position=o},"./qtext2/quirks.js":function(e,t,i){var n=i("./qtext2/config.js").config,o={usesCompositionEvents:function(){return n.clientInfo.isGecko||n.clientInfo.isWebkit&&n.clientInfo.webkitVersion>532},dragEventContainsFile:function(e){var t=e.dataTransfer;return!!t&&(!!(t.files&&t.files.length>0)||!!t.types&&(!(!t.types.indexOf||-1==t.types.indexOf("Files"))||!(!t.types.contains||!t.types.contains("application/x-moz-file"))))},insertsPeriodWithDoubleSpace:function(){return n.clientInfo.isIOS}};t.Quirks=o},"./qtext2/section.js":function(e,t,i){var n=i("./qtext2/container.js").Container,o=i("./qtext2/constants.js").CONTENT_TYPES,s=i("./qtext2/modifiers.js"),a=i("./qtext2/span.js").Span,r=i("./qtext2/position.js").Position,d=i("./shared/twitter_oembed.js").tweetsEnabled,l=i("./qtext2/util.js").Util,c=i("./third_party/unicode/UnicodeBidiDirection.js"),u=function(){var e={};e.plain=i("./qtext2/sections/plain.js").PlainSection,e.code=i("./qtext2/sections/code.js").CodeSection,e.image=i("./qtext2/sections/image.js").ImageSection;var t=i("./qtext2/sections/horizontal_rule.js");e["horizontal-rule"]=t.HorizontalRuleSection;var n=i("./qtext2/sections/lists.js");e["ordered-list"]=n.OrderedListSection,e["unordered-list"]=n.UnorderedListSection;var o=i("./qtext2/sections/embed.js");return e.embed=o.EmbedSection,e["yt-embed"]=o.YouTubeEmbedSection,e.oembedly=o.OEmbedlySection,d()&&(e.tweet=o.TweetSection),e.hyperlink_embed=o.HyperlinkEmbedSection,e.video=i("./qtext2/sections/video.js").VideoSection,e},h=n.create("section",{init:function(e,t,i,n,o){var s=this;t=t&&0!==t.length?t:[new a],t.slice().forEach(function(e){s.appendChild(e)}),l.setData(this.node,"type",e),this.setRTL(o),this.setIndent(i||0),this.setQuoted(n)},getType:function(){return l.getData(this.node,"type")},getLength:function(){var e=0;return this.children.forEach(function(t){e+=t.getLength()}),e},getIndent:function(){return parseInt(l.getData(this.node,"indent"))},setIndent:function(e){return e=Math.min(this.maxIndent(),Math.max(0,e)),l.setData(this.node,"indent",e),0!==this.maxIndent()},getDirection:function(){return l.getData(this.node,"dir")||this.determineDirection()},isRTL:function(){return"RTL"==this.getDirection()},setRTL:function(e){if(null!=e){var t=e?"RTL":"LTR";l.setData(this.node,"dir",t)}else{var i=this.determineDirection();l.setData(this.node,"dir",i)}},resetRTL:function(){var e=this.determineDirection();e&&"NEUTRAL"!==e&&l.setData(this.node,"dir",e)},setQuoted:function(e){e?l.setData(this.node,"quoted","true"):l.removeData(this.node,"quoted")},isQuoted:function(){return!!l.getData(this.node,"quoted")},isEditable:function(){return!this.children.some(function(e){return!e.isEditable()})},allowsMultipleSoftReturns:function(){return!1},allowedModifiers:function(){return s.editableSet()},toContent:function(e,t){var i=[];return i.push(this.getContentPrefix(e,t)),i.push(this.getChildrenContents(e)),i.push(this.getContentSuffix(e,t)),i=i.join("")},getChildrenContents:function(e){return this.children.map(function(t){return t.toContent(e)}).join("")},determineDirection:function(){return c.getGlobalDir()},toJSON:function(e){var t={type:this.getType(),indent:this.getIndent(),quoted:this.isQuoted(),is_rtl:this.isRTL(),spans:[]};return this.children.forEach(function(i){t.spans.push(i.toJSON(e))}),t},first:function(){return this.firstChild().first()},last:function(){return this.lastChild().last()},getText:function(){var e="";return this.children.forEach(function(t){e+=t.getText()}),e},deleteText:function(e,t){if(e.span==t.span)e.span.deleteText(e.offset,t.offset);else{for(e.span.deleteText(e.offset,e.span.getLength());e.span.nextSibling()!=t.span;)this.removeChild(e.span.nextSibling());t.span&&t.span.deleteText(0,t.offset)}t.span.isEmpty()&&this.children.length>1&&this.removeChild(t.span),e.span.isEmpty()&&this.children.length>1&&this.removeChild(e.span),1==this.children.length&&this.firstChild()==e.span&&e.span.isEmpty()&&e.span.removeAllModifiers()},replaceText:function(e,t,i){if(""===i)return this.deleteText(e,t);var n=e.span.getText(),o=n.substr(0,e.offset)+i;e.span==t.span?o+=n.substr(t.offset):this.deleteText(e.span.nextSibling().first(),t),e.span.setText(o)},isEmpty:function(){return 1==this.children.length&&this.children[0].isEmpty()},isOnlyWhiteSpace:function(){return this.children.every(function(e){return e.isOnlyWhiteSpace()})},_createSplitSection:function(e){return new this.constructor(e,this.getIndent(),this.isQuoted(),this.isRTL())},split:function(e){var t,i,n,o,s=e.span,r=e.offset;return 0===r?(s==this.firstChild()&&this.insertBefore(new a,s),o=s):r===s.getLength()?s==this.lastChild()?(o=new a,this.appendChild(o)):o=s.nextSibling():o=s.split(r,!0),t=this.children.indexOf(o)+1,n=this.children.slice(t),n.unshift(o),i=this._createSplitSection(n),this.parent.insertBefore(i,this.nextSibling()),o.first()},merge:function(e){var t,i,n;if(e.isEditable())if(e.isEmpty())e.parent&&e.parent.removeChild(e),t=this.last();else if(this.isEditable()){for(this.isEmpty()?(this.removeChild(this.firstChild()),this.setIndent(e.getIndent()),this.setQuoted(e.isQuoted()),this.setRTL(e.isRTL()),t=e.first()):t=this.last();e.children.length;)this.appendChild(e.firstChild());for(i=this.firstChild();i;)if((n=i.nextSibling())&&i.hasSameModifiers(n)){var o=i.getLength();i=i.merge(n),n==t.span&&(t=new r(i,o+t.offset))}else i=n;e.parent&&e.parent.removeChild(e)}else this.parent&&this.parent.removeChild(this),t=e.first();else this.isEmpty()&&this.parent&&this.parent.removeChild(this),t=e.first();return t},changeType:function(e){var t=new e(this.children,this.getIndent(),this.isQuoted());return this.parent&&(this.parent.insertBefore(t,this),this.parent.removeChild(this)),t},getContentPrefix:function(e,t){return e==o.TEXT?this._getTextPrefix(t):e==o.HTML?this._getHTMLPrefix(t):void 0},getContentSuffix:function(e,t){return e==o.TEXT?this._getTextSuffix(t):e==o.HTML?this._getHTMLSuffix(t):void 0},_getTextPrefix:function(){var e,t="";for(e=0;e<4*this.getIndent();e++)t+=" ";return this.isQuoted()&&(t+=">"),t},_getTextSuffix:function(){return"\n"},_getHTMLPrefix:function(e){var t,i="",n=e.indexOf(this),o=this.getIndent(),s=-1;for(n>0?(t=e[n-1],t instanceof this.constructor&&(s=t.getIndent()),this.isQuoted()&&!t.isQuoted()&&(i+="
")):this.isQuoted()&&(i+="
");o>s;)i+=this.htmlIndentPrefix,o--;return i+this.htmlPrefix},_getHTMLSuffix:function(e){var t,i=this.htmlSuffix,n=e.indexOf(this),o=this.getIndent(),s=-1;for(ns;)o--,i+=this.htmlIndentSuffix;return!this.isQuoted()||t&&t.isQuoted()||(i+="
"),i},maxIndent:function(){return 0}});h.fromJSON=function(e){var t=[],i=u()[e.type];return e.spans.forEach(function(e){t.push(new a(e.text,e.modifiers))}),new i(t,e.indent,e.quoted,e.is_rtl)},t.Section=h},"./qtext2/sections/code.js":function(e,t,i){var n=i("./qtext2/section.js"),o=n.Section,s=i("./third_party/unicode/UnicodeBidiDirection.js"),a=o.extend({init:function(e,t,i){this._super("code",e,t,i),this.children.forEach(function(e){e.removeAllModifiers()})},allowedModifiers:function(){return[]},htmlIndentPrefix:"",htmlIndentSuffix:"",htmlPrefix:"
",htmlSuffix:"
",determineDirection:function(){return s.LTR}});t.CodeSection=a},"./qtext2/sections/embed.js":function(e,t,i){var n=i("./qtext2/span.js").Span,o=i("./qtext2/section.js").Section,s=i("./qtext2/modifiers.js"),a=i("./qtext2/sections/plain.js").PlainSection,r=i("./qtext2/util.js").Util,d=i("./shared/errors.js"),l=i("./qtext2/constants.js").CONTENT_TYPES,c=i("./shared/twitter_oembed.js"),u=i("./shared/hyperlink_embed.js").hyperlinkEmbedsEnabled,h=c.tweetsEnabled,p=c.getTweetData,_=i("./shared/core/rpc.js"),f=i("./qtext2/config.js").config,m=o.extend({init:function(e,t,i){r.assert(1==e.length,"EmbedSections should have exactly one child:",e),r.assert(e[0].hasModifier("embed"),"missing embed modifier on embed span"),this._super(this.type,e,t,i);var n=e[0].getModifier("embed").url;this._setEmbed(n)},toContent:function(e,t){var i=this.children[0].getModifier("embed").url;return e==l.TEXT?i:new n(i,{link:{type:"url",url:i}}).toContent(e)},toJSON:function(e){return{type:this.getType(),indent:this.getIndent(),quoted:this.isQuoted(),spans:this.children.map(function(t){return e?t.toJSON(e):{modifiers:{embed:t.getModifier("embed")}}})}},_setEmbed:function(){},allowedModifiers:function(){return s.nonEditableSet()},_onEmbedSectionCallbackError:function(){var e=this.children[0].getModifier("embed").url,t=this.changeType(a);t.children[0].removeModifier("embed"),t.children[0].setText(e),t.parent&&t.parent.linkifySections([t])}});m.getValidRegex=function(e){var t=[];e._VALID_REGEXES.forEach(function(e){t.push("(?:"+e.source+")")});var i=t.join("|");return new RegExp(i)},m.fromOtherSection=function(e){var t=null;return e.isEditable()?(E.some(function(i){var o=C()[i],s=!0,a="",d=0;if(i===w&&!u())return!1;var l=m.getValidRegex(o);return e.children.forEach(function(e){if(e.hasModifier("link")){var t=e.getModifier("link").url;t&&t.match(l)?(d+=1,a=e.getModifier("link").url):s=!1}else{var i=e.getText();r.splitByRegex(i,l).forEach(function(e){e.match?(d+=1,a=e.text):e.text.match(/^ *$/)||(s=!1)})}}),!(1!=d||!s)&&(t=new o([new n("",{embed:{url:a}})]),!0)}),t):null};var g=m.extend({init:function(){this._super.apply(this,arguments),this.children[0].setModifier("playable")},_onOEmbedCallbackSuccess:function(e,t,i,n){var o=this.children[0].getModifier("embed");if(i!==undefined&&null!==i){r.assert(n===undefined||null===n,"If iframe_html is supplied, iframe_url has to be null / undefined.");var s=r.create("div");s.innerHTML=i,n=s.children[0].src}r.assert(null!==n,"For OEmbedSection, we have to have the iframe URL."),o.thumbnail_url=t,o.content_type=e,o.iframe={url:n},this.children[0].setModifier("embed",o),this.children[0].setModifier("image",t)}}),v=g.extend({_setEmbed:function(e){var t=this,n=this.children[0].getModifier("embed");n.thumbnail_url&&n.content_type&&n.iframe&&n.iframe.url?t._onOEmbedCallbackSuccess(n.content_type,n.thumbnail_url,null,n.iframe.url):i("./shared/embedly.js").getOEmbedlyData(e,function(e){e?t._onOEmbedCallbackSuccess(e.type,e.thumbnail_url,e.html):t._onEmbedSectionCallbackError()})},type:"oembedly"});v._VALID_REGEXES=[/http:\/\/www.vimeo.com\/groups\/*\/videos\/.*/,/http:\/\/www.vimeo.com\/.*/,/https:\/\/www.vimeo.com\/.*/,/http:\/\/vimeo.com\/groups\/.*\/videos\/.*/,/http:\/\/vimeo.com\/.*/,/https:\/\/vimeo.com\/.*/,/http:\/\/vimeo.com\/m\/#\/.*/,/http:\/\/player.vimeo.com\/.*/,/https:\/\/player.vimeo.com\/.*/,/http:\/\/www.hulu.com\/watch.*/,/http:\/\/www.hulu.com\/w\/.*/,/http:\/\/www.hulu.com\/embed\/.*/,/http:\/\/hulu.com\/watch.*/,/http:\/\/hulu.com\/w\/.*/,/http:\/\/hulu.tv\/.*/,/http:\/\/www.ustream.tv\/recorded\/.*/,/http:\/\/www.ustream.tv\/channel\/.*/,/http:\/\/www.ustream.tv\/.*/,/http:\/\/ustre.am\/.*/,/http:\/\/link.brightcove.com\/services\/player\/bcpid.*/,/http:\/\/bcove.me\/.*/,/http:\/\/www.vevo.com\/watch\/.*/,/http:\/\/www.vevo.com\/video\/.*/,/http:\/\/video.google.com\/videoplay\?.*/,/http:\/\/.*.dailymotion.com\/video\/.*/,/http:\/\/.*.dailymotion.com\/.*\/video\/.*/,/http:\/\/khanacademy.org\/*/,/http:\/\/www.khanacademy.org\/*/,/https:\/\/khanacademy.org\/*/,/https:\/\/www.khanacademy.org\/*/,/http:\/\/www.ted.com\/talks\/.*.html.*/,/http:\/\/www.ted.com\/talks\/lang\/.*\/.*.html*/,/http:\/\/www.ted.com\/index.php\/talks\/.*.html.*/,/http:\/\/www.ted.com\/index.php\/talks\/lang\/.*\/.*.html/,/http:\/\/www.ted.com\/talks\/.*/];var b=m.extend({init:function(){this._super.apply(this,arguments),this.children[0].setModifier("playable")},_setEmbed:function(e){var t,i;i=m.getValidRegex(b).exec(e),i?t=i[1]:(d.report(new Error("YouTubeEmbedSection: url did not match regex: "+e)),t=""),this.children[0].setModifier("image","https://img.youtube.com/vi/"+t+"/0.jpg")},type:"yt-embed",htmlIndentPrefix:"",htmlIndentSuffix:"",htmlPrefix:"

",htmlSuffix:"

"});b._VALID_REGEXES=[/(?:https?:\/{2})?(?:w{3}\.)?(?:youtube\.com\/watch.+v=|youtu.be\/|m\.youtube\.com\/|youtube.com\/embed\/)([^\s?]+)(\?[^\s]+)?/];var y=m.extend({_onTweetCallbackSuccess:function(e,t){this.children[0].setModifier("tweet",!0),this.children[0].setModifier("iframe",e),t&&c.renderTweetIFrame(e)},_setEmbed:function(e){var t=this;p(e,function(e,i){e?t._onTweetCallbackSuccess(e,i):t._onEmbedSectionCallbackError()},function(){t._onEmbedSectionCallbackError()})},type:"tweet",htmlIndentPrefix:"",htmlIndentSuffix:"",htmlPrefix:"

",htmlSuffix:"

"});y._VALID_REGEXES=[/https:\/\/(.*\.)?twitter.com\/.*\/status\/.*/];var w=m.extend({_onEmbedCallbackSuccess:function(e){e.scrolling="no",this.children[0].setModifier("hyperlink_embed",!0),this.children[0].setModifier("iframe",e),e.onload=function(){var t=e.contentDocument||e.contentWindow.document,i=f.clientInfo.isMobile?3:0,n=t.querySelector(".HyperLinkPreview"),o=n.offsetHeight;e.style.height=o+i+"px"}},_setEmbed:function(e){var t=this;t._getEmbedData(e,function(e){e?t._onEmbedCallbackSuccess(e):t._onEmbedSectionCallbackError()},function(e){})},_getEmbedData:function(e,t,i){_.rpc("/hyperlink/get_embed_POST").kwargs({url:e,clipboard_pending:!1}).success(function(e){if("error"in e)i(e);else{var n=document.createElement("iframe");n.className="hyperlink-embed styleable",n.srcdoc=e.html,t(n)}}).error(i).send()},type:"hyperlink_embed",htmlIndentPrefix:"",htmlIndentSuffix:"",htmlPrefix:"

",htmlSuffix:"

",showLoadingDots:!0});w._VALID_REGEXES=[/https?:\/\/.*/];var E=["oembedly","yt-embed"];h()&&E.push("tweet");var C=function(){var e={};return e["yt-embed"]=b,e.oembedly=v,h()&&(e.tweet=y),e.hyperlink_embed=w,e};t.EmbedSection=m,t.OEmbedlySection=v,t.YouTubeEmbedSection=b,t.TweetSection=y,t.HyperlinkEmbedSection=w,t.EMBED_SECTION_TYPES=E},"./qtext2/sections/horizontal_rule.js":function(e,t,i){var n=i("./qtext2/section.js").Section,o=i("./qtext2/span.js").Span,s=n.extend({init:function(){var e=[new o("",{image:"/static/images/hr_img_3.png"})];this._super("horizontal-rule",e,0,!1)},allowedModifiers:function(){return["image"]},getChildrenContents:function(){return""},_getHTMLPrefix:function(){return"
"},_getHTMLSuffix:function(){return""},determineDirection:function(){return null}});t.HorizontalRuleSection=s},"./qtext2/sections/image.js":function(e,t,i){var n=i("./qtext2/section.js"),o=n.Section,s=i("./qtext2/span.js").Span,a=i("./qtext2/util.js").Util,r=o.extend({init:function(e,t,i){a.assert(1==e.length,"ImageSections should have exactly one child:",e),a.assert(e[0].hasModifier("image"),"missing image modifier on image span"),this._super("image",e,t,i)},allowedModifiers:function(){return["image","external_source","uploading"]},htmlIndentPrefix:"",htmlIndentSuffix:"",htmlPrefix:"

",htmlSuffix:"

"});r.fromURL=function(e,t){var i={image:e};return t&&(i.external_source=t),new r([new s("",i)])},t.ImageSection=r},"./qtext2/sections/lists.js":function(e,t,i){var n=i("./qtext2/section.js"),o=n.Section,s=t.isListSection=function(e){return e instanceof a},a=o.extend({allowsMultipleSoftReturns:function(){return!0},maxIndent:function(){if(this.parent){var e=this.previousSibling();return e&&s(e)?Math.min(2,e.getIndent()+1):0}return 2},htmlPrefix:"
  • ",htmlSuffix:"
  • "});t.UnorderedListSection=a.extend({init:function(e,t,i){this._super("unordered-list",e,t,i)},_getTextPrefix:function(e){return this._super(e)+"* "},htmlIndentPrefix:"
      ",htmlIndentSuffix:"
    "}),t.OrderedListSection=a.extend({init:function(e,t,i){this._super("ordered-list",e,t,i)},_getTextPrefix:function(e){for(var t,i=this._super(e),n=this.getIndent(),o=e.indexOf(this)-1,s=1;o>=0&&(t=e[o],!(n>t.getIndent())&&t instanceof this.constructor);)n==t.getIndent()&&s++,o--;return i+s+". "},htmlIndentPrefix:"
      ",htmlIndentSuffix:"
    "})},"./qtext2/sections/plain.js":function(e,t,i){var n=i("./qtext2/section.js").Section,o=i("./third_party/unicode/UnicodeBidi.js"),s=n.extend({init:function(e,t,i,n){this._super("plain",e,t,i,n)},htmlIndentPrefix:"",htmlIndentSuffix:"",htmlPrefix:"

    ",htmlSuffix:"

    ",determineDirection:function(){var e=this.firstChild();return e&&!e.isEmpty()?o.resolveBlockDir(e.getText()):this._super()}});t.PlainSection=s},"./qtext2/sections/video.js":function(e,t,i){var n,o=i("./qtext2/section.js"),s=o.Section,a=i("./qtext2/span.js").Span,r=i("./shared/errors.js"),d=i("./shared/util.js"),l=i("./qtext2/config.js").config,c=i("./qtext2/modifiers.js"),u=i("./qtext2/util.js").Util,h=i("./shared/jquery.js"),p=u.h,_=s.extend({init:function(e,t,i){u.assert(1==e.length,"VideoSection should have exactly one child:",e),u.assert(e[0].getModifier("video"),"Missing video modifier in child span."),this._super("video",e,t,i),this.maybeRequestThumbnail(),this.renderVideoIframe()},renderVideoIframe:function(){var e=L(this.getVideo()),t=e.iframeRoot;this.firstChild().setModifier("iframe",t),this.bindIframeEvents(t),h(t).closest(".span.video.iframe").css(e.iframeRootSectionStyle)},maybeRequestThumbnail:function(e){if((e||!this.getThumb())&&l.clientInfo.isNativeApp){var t=this;if(!this.getId())return void r.logJsError("qtext",["Video modifier has undefined id: ",JSON.stringify(this.getVideo())].join(""));n.send("getVideoThumbnail",{uuid:this.getId()},function(e){e&&e.thumb&&t.updateVideo({thumb:e.thumb})})}},_editClick:function(e){var t=this;e.on("click",function(){t.parent.handleCommand("video",{uuid:t.getId(),version:t.getVersion()})})},_deleteClick:function(e){var t=this;e.on("click",function(){if(l.clientInfo.isNativeApp){var e={title:l.options.deleteVideoTitle,message:"",otherButtonTitles:[l.options.deleteVideoButton]};t.getVideo().onDevice&&(e.message=l.options.deleteVideoMessage),n.send("showAlert",e,function(e){1==e.buttonIndex&&t.parent.handleCommand("video:remove",t.getId()),t.parent.focus()})}else t.parent.handleCommand("video:remove",t.getId())})},_playClick:function(e){var t=this;e.on("click",function(){n.send("showVideoPlayer",{uuid:t.getId()})})},_pauseClick:function(e){var t=this;e.on("click",function(){var e=t._getVideoIframeDoc();e&&(t.failed?(t.failed=!1,t.parent.handleCommand("video:retry-upload",{uuid:t.getId()}),e.getElementsByClassName("upload-pause")[0].innerHTML=l.options.pauseUploadingButton,e.getElementsByClassName("upload-status-img")[0].src=l.options.uploadingSvg,e.getElementsByClassName("upload-status-title")[0].innerHTML=l.options.pauseUploadingTitle):t.paused?(t.parent.handleCommand("video:resume-upload",{uuid:t.getId()}),t.paused=!1,e.getElementsByClassName("upload-status-title")[0].innerHTML=l.options.pauseUploadingTitle,e.getElementsByClassName("upload-pause")[0].innerHTML=l.options.pauseUploadingButton):(t.parent.handleCommand("video:pause-upload",{uuid:t.getId()}),t.paused=!0,e.getElementsByClassName("upload-status-title")[0].innerHTML=l.options.resumeUploadingTitle,e.getElementsByClassName("upload-pause")[0].innerHTML=l.options.resumeUploadingButton))})},bindIframeEvents:function(e){var t=this,i=h(e);i.on("load",function(){var e=i.contents();t._editClick(e.find(".qt-video-edit")),t._deleteClick(e.find(".qt-video-delete")),t._playClick(e.find(".qt-video-play")),t._pauseClick(e.find(".upload-pause"))})},_getVideoIframeDoc:function(){var e=h("#"+this.getId()+"-iframe");return 0===e.length?null:e.get(0).contentDocument},renderVideoRetry:function(){this.failed=!0;var e=this._getVideoIframeDoc();e&&(e.getElementsByClassName("qt-video-control")[0].style.display="flex",e.getElementsByClassName("upload-progress")[0].style.display="none",e.getElementsByClassName("upload-status-title")[0].innerHTML=l.options.uploadErrorTitle,e.getElementsByClassName("upload-status-img")[0].src=l.options.uploadErrorSvg,e.getElementsByClassName("upload-pause")[0].innerHTML=l.options.retryUploadingButton)},_progressText:function(e,t){var i=d.formatBytes(t);return d.formatBytes(t*e)+" / "+i},updateVideoUploadProgress:function(e,t){var i=this._getVideoIframeDoc();if(i){var n=Math.floor(100*e)+"%";i.getElementsByClassName("qt-video-control")[0].style.display="flex",i.getElementsByClassName("upload-progress")[0].style.display="block",e>=1&&(this.updateVideo({uuid:this.getId(),isUploading:!1,thumb:this.getThumb()}),n="100%",i.getElementsByClassName("upload-status-title")[0].innerHTML=l.options.doneUploadingTitle,i.getElementsByClassName("qt-video-control")[0].style.display="none"),i.getElementsByClassName("upload-percentage")[0].style.width=n,i.getElementsByClassName("upload-numbers")[0].innerHTML=this._progressText(e,t)}},updateVideo:function(e){var t=this.getVideo();(e.uuid&&e.uuid!=t.uuid||e.version&&e.version!=t.version)&&delete t.jwplayer_id;var i=e.videoContentChanged;i&&(delete e.videoContentChanged,delete e.jwplayer_id),this.firstChild().setModifier("video",d.extend(t,e)),this.maybeRequestThumbnail(i),this.renderVideoIframe()},allowedModifiers:function(){return c.nonEditableSet()},getVideo:function(){return this.firstChild().getModifier("video")},getThumb:function(){return this.getVideo().thumb},getId:function(){return this.getVideo().uuid},getVersion:function(){return this.getVideo().version},isUploading:function(){return this.getVideo().isUploading},toJSON:function(e){return{type:this.getType(),indent:this.getIndent(),quoted:this.isQuoted(),spans:this.children.map(function(t){if(e)return t.toJSON(e);var i=t.getModifier("video");return{modifiers:{video:{jwplayer_id:i.jwplayer_id,library_video:i.library_video,is_creator:i.is_creator,uuid:i.uuid,version:i.version}}}})}},htmlIndentPrefix:"",htmlIndentSuffix:"",htmlPrefix:"

    ",htmlSuffix:"

    "});_.fromVideo=function(e){return new _([new a("",{video:e})])};var f="background-color: rgba(0,0,0,0.5)",m="font-size: 14px",g="top: 12px",v="left: 12px",b="right: 12px",y="top: 50%; left: 50%; transform: translate(-50%, -50%)",w="padding: 32px",E="margin-bottom: 10px",C="-webkit-touch-callout: none; -webkit-user-select: none",S=function(){return p("div",{"class":"qt-video-display",style:["position: absolute",y,"text-align: center","width: 80%"].join(";")},p("img",{src:l.options.videoNotPresentSvg,style:["display: inline-block","width: 70px","height: 70px",C].join(";")}),p("div",{style:[m,"color: #999","margin-top: 8px"].join(";")},l.options.videoNotPresent))},T=function(){return p("div",{"class":"qt-video-control",style:[f,"position: absolute",y,"width: 100%","height: 100%","display: none","align-items: center","text-align: center"].join(";")},p("div",{style:["width: 100%","box-sizing: border-box",w].join(";")},p("div",{style:["display: flex","align-items: center"].join(";")},p("img",{"class":"upload-status-img",src:l.options.uploadingSvg,style:["width: 25vw","margin-right: 5vw",C].join(";")}),p("div",{style:["width: 100%","text-align: left"].join(";")},p("div",{"class":"upload-status-title",style:["font-size: 16px","color: #fff","font-weight: 500",E].join(";")},l.options.pauseUploadingTitle),p("div",{"class":"upload-progress",style:["position: relative","width: 100%","height: 4px","background-color: rgba(255,255,255,0.3)",E].join(";")},p("div",{"class":"upload-percentage",style:["position: absolute","left: 0","top: 0","bottom: 0","background-color: #b92b27","width: 0%"].join(";")})),p("div",{"class":"upload-numbers",style:["font-size: 12px","color: #ddd"].join(";")},"0%"))),p("div",{"class":"upload-pause",style:[f,m,"display: inline-block","color: #fff","padding: 8px 12px","border-radius: 4px","cursor: pointer"].join(";")},l.options.pauseUploadingButton)))},k=function(){return p("span",{"class":"qt-video-delete",style:[f,"position: absolute",g,b,"width: 32px","height: 32px","border-radius: 20px","cursor: pointer"].join(";")},p("img",{src:l.options.deleteVideoSvg,style:["position: absolute",y,"width: 24px","height: 24px",C].join(";")}))},x=function(){return p("div",{"class":"qt-video-play",style:[f,y,"position: absolute","width: 70px","height: 70px","border-radius: 50%"].join(";")},p("img",{src:l.options.playVideoSvg,style:["position: absolute",y,"display: inline-block","width: 32px","height: 32px",C].join(";")}))},A=function(){return p("div",{"class":"qt-video-indicator",style:["position: absolute",g,v].join(";")},p("img",{src:l.options.videoIndicatorSvg,style:["display: inline-block","width: 32px","height: 32px",C].join(";")}))},L=function(e){var t=e.thumb,i=e.jwplayer_id,n=i,o=e.onDevice,s=e.is_web_upload,a=l.clientInfo.isNativeApp;i&&(t="https://content.jwplatform.com/thumbs/"+i+".jpg");var r=D(t,e.videoWidth,e.videoHeight,o,n),d=!s;a&&(d=!n&&!o&&!t);var c=p("div",{style:r.formatter(r.thumbParentStyles)},t&&p("img",{src:t,style:r.formatter(r.thumbStyles)}),d&&S(),!a&&T(),k(),t&&A(),a&&!o&&!n&&t&&x(),p("style",{},"html, body { height: 100%; width: 100% }")),_=u.createPlainIframe(c);return h(_).attr("id",e.uuid+"-iframe"),{iframeRoot:_,iframeRootSectionStyle:r.placeholderParentStyles}},D=function(e,t,i,n,o){var s={"padding-bottom":"100%"},a={"font-family":'"Helvetica Neue",Helvetica,Arial,sans-serif',position:"relative","box-shadow":"inset 0 0 70px rgba(0, 0, 0, 0.1)",width:"100%",height:"100%",overflow:"hidden","background-color":"#f7f7f7"},r={position:"absolute",margin:"auto",left:"0",bottom:"0",top:"0",right:"0","-webkit-touch-callout":"none","-webkit-user-select":"none",width:"100%"},d=function(e){return Object.keys(e).map(function(t){return t+": "+e[t]}).join(";")},l=function(){return{placeholderParentStyles:s,thumbParentStyles:a,thumbStyles:r,formatter:d}};if(n||!e)return l();a["background-color"]="black",delete r.width,delete r.height;var c=t/i,u=.015;return c<4/3-u?(r.height="100%",l()):(c<16/9-u?(r.width="100%",s["padding-bottom"]="75%"):(r.width="100%",s["padding-bottom"]="56.25%"),l())};t.VideoSection=_},"./qtext2/shortcuts.js":function(e,t,i){var n=i("./qtext2/keys.js"),o=i("./shared/util.js").extend,s={Backspace:"backspace",Delete:"delete",Return:"return","Alt-Return":"return","Ctrl-Return":"return","Shift-Return":"soft-return"," ":"space",Tab:"indent","Shift-Tab":"deindent","Cmd-B":"bold","Cmd-I":"italic","Cmd-U":"underline","Cmd-K":"link","Cmd-Shift-7":"ordered_list","Cmd-Shift-8":"unordered_list","Cmd-Shift-9":"quote","Cmd-Shift-K":"code","Cmd-Shift-L":"math","Cmd-Z":"undo","Cmd-Shift-Z":"redo"};n.isMac?o(s,{"Ctrl-H":"backspace","Ctrl-D":"delete","Ctrl-K":"delete-forward","Cmd-Backspace":"delete-backward","Ctrl-T":"transpose","Ctrl-Backspace":"backspace","Ctrl-Delete":"delete","Shift-Backspace":"backspace","Shift-Delete":"delete","Alt-Backspace":"delete-previous-word","Alt-Delete":"delete-next-word","Ctrl-U":"underline"}):o(s,{"Ctrl-Backspace":"delete-previous-word","Ctrl-Delete":"delete-next-word","Shift-Backspace":"backspace","Shift-Delete":"delete","Alt-Backspace":"backspace","Alt-Delete":"delete"}),t.SHORTCUTS=s},"./qtext2/span.js":function(e,t,i){var n=i("./qtext2/container.js").Container,o=i("./qtext2/position.js").Position,s=i("./qtext2/constants.js").CONTENT_TYPES,a=i("./qtext2/modifiers.js"),r=i("./qtext2/config.js").config,d=i("./shared/util.js").extend,l=i("./qtext2/util.js").Util,c=i("./shared/util.js"),u=n.create("span",{init:function(e,t){t=t||{},this.modifiers={},this._content=this.createContentNode(),this.node.appendChild(this._content),this._image=null,this.setText(e);var i=this;c.iterItems(t,function(e,t){i.setModifier(e,t,!0)})},createContentNode:function(){var e=l.create("div");return e.className="content",e.qtextSpanContent=!0,e},merge:function(e){if(this.isEditable()&&e.isEditable()&&this.hasSameModifiers(e))return this.setText(this.getText()+e.getText()),e.parent.removeChild(e),this},hasSameModifiers:function(e){var t=this.modifiers,i=e.modifiers,n=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(i);return n.length==o.length&&n.every(function(e){if("link"==e&&i.link){var n=t.link.url;n&&"/"!=n.substr(-1)&&(n+="/");var o=i.link.url;return o&&"/"!=o.substr(-1)&&(o+="/"),n==o}return t[e]==i[e]})},toJSON:function(e,t,i){var n=d({},this.modifiers);return e||delete n.iframe,{modifiers:n,text:this.getText().slice(t,i)}},previous:function(){return this.previousSibling()||this.parent.previousSibling()&&this.parent.previousSibling().lastChild()},next:function(){return this.nextSibling()||this.parent.nextSibling()&&this.parent.nextSibling().firstChild()},first:function(){return new o(this,0)},last:function(){return new o(this,this.getLength())},updateModifiers:function(e,t){var i,n,o=Object.keys(e);for(n=0;n"==this.node.innerHTML)},getText:function(){return this._content.textContent},setText:function(e){this._content.textContent=e,e||this._setPlaceholder()},_removePlaceholder:function(){this._content.textContent=this.getText()},insertText:function(e,t){var i=this.getText();this.setText(i.slice(0,t)+e+i.slice(t))},deleteText:function(e,t){this.setText(this.getText().slice(0,e)+this.getText().slice(t))},getLength:function(){return this.isEditable()?this.getText().length:1},isOnlyWhiteSpace:function(){return!!this.isEditable()&&(!this.hasModifier("citation")&&0==this.getText().trim().length)},getFocusNode:function(){return l.isTextNode(this._content.firstChild)?this._content.firstChild:this._content},_setPlaceholder:function(){this._content.innerHTML="
    "},shouldAvoidSplitting:function(){return this.hasModifier("link")||this.hasModifier("code")||this.hasModifier("math")},split:function(e,t){var i;return!t&&this.shouldAvoidSplitting()?this:(this.isEmpty()?i=new u(null,this.modifiers):0===e?(i=new u(this.getText(),this.modifiers),this.setText("")):(i=new u(this.getText().slice(e),this.modifiers),this.setText(this.getText().slice(0,e))),this.parent.insertBefore(i,this.nextSibling()),i)},_toText:function(){var e,t;return e=this.getText(),this.hasModifier("math")&&(e="$"+e+"$"),this.hasModifier("italic")&&(e="*"+e+"*"),this.hasModifier("bold")&&(e="**"+e+"**"),this.hasModifier("underline")&&(e="_"+e+"_"),this.hasModifier("link")&&(t=this.getModifier("link"),e+=" ("+t.url+")"),e},_toHTML:function(){var e,t;return this.hasModifier("image")?'':this.hasModifier("video")?'
    '+e+""),this.hasModifier("code")?e=""+e+"":this.hasModifier("math")&&(e=""+e+""),e)},toContent:function(e){return e==s.TEXT?this._toText():e==s.HTML?this._toHTML():void 0}});t.Span=u},"./qtext2/tooltip.js":function(e,t,i){var n,o,s=null,a=i("./shared/jquery.js"),r=function(){n||(n=a("
    ").addClass("qtext2_tooltip"),a(document.body).append(n),o=a("
    "),o.css({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),n.append(o))};t.show=function(e,t,i){r();var d=a(e),l=a(i),c=l.outerWidth();o.html(t),n.css("max-width",c),n.removeClass("hidden");var u=d.offset(),h=u.left+.5*d.width(),p=l.offset(),_=p.left,f=_+c;u.top<30?n.css("top",d.height()+20):n.css("top",u.top-30);var m=n.outerWidth(),g=h-m/2,v=h+m/2;g<_?n.css("left",_):v>f?n.css("left",f-m):n.css("left",g),clearTimeout(s),s=setTimeout(function(){n.addClass("visible")},500)},t.hide=function(){n&&(clearTimeout(s),s=setTimeout(function(){n.removeClass("visible"),n.addClass("hidden")},100))}},"./qtext2/ui.js":function(e,t,i){var n=i("./shared/core/rpc.js"),o=i("./shared/Class.js").Class,s=i("./qtext2/util.js").Util,a=i("./qtext2/quirks.js").Quirks,r=i("./shared/upload.js");t.LinkSelector=o.extend({__init__:function(e){this.editor=e,this.toolbar=e.toolbar,this.active=!1,this.key="",this._onSubmitCallback=null,this._onCancelCallback=null},isActive:function(){return this.active},show:function(){throw new Error("NotImplemented: Subclasses should override")},hide:function(){this.active=!1,this.key=""},submit:function(){throw new Error("NotImplemented: Subclasses should override")},cancel:function(){throw new Error("NotImplemented: Subclasses should override")},onSubmit:function(e){this._onSubmitCallback=e},onCancel:function(e){this._onCancelCallback=e},getExternalURL:function(e,t,i){this.toolbar&&(this.toolbar.on("linkInput",e),this.toolbar.showBar(0))},getLinkPreview:function(e,t,i){n.rpc("/qtext/get_link_preview_POST").kwargs({url:e}).success(function(e){"error"in e?i(e):t(e)}).error(i).send()}}),t.ImageUploader=o.extend({__init__:function(e,t,i,n,o){this.editor=e,this.doc=t,this.$dropZone=i,this.$fileInput=n,this.interface_strings=o,this._dragStartedInDoc=!1,this.initEventHandlers()},_debugEvent:function(e,t){},initEventHandlers:function(){s.on("dragenter",this.doc.node,this.onDragEnter.bind(this)),s.on("dragstart",this.doc.node,this.onDragStart.bind(this)),s.on("dragend",this.doc.node,this.onDragEnd.bind(this)),s.on("paste",this.doc.node,this.onPaste.bind(this)),s.on("drop",this.doc.node,this.onDropInDoc.bind(this)),s.on("dragleave",this.$dropZone,this.onDragLeave.bind(this)),s.on("dragover",this.$dropZone,this.onDragOver.bind(this)),s.on("click",this.$dropZone,this.onClick.bind(this)),s.on("drop",this.$dropZone,this.onDrop.bind(this)),s.on("change",this.$fileInput,this.onChange.bind(this))},onDragEnter:function(e){this._debugEvent("dragenter",e),a.dragEventContainsFile(e)&&(this._dragStartedInDoc||this.showDropZone())},onDragStart:function(e){this._debugEvent("dragstart",e),this._dragStartedInDoc=!0},onDragEnd:function(e){this._debugEvent("dragend",e),this._dragStartedInDoc=!1},onDropInDoc:function(e){this._debugEvent("drop (in doc)",e),this._dragStartedInDoc=!1},onDragLeave:function(e){this._debugEvent("dragleave",e),this.hideDropZone()},onDragOver:function(e){this._debugEvent("dragover",e),e.preventDefault()},onClick:function(e){this._debugEvent("click",e),this.hideDropZone()},onDrop:function(e){if(this._debugEvent("drop",e),e.preventDefault(),e.stopPropagation(),!e.dataTransfer||!e.dataTransfer.files)return void this.hideDropZone();for(var t=[],i=0;i1?this.interface_strings.uploading_images.replace("{}",e):this.interface_strings.uploading_image},_onUpload:function(e){this.doc.insertImages(e.qimg_urls,{source:"upload"}),this.hideDropZone()},_onError:function(e){e&&e.message?alert(e.message):alert(this.interface_strings.upload_error),this.hideDropZone()},startUpload:function(e){if(0===e.length)return void this.hideDropZone();this.showUploading(e.length),r.uploadData({kind:"qtext"},e,this._onUpload.bind(this),this._onError.bind(this))},uploadImageUrl:function(e,t){var i=this._onError.bind(this,null);n.rpc("/qtext/upload_image_url_POST").kwargs({url:e}).success(function(e){e?"string"==typeof e?t(e):e.hasOwnProperty("error")&&i(e):i(e)}).error(i).send()}}),t.PhotoSearch=o.extend({__init__:function(e,t,i,n){this.$searchComponent=t,this.$wrapper=i,this.$searchComponent.setSelectCallback(this.submit.bind(this)),this.$searchComponent.setUploadCallback(this.hide.bind(this)),this.$searchComponent.setUploader(n),this.active=!1},isActive:function(){return this.active},fixPosition:function(){var e=this.$wrapper,t=this.$wrapper.parent(),i=6,n=function(){var o=t.find(".editor_toolbar"),s=t.offset().left+t.width()-e.width();"fixed"===o.css("position")?e.css("position","fixed").css("left",s).css("right","auto"):e.css("position","absolute").css("left","auto").css("right",0),e.css("top",parseInt(o.css("top"))+o.height()+i),window.requestAnimationFrame(n)};n()},show:function(){var e=this;e.fixPosition(),e.$wrapper.addClass("animate_in"),setTimeout(function(){e.$wrapper.removeClass("animate_in"),e.$wrapper.addClass("is_shown")},200),e.$searchComponent.makeActive(),e.active=!0},hide:function(){var e=this;e.active=!1,e.$wrapper.addClass("animate_out"),setTimeout(function(){e.$wrapper.removeClass("is_shown"),e.$wrapper.removeClass("animate_out")},200)},toggle:function(){this.active?this.hide():this.show()},submit:function(e){this._onInsertCallback&&this._onInsertCallback(e)},cancel:function(){if(this._onCancelCallback)return this._onCancelCallback(),!1},onInsert:function(e){this._onInsertCallback=e},onCancel:function(e){this._onCancelCallback=e}})},"./qtext2/util.js":function(e,t,i){var n=i("./shared/email.js").isValidEmail,o=i("./shared/jquery.js"),s=["keydown","keyup","keypress"],a=i("./shared/linkify.js"),r=/^https?\:\/\//,d=i("./shared/util.js"),l={assert:function(e){if(!e){var t=Array.prototype.slice.call(arguments,1);throw new Error(t)}},create:function(e){return document.createElement(e)},objectIntersection:function(e,t){for(var i=Object.keys(e),n={},o=0;o","","","","",e.outerHTML,"",""];return t.srcdoc=i.join(""),t},h:function(e,t){for(var i=new Array(arguments.length-2),n=2;n2400||m>50)return void u("cookie_message_errors",{key:e,args:i,size:f,count:m,cookie:_.cookie});var v=Math.floor(4294967296*Math.random()),b=JSON.stringify({key:e,args:i});if(r=r!==undefined?r:o.nid,c=["qm",v,r].join("-"),!p(b)){var y=l.verbose_client_logging_categories;Array.isArray(y)&&(y.includes("ALL")||y.includes(e))&&console.log("Set cookie message ["+e+"]:",i),t.setCookie(c,b,a,n)}};t.setFeedBundleLog=function(e,t){var i,n=e.getDvar("bundle_hash"),o=e.getDvar("feed_page"),s=e.getDvar("page_data"),a=e.__extra_args&&e.__extra_args.nid_override;if(i=[1,n,o,s,t],n&&(_("fbl",i,undefined,undefined,a),l.qfeed_log_debugger)){var r={action:t,bundle_hash:n,feed_page:o,page_data:s};console.log("feed_bundle_action:",JSON.stringify(r,null,2))}},t.setScreenSizeCookie=function(){var e=window.screen.width,i=window.screen.height;c.isIOS()&&window.orientation&&90==Math.abs(window.orientation)&&(e=window.screen.height,i=window.screen.width),t.setCookie("screen_size",e+"x"+i)}},"./shared/core/component.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/w2.timing.js"),s=i("./shared/eventemitter.js").EventEmitter,a=i("./shared/jquery.js"),r=i("./shared/w2.context.js"),d=i("./shared/util.js"),l=i("./settings.js"),c=i("./shared/errors.js"),u=i("./shared/events/index.js"),h="__w2_",p={},_={},f={},m={},g={},v={},b={},y={},w={};t._parents=p,t._components=_,t._allChildren=f,t._children=m,t._hmacs=g,t._domids=v,t._domidToCid=b,t._debugInfo=y,t._unloaded=w;var E=t.addParents=function(e){var t,i,n,o;for(t=Object.keys(e),o=0;o-1&&s.splice(a,1)}}delete f[e],delete m[e],delete _[e],delete y[e],delete b[v[e]],delete v[e],delete p[e]},$=t.unloadComponent=function(e){try{var t=_[e];t&&(t.onUnload(),t._flushOnUnloadCallbacks(),r.unloadComponent(t));var i=f[e]||[];i=i.slice(),i.forEach(function(e){$(e)}),I(e),u.ComponentProxy.unsubscribeAll(e)}catch(e){c.report(e)}finally{w[e]=!0}};t.beforeOnLoad=function(e){e&&(o.logTime("preOnLoad"),(l.logComponentTime||l.debug||l.componentInspector)&&(o.timing.components={},o.timing._components={})),u.DocumentProxy.dispatch({type:u.Types.WEBNODE_COMPONENT_PRE_ONLOAD,payload:{isPageLoad:e}})},t.afterOnLoad=function(e){e&&(o.logTime("postOnLoad"),o.logTime("pageInteractive"));var t=i("./shared/log_sender.js");e&&l.isClonedPage&&t.log("prefetched_page_perf",{open_time:l.clonedPageOpenTime,page_type:l.clonedPageType,interactive_time:Date.now(),framework:"webnode"}),u.DocumentProxy.dispatch({type:u.Types.WEBNODE_COMPONENT_POST_ONLOAD,payload:{isPageLoad:e}})},t.registerBeforeOnLoadCallback=function(e){u.DocumentProxy.subscribe(u.Types.WEBNODE_COMPONENT_PRE_ONLOAD,function(t){e(t.payload.isPageLoad)})},t.registerAfterOnLoadCallback=function(e){u.DocumentProxy.subscribe(u.Types.WEBNODE_COMPONENT_POST_ONLOAD,function(t){e(t.payload.isPageLoad)})},t.getRootParent=function(e){if(!_[e])return null;for(var t=e;t&&!t.startsWith("*");)t=p[t];return t},t.getDescendantCids=function(e){for(var t={},i=[e];i.length;){var n=i.pop();t[n]=!0;var o=f[n];o&&Array.prototype.push.apply(i,o)}return Object.keys(t)},t.getAllDvars=function(e){for(var t,i={},n=e,o={};n;){if(n.cid in o){var s="Broke parent loop "+D(n.cid);c.logJsError("getAllDvars",s);break}t=d.extend({},n.__dvars__),i=d.extend(t,i),o[n.cid]=!0,n=n.parent()}return i},t.isAncestorComponent=function(e,t){for(var i=t;i;){if(i.cid==e.cid)return!0;i=i.parent()}return!1};var O=t.Component=n.extend({__init__:function(e,t,n,o){this.cid=e,this.cname=t,this.__js_init=n,this.__extra_args=o,this.__onloaded=!1,this.__emitter=null,this.init(n),o&&o.rerenderRace&&i("./shared/broadcast.js").rerenderComponent(e),o.nid_override!==undefined&&i("./shared/core/rpc.js").addMetadataCallback(this._addNidOverrideMetadataInRpc.bind(this))},init:function(e){d.isPlainObject(e)&&d.extend(this,e)},onLoad:function(e){},onUnload:function(){},contextConstructor:function(){},child:function(e){var t=m[this.cid],i=t?t[e]:null;return x(i)},children:function(){return(f[this.cid]||[]).map(function(e){return x(e)})},parent:function(){return x(p[this.cid])},setDvar:function(e,t){this.__dvars__=this.__dvars__||{},this.__dvars__[e]=t},getDvar:function(e){if(this.__dvars__=this.__dvars__||{},e in this.__dvars__)return this.__dvars__[e];for(var t,i=this.cid;i;)if(i=p[i],t=_[i])return t.getDvar(e);return null},getHmac:function(){return g[this.cid]},__maybeCreateEmitter:function(){this.__emitter||(this.__emitter=new s)},whenOnLoaded:function(e){if(this.__onloaded)return void e();this.__maybeCreateEmitter(),this.__emitter.on("onload",e)},whenUnloaded:function(e){this.__maybeCreateEmitter(),this.__emitter.on("unload",e)},_flushOnLoadCallbacks:function(){this.__emitter&&this.__emitter.trigger("onload"),this.__onloaded=!0},_flushOnUnloadCallbacks:function(){this.__emitter&&this.__emitter.trigger("unload")},_my:function(){return h+this.cid+"_"},ge:function(e){return document.getElementById(R(this.cid,e))},createModal:function(e){var t=i("./shared/modal.js"),n=t.fromComponent(this);if(e){var o=this.getHmac();if(!o)throw new Error("Invalid hmac for component: "+this.cid);n.fromServerCall(o,e)}return n},emitEvent:function(e){u.ComponentProxy.dispatch(e,this.cid)},handleEvent:function(e,t){u.ComponentProxy.subscribe(e,t,this.cid)},$id:function(e){if("@"!=e[0])throw new Error("Expect id to begin with @. Got: "+e);return a("#"+R(this.cid,e))},serverCall:function(e){var t=this.getHmac();if(t){return new(i("./shared/core/rpc.js").ServerCall)(t,e,this)}},_addNidOverrideMetadataInRpc:function(e,t){t.__extra_args.nid_override!==undefined&&(e.nid_override=t.__extra_args.nid_override)},rerenderProperties:function(){return null},shouldBroadcastReload:function(e){return!0}}),j=O.extend({__init__:function(e){this._super(e,null,{},{}),this.isVirtual=!0,r.initComponent(this)}}),M=t.makeVirtualComponent=function(e){return new j(e)},R=t.getIdAttr=function(e,t){return t.replace("@",[h,e,"_"].join(""))}},"./shared/core/rpc.js":function(e,t,i){var n,o,s,a,r,d=i("./shared/errors.js"),l=i("./shared/events/index.js"),c=i("./shared/util.js"),u=i("./shared/perf.js"),h=i("./settings.js"),p=i("./shared/loading.js"),_=i("./shared/w2.timing.js"),f=i("./shared/jquery.js"),m=i("./shared/core/component.js"),g=i("./shared/core/webnode.js"),v=i("./shared/client.js"),b=i("./shared/rpc_manager.js"),y=i("./shared/window_manager.js"),w=i("./shared/Class.js").Class,E=i("./shared/broadcast.js"),C=i("./shared/reactBridge.js");h.isExpandedBroadcast||(n=i("./w2.livenode.js")),s=i("./webnode2.js"),a=i("./w2.errors.js"),o=i("./actions.js");var S={},T=!1;l.GlobalProxy.subscribe(l.Types.WEBNODE_RPC_RETRY_FAILED,function(e){var t=S[e.payload.requestId];t&&(t(),delete S[e.payload.requestId])});var k=function(e){if(Array.isArray(e.app_data)){for(var t=0;t0&&l.GlobalProxy.dispatch({type:l.Types.PMSG_SHOW,payload:{content:e,fadeOut:!0}})},x=w.extend({__init__:function(){this.__data={args:[],kwargs:{}},this.__success=null,this.__earlySuccess=null,this.__error=null,this.__contentFor=null,this.__url=null,this.__exceptionCatchAll=null,this.__name=null,this.__liveMutation=!1,this.__inLiveMutation=!1,this.__optimisticUpdate=!1,this.__liveMutateBroadcastId=null,this.__creationTime=Date.now(),this.__syncXhr=!1,this.__exceptionPatterns={},this.__isRelatedToUserAction=a.canBeRelatedToUserAction()},args:function(){return this.__data.args=Array.prototype.slice.call(arguments),this},kwargs:function(e){return this.__data.kwargs=c.extend({},e),this},url:function(e){return this.__url=e,this},_url:function(){return this.__url},_xhrFields:function(){return this.__xhrFields},xhrFields:function(e){return this.__xhrFields=e,this},_syncXhr:function(){return this.__syncXhr},syncXhr:function(e){return this.__syncXhr=e,this},_appFields:function(){return this.__appFields},appFields:function(e){return this.__appFields=e,this},success:function(e){return this.__success=e,this},earlySuccess:function(e){return this.__earlySuccess=e,this},error:function(e){return this.__error=e,this},_error:function(){return this.__error||this._defaultErrorHandler},_defaultErrorHandler:function(e,t,i){if((h.debug||Math.random()<.1)&&400!==e.status&&504!==e.status&&!(h.debug&&502===e.status)&&0!==e.status){var n={statusCode:e.status,status:t,error:i,name:this.__name},o="Unhandled xhr error: "+JSON.stringify(n);this._logError(o)}},except:function(e,t){switch(arguments.length){case 1:this.__exceptionCatchAll=e;break;case 2:if("string"!=typeof e)return void this._logError("Except pattern should be a string, got: "+typeof e);this.__exceptionPatterns[e]=t;break;default:var i=Array.prototype.slice.call(arguments);this._logError("Invalid arguments to except: "+JSON.stringify(i))}return this},contentFor:function(e,t){if(t=t||{},!t.parentCid){if(!this._component)return void this._logError("contentFor parentCid not specified for non component rpc.");t.parentCid=this._component.cid}return e instanceof f&&(e=e.get(0)),t=c.extend(t,{element:e}),t.useLoadingSpinner||!1===t.useLoadingSpinner||(t.useLoadingSpinner=!0),this.__contentFor=t,this},sendJsData:function(e){return this._sendJsData=!!e,this},liveMutate:function(e){return h.isExpandedBroadcast&&(this.__liveMutateBroadcastId=E.getId()),h.isExpandedBroadcast?E.showLiveSpinner():(this.__liveMutation=!0,e=e||{},e.optimisticUpdate===undefined?this.__optimisticUpdate=!1:this.__optimisticUpdate=e.optimisticUpdate),this},disableDefaultUserPerceivedLogging:function(){return this._disableDefaultUserPerceivedLogging=!0,this},sendOnlyOnce:function(){return this._onlyOnce(),this.send()},sendUsingBeacon:function(){if(v.isNativeApp())return this._send();if(this.syncXhr(!0),!(window.navigator&&window.navigator.sendBeacon&&!0))return this._send();var e=new window.FormData,t=this._data();for(var i in t)e.append(i,t[i]);try{window.navigator.sendBeacon(this._url(),e)}catch(e){this._send()}},send:function(e){if(!e||!e.batched)return this._send();b.enqueueRequest(this)},_send:function(){var e=h.subdomain_name||"www",t=this._url();if(v.isNativeApp()&&(t.startsWith("//")&&(t=window.location.protocol+t),t.startsWith("http://")||t.startsWith("https://"))){var i=c.getLocation(t),o=i.hostname,a=o.indexOf(h.subdomain_suffix);e=o.substr(0,a-1)||"www",t=i.pathname}if(!h.isExpandedBroadcast&&this.__liveMutation&&(this.__inLiveMutation=!0,this.__liveMutationInfo=n.startMutation(this.__optimisticUpdate)),this.__contentFor){if(!h.windowId)return this;this.__contentFor.useLoadingSpinner&&(this.__contentForLoadingTimeout=setTimeout(function(){s.forgetContents(f(this.__contentFor.element));var e=document.createElement("div");e.className="__contentfor_loading_dots",e.appendChild(p.createDots()),this.__contentFor.element.appendChild(e),this.__contentForLoadingDots=e}.bind(this),150))}var r={post:this._data(),url:t,subdomain:e};if(!T&&t.startsWith(h.serverCallUrl)&&(r.post.__first_server_call=!0,T=!0),this._beforeSendHandler(),this.__onlyOnce){if(this._isSimilarServerCallActive())return this;this._component.activeServerCalls[this.__method]=1}var d=this._successHandler.bind(this),l=this._error().bind(this),u=this._completeHandler.bind(this);this.__startTime=_.getTime(),r.dataType="json",r.type="POST",r.xhrFields=this._xhrFields(),r.async=!this._syncXhr();var m=this._beforeErrorHandler.bind(this);r.success=d,r.error=function(e,t,i){try{m.apply(this,arguments)}finally{l.apply(this,arguments)}},r.complete=u,r.data=r.post,f.ajax(r)},_beforeSendHandler:function(){this.__hmac&&(this._action=u.startPOST({hmac:this.__hmac,method:this.__method}),this._disableDefaultUserPerceivedLogging||(this._userPerceivedAction=u.startUserPerceived({hmac:this.__hmac,method:this.__method})))},_beforeErrorHandler:function(e,t,i){this.__contentFor&&this.__contentFor.useLoadingSpinner&&this.__contentForLoadingDots&&this.__contentFor.element.removeChild(this.__contentForLoadingDots),a.reportAjaxError(e,t,i,this.__isRelatedToUserAction,this.__creationTime)},_completeHandler:function(){if(this.__startTime&&_.logRequestTime(this.__name,this.__startTime),this._action&&(u.finishAction(this._action),this._action=null),!this._disableDefaultUserPerceivedLogging&&this._userPerceivedAction&&(u.finishAction(this._userPerceivedAction),this._userPerceivedAction=null),this.__onlyOnce&&this._isSimilarServerCallActive()&&delete this._component.activeServerCalls[this.__method],this.__contentForLoadingTimeout&&clearTimeout(this.__contentForLoadingTimeout),!h.isExpandedBroadcast&&this.__inLiveMutation){if(this.__liveMutationInfo){var e=this.__liveMutationInfo.transactionId;e&&n.mutationDoneAfterVersion(e,0)}this.__inLiveMutation=!1}},_successHandler:function(e){if(e.pmsg&&k(e.pmsg),e.exception)return void this._handleException(e);if(this.__earlySuccess&&this.__earlySuccess(e.value),this.__contentFor){var t=f(this.__contentFor.element);s.forgetContents(t),document.body.contains(t.get(0))&&(this.__contentFor.inPlace?(t.replaceWith(f(e.value.html)),g.evaluateContentJS(e.value)):g.setContent(t,e.value)),f(document).trigger("rpc_content_for_done",{opts:this.__contentFor,value:e.value})}this.__success&&this.__success(e.value),!this.__liveMutation||"post_reload"!=h.pageMode||h.isLoggedIn||y.isPendingNavigation()||y.reload(),this.__liveMutateBroadcastId&&E.markComponentsAsSafeToReload(this._component),e.dirtied_depkeys&&Object.keys(e.dirtied_depkeys).length<=200?E.reloadDirtiedDepkeys(e.dirtied_depkeys,E.shouldForceReloadDirtiedDepkeys(e.dirtied_depkeys),!1,!0):E.hideLiveSpinner(),e.post_perf_html&&l.DocumentProxy.dispatch({type:l.Types.PERF_POST_HTML,payload:{html:e.post_perf_html,js:e.post_perf_js}})},_onlyOnce:function(){return this._component.activeServerCalls||(this._component.activeServerCalls={}),this.__onlyOnce=!0,this},_invokeExceptionCallback:function(e){var t=this.__exceptionPatterns[e.exception.type];return t?t(e.exception,e,this):!this.__exceptionCatchAll||void this.__exceptionCatchAll(e.exception,e,this)},_handleException:function(e){if(this._invokeExceptionCallback(e)){var t=h.request_id,i={exceptionType:e.exception.type,requestId:t};l.DocumentProxy.dispatch({type:l.Types.WEBNODE_RPC_EXCEPTION,payload:i}),C.emitEventToReact(l.Types.WEBNODE_RPC_EXCEPTION,i),S[t]=this.send.bind(this)}},_data:function(){h.formkey||this._logError("Formkey not set, cannot send request securely.");var e;try{e=JSON.stringify(this.__data,function(e,t){return t===undefined?null:t})}catch(t){this._logError("Unable to JSON encode arguments for RPC."),e=JSON.stringify({error:"Unable to JSON encode arguments for RPC"})}var t={json:e,revision:h.revision,page_load_uid:h.uid,formkey:h.formkey,postkey:h.postkey,window_id:h.windowId,referring_controller:h.controller,referring_action:h.action};if(this.__contentFor){t.parent_cid=this.__contentFor.parentCid;var i=this.__contentFor.element,n=m.getLiveChildren(t.parent_cid),s=n.filter(function(e){return i.contains(document.getElementById(e))});t.parent_domid=m.getLiveParent(t.parent_cid),t.domids_to_remove=JSON.stringify(s)}if(this.__liveMutation&&c.extend(t,this.__liveMutationInfo.data),this.__liveMutateBroadcastId&&(t.broadcast_id=this.__liveMutateBroadcastId),this.__hmac){t.__hmac=this.__hmac,t.__method=this.__method;var a=o.startOrUpdateAction(t.__e2e_action_id,{url:this.__url,hmac:this.__hmac,method:this.__method,args:t.args,kwargs:t.kwargs});t.__e2e_action_id=a.id}return this._component&&(this._sendJsData&&(t.js_init=JSON.stringify(this._component.__js_init)),t.__metadata=JSON.stringify(D(this._component))),t},_isSimilarServerCallActive:function(){return!!this._component.activeServerCalls&&this.__method in this._component.activeServerCalls},_errorDebugInfo:function(){return"url: "+this.__url},_logError:function(e){e=this._errorDebugInfo()+"\n\n"+e,d.logJsError("coreRpc",e)}});t.rpc=function(e){return(new x).url(e)},t.ServerCall=x.extend({__init__:function(e,t,i){this._super(),this.__hmac=e,this.__method=t,this.__name=this.__hmac+"."+this.__method,this.__exceptionPatterns={state_expired:this._stateExpired.bind(this),invalid_parent_component:this._invalidParentComponent.bind(this)};var n=h.serverCallUrl;v.isIOSApp()||(n=y.addParamToURL(n,"_h",e),n=y.addParamToURL(n,"_m",t)),this.url(n),this._component=i,this._sendJsData=!0,this._action=null,this._disableDefaultUserPerceivedLogging=!1,this._userPerceivedAction=null},_stateExpired:function(){h.isExpandedBroadcast||n.reportPageNeedsReload("livenode_state_expired")},_invalidParentComponent:function(){h.isExpandedBroadcast||(this._logError("Invalid contentFor parent: "+JSON.stringify(this.__contentFor)),n.reportPageNeedsReload("livenode_contentfor_invalid_parent"))},_errorDebugInfo:function(){return["component: "+m.getErrorLabel(this._component.cid),"method: "+this.__method].join("\n")}});var A={},L=[];t.addMetadataCallback=function(e){L.push(e)};var D=function(e){var t=e.cid,i=t in A?A[t]:{};delete A[t];for(var n=0;ne)return}};exports.initialize2=function(e,t,i,n,o,s){i&&settings.onloadDelay>0&&sleep(settings.onloadDelay),coreComponent.beforeOnLoad(i),coreComponent.addComponentMetadata(e),t=t.map(function(e){return createComponentInstance(e,i)}),t=t.filter(function(e){return e}),coreComponent.registerComponents(t),onLoadComponents(t,i),n&&(o!==undefined&&(n=[n,o,s]),broadcast.initialize(n)),coreComponent.afterOnLoad(i)};var setContentHTML=exports.setContentHTML=function(e,t){e.html?e.html(t.html):e.innerHTML=t.html},evaluateContentJS=exports.evaluateContentJS=function(content){var js=content.js?content.js:content;eval(js)};exports.setContent=function(e,t){setContentHTML(e,t),evaluateContentJS(t)};var handleModuleNotFoundDebug=function(e){return}},"./shared/datetime.js":function(e,t,i){var n=i("./settings.js"),o=t.SECOND=1e3,s=t.MINUTE=60*o,a=t.HOUR=60*s,r=t.DAY=24*a,d=function(){return n.datetime_strings[n.interfaceLanguage]},l=function(e,t){return e.replace(/\{([^{}]*)\}/g,function(e,i){return t[i]})},c=function(e,t){var i,n=new Array(4),l=[r,a,s,o],c=d().timeAbbrevs;for(i=0;i=0&&l[h]=-2*o?d().justNow:h.toLocaleDateString(n.interfaceLanguage,{weekday:"short",year:"numeric",month:"short",day:"numeric"});if(t&&(i=c(p,t)))return l(d().agoTemplate,{time:i});if(pt?a(m,u):f=setTimeout(r,e)}function d(){a(b,f)}function l(){var i,n;if(c=arguments,p=s(),_=this,m=b&&(f||!y),!1===v)i=y&&!f;else{u||y||(g=p);var o=v-(p-g);n=o<=0||o>v,n?(u&&(u=clearTimeout(u)),g=p,h=e.apply(_,c)):u||(u=setTimeout(d,o))}return n&&f?f=clearTimeout(f):f||t===v||(f=setTimeout(r,t)),i&&(n=!0,h=e.apply(_,c)),!n||f||u||(c=_=undefined),h}var c,u,h,p,_,f,m,g=0,v=!1,b=!0;if("function"!=typeof e)throw new Error("Only able to debounce functions.");t=t<0?0:+t||0;var y;return!0===n?(y=!0,b=!1):i(n)&&(y=!!n.leading,v="maxWait"in n&&Math.max(+n.maxWait||0,t),b="trailing"in n?!!n.trailing:b),l.cancel=o,l},t.throttle=function(e,n,o){var s=!0,a=!0;if("function"!=typeof e)throw new Error("Only able to throttle functions.");return i(o)&&(s="leading"in o?!!o.leading:s,a="trailing"in o?!!o.trailing:a),t.debounce(e,n,{leading:s,maxWait:n,trailing:a})}},"./shared/device_model.js":function(e,t,i){i("./shared/client.js").isIOS()&&i("./third_party/device_atlas.js")},"./shared/dom.js":function(e,t,i){function n(e){if(!e||!e.parentNode)return!1;var t=e.getAttribute("id");e.setAttribute("id",d);var i=!!document.getElementById(d);return t?e.setAttribute("id",t):e.removeAttribute("id"),i}var o=i("./shared/jquery.js"),s=i("./shared/util.js"),a=i("./shared/eventemitter.js"),r=i("./shared/browser.js"),d=(new Date).toString(16),l=!1;t.onDocClick=function(){var e=new a.EventEmitter,t=s.once(function(){o(document).on("click",function(t){e.trigger("click",[t.target])})});return function(i){t(),e.on("click",i)}}(),t.getScrollbarWidth=function(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var i=e.offsetWidth;t.style.overflow="scroll";var n=e.offsetWidth;return i==n&&(n=t.clientWidth),document.body.removeChild(t),i-n},t.anchor=function(e,t){if(e=o(e),l||e.length<1)return e;l=!0;var i=[],s=o(window).scrollTop(),a=o(window).scrollLeft();i.length=e.length;for(var r=0;e[r];++r)i[r]=[e[r],o(e[r]).offset().top-s];var d=function(){for(var e,t,s,r={},d=0,c=[undefined,-1];t=i[d++];)n(t[0])&&(e=o(t[0]).offset().top-t[1],s=r[e]=(r[e]||0)+1,c[1]0&&y()},t.reportPageData=function(e){if(null!==e){var t=r.timing,i={};for(var o in t)"components"!==o&&"_components"!==o&&(i[o]=t[o]);p=n.extend(e,{win_perf:{path:window.location.pathname,revision:a.revision,request_id:a.request_id,controller:a.controller,action:a.action,server_time:t.server_time,total_worker_time:t.total_worker_time,window_id:t.window_id,is_css_inlined:t.is_css_inlined,is_early_js_inlined:t.is_early_js_inlined,experiments:t.experiments,envs:t.envs},w2_timing:i}),g()}};var m=function(){return window.performance&&window.performance.timing},g=function(){if(m()&&0===window.performance.timing.loadEventEnd)return void setTimeout(g,250);v()},v=function(){p.win_perf.timing=d.getNavigationTiming()||{};var e=c.getFirstPaint();0!==e&&(p.win_perf.timing.firstPaint=e),Math.random()<=s.speed_index_sampling_rate&&(p.win_perf.speedIndex=c.getSpeedIndex()),r.stop(),u=!0,b()},b=function(){w()},y=function(){var e=!1;l.isMobileWeb()&&u&&(e=!0),!m()&&_&&(e=!0),u&&p&&_&&(e=!0),l.isNativeApp()&&a.isPagePrefetched&&!f&&(e=!1),e&&w()},w=function(){if(!h){h=!0;var e=n.extend(p||{},_||{});a.shouldReportE2E&&setTimeout(function(){e.resource_timing=d.getResourceTimingInfo(),e.cdn=a.cdn,o.log("perf/get_e2e",e)},100),a.componentInspector||(delete r.timing.components,delete r.timing._components)}}},"./shared/email.js":function(e,t){t.isValidEmail=function(){var e="[^\\x0d\\x22\\x5c\\x80-\\xff]",t="[^\\x0d\\x5b-\\x5d\\x80-\\xff]",i="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+",n="\\x5c[\\x00-\\x7f]",o="\\x5b("+t+"|"+n+")*\\x5d",s="\\x22("+e+"|"+n+")*\\x22",a=i,r="("+a+"|"+o+")",d="("+i+"|"+s+")",l=r+"(\\x2e"+r+")*",c=d+"(\\x2e"+d+")*",u=c+"\\x40"+l,h="^"+u+"$",p=new RegExp(h);return function(e){return p.test(e)}}()},"./shared/embedly.js":function(e,t,i){function n(e,t){o(e,function(e){t(e?e:null)})}function o(e,t){s.rpc("/embedly_/get_oembedly_json_POST").kwargs({url:e}).success(function(e){t("error"in e?null:e)}).error(function(){t(null)}).send()}var s=i("./shared/core/rpc.js");t.getOEmbedlyData=n},"./shared/eventemitter.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/errors.js");t.EventEmitter=n.extend({on:function(e,t){this.__handlers=this.__handlers||{},this.__handlers[e]=this.__handlers[e]||[],this.__handlers[e].push(t)},off:function(e,t){if(this.__handlers&&this.__handlers[e]){var i=this.__handlers[e].indexOf(t);-1!=i&&this.__handlers[e].splice(i,1)}},once:function(e,t){this.__onceHandlers=this.__onceHandlers||{},this.__onceHandlers[e]=this.__onceHandlers[e]||[],this.__onceHandlers[e].push(t)},trigger:function(e,t){for(var i=this.__handlers&&this.__handlers[e]||[],n=[],s=0;s0?(c=t.data,e&&e(!0,t.data)):e&&e(!1,null)})};t.asyncUpdatePermissions=function(){null===c&&l(function(){FB.getLoginStatus(function(e){"connected"==e.status&&u()})})},t._disconnect=function(){FB.getLoginStatus(function(e){e.authReponse?FB.api({method:"auth.revokeAuthorization"},function(e){e?console.log("Successfully disconnected"):console.error("Disconnection failed")},console.error):console.warn("Already not connected")})};var h=t.hasPermission=function(e){return c&&1==c[e]};t.requestPermissions=function(e,t){var i=function(e){return e.split(",").every(h)};i(e)?t(!0):FB.login(function(n){"connected"===n.status?u(function(n,o){t(n&&i(e))}):t(!1)},{scope:e})};var p=function(){return window.fbLoaded?FB.getAuthResponse():null};t.getAccessToken=function(){var e=p();return e?e.accessToken:null},t.getExpiresIn=function(){var e=p();return e?e.expiresIn:null},t.getFbUid=function(){var e=p();return e?e.userID:null}},"./shared/frame_busting.js":function(e,t,i){var n=i("./interface/settings.js");t.check=function(){if(n.enableFrameBusting){var e=!1;try{e=!/\.quora\.com$/i.test(window.top.location.host)}catch(t){e=!0}e&&""+window.top.location!=""+window.location&&(window.top.location=window.location)}}},"./shared/fx.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/util.js"),s={duration:400,easing:""},a=function(e,t){var i=!1;e.one("webkitTransitionEnd transitionEnd",function(){i=!0});var n=function(){i||e.trigger("transitionEnd")};setTimeout(n,t)},r=function(e){e.each(function(){this.offsetHeight})},d=function(e,t,i){i=o.extend({},s,i);var n="all "+i.duration+"ms "+i.easing;t.webkitTransition=n,t.mozTransition=n,t.transition=n;var r=o.once(function(){e.dequeue(),i.complete&&i.complete.apply(e)});e.queue(function(){e.one("webkitTransitionEnd transitionEnd",r),a(e),e.css(t)})},l=function(e,t,i,o){e=n(e),e.css(t),r(e),d(e,i,{duration:o||s.duration})};t.highlight=function(e,t){l(e,{backgroundColor:"#ffff99"},{backgroundColor:"transparent"},t)},t.fadeIn=function(e,t){l(e,{opacity:0},{opacity:1},t)}},"./shared/google_.js":function(e,t,i){var n=i("./shared/loadjs.js").loadJS,o=i("./shared/util.js"),s=i("./shared/onload.js"),a=i("./settings.js"),r=[],d=[],l=o.once(function(){window.gapiAsyncInit=function(){window.gapi.load("auth2",function(){for(window.auth2=window.gapi.auth2.init({client_id:a.googleClientId,cookie_policy:a.googleCookiePolicy});r.length;)r.pop().call()})},n("//apis.google.com/js/client:platform.js?onload=gapiAsyncInit")});t.onInit=function(e){window.gapi?e():(s.execAfterLoadDelayed(l),r.push(e))};var c=o.once(function(){n("//accounts.google.com/gsi/client",function(){for(;d.length;)d.pop().call()})});t.onGoogleOneTapInit=function(e){s.execAfterLoadDelayed(c),d.push(e)}},"./shared/google_tag_services.js":function(e,t,i){var n=i("./shared/loadjs.js").loadJS,o=i("./shared/util.js"),s=i("./shared/onload.js"),a=(i("./shared/client.js"),!1),r=[],d=o.once(function(){n("https://www.googletagservices.com/tag/js/gpt.js",function(){for(;r.length;)a=!0,r.pop().call()})});t.load=function(){l(function(){})};var l=t.onInit=function(e){a?e():(s.execAfterLoadDelayed(d),r.push(e))}},"./shared/history_stack.js":function(e,t,i){var n=i("./shared/client.js"),o=i("./shared/beforeunload.js"),s=!1,a=[];t.pushState=function(e){if(!n.isNativeApp()){var t=a.push(e);window.history.pushState({n:t},"")}},t.popState=function(){n.isNativeApp()||window.history.go(-1)},t.skipBack=function(e){n.isNativeApp()||e<=0||(s=!0,a.splice(-e,e),window.history.go(-e))},n.isNativeApp()||(o.registerHandler(function(){t.skipBack(a.length)}),window.addEventListener("popstate",function(){if(s)return void(s=!1);var e=a.pop();e&&e()}))},"./shared/hyperlink_embed.js":function(e,t,i){var n=i("./qtext2/config.js").config;t.hyperlinkEmbedsEnabled=function(){return n.options.qtext_hyperlink_embed}},"./shared/impression_tracker.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/viewport.js"),s=i("./shared/visibility_state.js"),a=i("./shared/jquery.js"),r=i("./shared/beforeunload.js"),d=i("./shared/util.js"),l=i("./third_party/intersection-observer.js").IntersectionObserver,c=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()},u={ratioThreshold:.1,minTimeInViewMs:0,enterViewport:!0,exitViewport:!0,oneOffTracking:!1},h=n.extend({__init__:function(e,t){this._impressionCallback=e,this._options=d.extend({},u,t),this._randomId=d.randomId("impression-tracker"),this._observer=this._createObserver(),this._elementsInView=[],this._elementsInViewTracked=[],this._optDataKey=this._randomId+"-optData",this._lastViewedKey=this._randomId+"-lastViewed",this._elementsToTrack=[],this._observedElements=[],this._handleVisibilityStateChanges()},observe:function(e,t){e&&(null!=t&&a(e).data(this._optDataKey,t),s.isVisible()?(this._observer.observe(e),this._observedElements.push(e)):this._elementsToTrack.push(e))},unobserve:function(e){if(e){this._observer.unobserve(e),this._untrackElemDelayed(e);var t=this._elementsToTrack.indexOf(e);-1!==t&&this._elementsToTrack.splice(t,1);var i=this._observedElements.indexOf(e);-1!==i&&this._observedElements.splice(i,1)}},_handleVisibilityStateChanges:function(){var e=this;s.onChange(function(t){if(t)for(;e._elementsToTrack.length;)e.observe(e._elementsToTrack.pop());else for(;e._observedElements.length;){var i=e._observedElements.pop();e.unobserve(i),e._elementsToTrack.push(i)}})},_getRootMargin:function(){var e=o.siteHeaderHeight();return e?["-",e,"px 0px 0px 0px"].join(""):"0px"},_createObserver:function(){var e={threshold:[this._options.ratioThreshold],rootMargin:this._getRootMargin()};return new l(this._observerHandler.bind(this),e)},_trackElemDelayed:function(e,t){-1===this._elementsInView.indexOf(e)&&(a(e).data(this._lastViewedKey,t),this._elementsInView.push(e))},_untrackElemDelayed:function(e){var t=this._elementsInView.indexOf(e);-1!==t&&(a(e).data(this._lastViewedKey,null),this._elementsInView.splice(t,1)),-1!==(t=this._elementsInViewTracked.indexOf(e))&&this._elementsInViewTracked.splice(t,1)},_observerHandler:function(e){var t=this;e.forEach(function(e){var i=e.isIntersecting&&e.intersectionRatio>t._options.ratioThreshold,n=e.target;0===t._options.minTimeInViewMs?t._onImpression(n,i):i?t._trackElemDelayed(n,e.time||c()):(-1!==t._elementsInViewTracked.indexOf(n)&&t._onImpression(n,!1),t._untrackElemDelayed(n))}),0!==t._elementsInView.length&&setTimeout(function(){for(var e=[],i=0;i=t._options.minTimeInViewMs&&e.push(n)}for(var s=0;se.maxScroll&&(e.maxScroll=window.scrollY)})},_startVisibilityTracking:function(){var e=this;s.onChange(function(t){r.isUnloading()||(t||(e.didVisibilityChange=!0),e.lastVisibility=t)})},_enableOnLeaveWindow:function(e){var t=this;e&&r.registerHandler(function(){var i=t._getWindowViewData();e(i)})},_getWindowViewData:function(){var e=this;return{max_scroll:e.maxScroll,window_height:window.innerHeight||document.documentElement.clientHeight,time_spent:c()-e.startTime,had_visibility_event:e.didVisibilityChange,is_visible_on_exit:e.lastVisibility}}}),_=new p;t.createTracker=function(e,t){return new h(e,t)},t.startWindowTracker=function(e){_.start(e)}},"./shared/init.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./shared/cookies.js"),s=i("./shared/onload.js"),a=i("./shared/client.js"),r=i("./shared/window_manager.js");i("./shared/client_log.js").init(),i("./shared/action_log.js").init(),i("./shared/log_sender.js").init(),i("./shared/activity_metrics.js").init(),i("./shared/frame_busting.js").check(),i("./shared/qtext.js").init(),i("./shared/links_logger.js"),i("./shared/lazy_load_images.js"),i("./shared/device_model.js"),n.DocumentProxy.subscribe(n.Types.WEBNODE_RPC_EXCEPTION,function(e){"network_membership_required"==e.payload.exceptionType&&r.navigateTo("/join")}),a.isNativeApp()||o.setCookie("tz",(new Date).getTimezoneOffset(),{path:"/"}),s.execAfterLoad(function(){a.isNativeApp()||"undefined"==typeof perfMetrics||perfMetrics.onFirstInputDelay(function(e,t){i("./shared/log_sender.js").log("log_question_fid",{delay:e,evt:t,type:t.type,target:t.target,returnValue:t.returnValue,url:window.location.href})})})},"./shared/inline_css.js":function(e,t,i){var n=i("./shared/cookies.js"),o="q-inline-css",s=function(e){e=e||function(){};var t=document.getElementsByClassName(o);if(0==t.length)return void e();window.requestAnimationFrame(function(){for(var i;t.length;)i=t[0],i.parentElement.removeChild(i);e()})},a=function(e,t){s(),e&&t&&n.setCookie(e,t,{expires:365})};t.loadStyleSheet=function(e,t,i){var n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href",e),n.setAttribute("id","onLoadCss"),n.onload=function(){a(t,i)},document.head.appendChild(n)},t.getData=function(){var e=document.getElementsByClassName(o),t=document.getElementById("inlineCssLoader");if(!t||0===e.length)return[];for(var i=[],n=0;n-1&&o.splice(t,1)},n(document).on("keydown",function(e){for(var t=o.length-1;t>=0;t--){if(0==o[t](e)||e.isDefaultPrevented())return}})},"./shared/keystrokes.js":function(e,t){function i(e,t){for(var i=0,o=n.length;i/?]+)\\.)+",i="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",n="(?:"+t+i+")",o="(?:[;/][^#?<>\\s\\[\\]]*)?",s="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",a="\\b"+e+"[^<>\\s\\[\\]]+",r="\\b"+n+o+s+"(?!\\w)",d="mailto:",l="(?:"+d+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+n+s+"(?!\\w)",c=new RegExp("(?:"+a+"|"+r+"|"+l+")","ig"),u=new RegExp("^"+e,"i"),h={"'":"`",">":"<",")":"(","]":"[","}":"{","»":"«","›":"‹"},p={callback:function(e,t){return t?''+e+"":e},punct_regexp:/(?:[!?.,:;'"]|(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(e,t){t=t||{};var i,n,o,s,a,r,l,_,f,m,g,v,b="",y=[];for(n in p)t[n]===undefined&&(t[n]=p[n]);for(;i=c.exec(e);)if(o=i[0],r=c.lastIndex,l=r-o.length,!/[\/:]/.test(e.charAt(l-1))){do{_=o,v=o.substr(-1),g=h[v],g&&(f=o.match(new RegExp("\\"+g+"(?!$)","g")),m=o.match(new RegExp("\\"+v,"g")),(f?f.length:0)<(m?m.length:0)&&(o=o.substr(0,o.length-1),r--)),t.punct_regexp&&(o=o.replace(t.punct_regexp,function(e){return r-=e.length,""}))}while(o.length&&o!==_);s=o,u.test(s)||(s=(-1!==s.indexOf("@")?s.indexOf(d)?d:"":s.indexOf("irc.")?s.indexOf("ftp.")?"http://":"ftp://":"irc://")+s),a!=l&&(y.push([e.slice(a,l)]),a=r),y.push([o,s])}for(y.push([e.substr(a)]),n=0;n1)&&(n=1),!(n>0&&Math.random()>n)){var s=null,a=1e3*Date.now();i.scribeOnly?(t.scribe_category=e,s={category:"scribe_only",data:t,time:a}):s={category:e,data:t,time:a};var r=d.verbose_client_logging_categories;Array.isArray(r)&&(r.includes("ALL")||r.includes(e))&&console.log("Log ["+e+"]:",t);var l=p();l.enqueue(s,i.shouldDeduplicate),l.scheduleSend()}};t.debugLog=function(e){};var h=t.LoggingManager=s.extend({__init__:function(e,t,i,n){this.msgBuffer=[],this.retryBuffer=[],this.timer=null,this.maxBatchSize=null==e?20:e,this.maxBufferedSize=null==t?50:t,this.maxRetries=null==i?1:i,this.batchInterval=null==n?1e3:n},_isDuplicateMessage:function(e){return this.msgBuffer.some(function(t){return t.category==e.category&&o.jsonEqual(t.data,e.data)})},enqueue:function(e,t){t&&this._isDuplicateMessage(e)||(this.msgBuffer.push(e),this.numPending()>this.maxBufferedSize&&this.send())},enqueueForRetry:function(e){var t=this;e=e.map(function(e){return e.numRetries=(e.numRetries||0)+1,e}).filter(function(e){return e.numRetries<=t.maxRetries}),Array.prototype.push.apply(this.retryBuffer,e)},scheduleSend:function(){this.timer||0===this.numPending()||(this.timer=setTimeout(this.send.bind(this),this.batchInterval))},send:function(e){this.timer&&(clearTimeout(this.timer),this.timer=null);var t=this._getMessagesToSend();if(0!==t.length){var i=a.rpc(_());c.isIOSApp()&&i.appFields({maxRetries:1,persistent:!0});var n=this,o=i.xhrFields({withCredentials:!0}).kwargs({messages:t,nid:l.nid}).success(function(){n.scheduleSend()}).error(function(){n.enqueueForRetry(t),n.scheduleSend()});e?o.sendUsingBeacon():o.send()}},_getMessagesToSend:function(){for(var e=[];e.length"+e+"":t},a=t.getParts=function(e){for(var t,i,n,o,s,a="\\s\\S",r=new RegExp("\\[math\\](["+a+"]+?)\\[\\/math\\]","g"),d=[],l=0;t=r.exec(e);)i=t[0],n=t[1],o=r.lastIndex,s=o-i.length,l!=s&&d.push([e.slice(l,s)]),l=o,d.push([i,n]);return l!=e.length&&d.push([e.substr(l)]),d},r=t.mathify=function(e,t){t=t||s;for(var i=a(e),n="",o=0;o=r&&(n.timeout=!0,c(n.id))}};setInterval(u,a)},"./shared/pixel.js":function(e,t,i){var n=i("./shared/util.js"),o=i("./shared/onload.js"),s=i("./shared/loadjs.js").loadJS,a=i("./shared/log_sender.js"),d="https://www.googletagmanager.com/gtag/js?id=AW-963131518",l="https://www.dwin1.com/15748.js",c=i("./shared/jquery.js");t.fireKeyweePUAEvents=function(e){Array.isArray(e)&&e.length>0&&u(function(t){var i="324685851665859";t("init",i);var n=[];e.forEach(function(e){"CompleteRegistration"===e.name&&(t("trackSingle",i,"Lead"),n.push(e))}),b(n,"keywee","pua")})},t.fireAwinPUAEvents=function(e,t,i,n){Array.isArray(e)&&e.length>0&&p(function(){var o=[];e.forEach(function(e){if("CompleteRegistration"===e.name){var s={};s.Tracking={},s.Tracking.Sale={};var a="1",r=n+":"+a,d="",l="",u="0",h=t,p=i;s.Tracking.Sale.amount=a,s.Tracking.Sale.orderRef=h,s.Tracking.Sale.parts=r,s.Tracking.Sale.voucher=d,s.Tracking.Sale.currency=l,s.Tracking.Sale.test=u,s.Tracking.Sale.channel=n,s.Tracking.Sale.cks=p;var _=c.param({tt:"ns",tv:"2",merchant:15748,amount:a,cr:l,ref:h,parts:r,vc:d,ch:n,testmode:u,cks:p});(new Image).src="https://www.awin1.com/sread.img?"+_,o.push(e)}}),b(o,"awin","pua")})},t.fireGooglePUAEvents=function(e){Array.isArray(e)&&e.length>0&&h(function(t){var i=[];e.forEach(function(e){"CompleteRegistration"===e.name&&(t("event","conversion",{send_to:"AW-963131518/ofx2CNSC3H4Q_vCgywM"}),i.push(e))}),b(i,"google","pua")})},t.fireTwitterPUAEvents=function(e){Array.isArray(e)&&e.length>0&&_(function(t){var i=[];e.forEach(function(e){"CompleteRegistration"===e.name&&(t("track","CompleteRegistration"),i.push(e))}),b(i,"twitter","pua")})},t.fireFacebookPUAEvents=function(e,t){Array.isArray(e)&&e.length>0&&u(function(i){var n="1675581722730896";i("init",n),e.forEach(function(e){e.isCustom?i("trackSingleCustom",n,e.name):i("trackSingle",n,e.name)}),b(e,"facebook","pua"),t&&t()})},t.fireQuoraPUAEvents=function(e,t){Array.isArray(e)&&e.length>0&&f(function(i){var n=[];e.forEach(function(e){"CompleteRegistration"===e.name&&(i("track","CompleteRegistration"),n.push(e))}),b(n,"quora","pua"),t&&t()})},t.fireSnapPUAEvents=function(e,t){Array.isArray(e)&&e.length>0&&m(function(t){var i=[];e.forEach(function(e){"CompleteRegistration"===e.name&&(t("init","c0239ff1-d4eb-4089-95ec-8f10abc087ae",{user_email:"email"}),t("track","SIGN_UP"),i.push(e))}),b(i,"snap","pua")})},t.fireTikTokPUAEvents=function(e){if(Array.isArray(e)&&e.length>0){var t=[];e.forEach(function(e){"CompleteRegistration"===e.name&&(!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=document.location.protocol+"//static.bytedance.com/pixel/sdk.js?sdkid=BMKF54ROH506H3P7E440";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}(),t.push(e))}),b(t,"tiktok","pua")}},t.fireFacebookAdAccountEvents=function(e,t,i){Array.isArray(e)&&e.length>0&&u(function(n){var o="1675581722730896";n("init",o),e.forEach(function(e){e.isCustom?n("trackSingleCustom",o,e.name):n("trackSingle",o,e.name)}),b(e,"facebook","ad_account",t),i&&i()})},t.fireQuoraAdAccountEvents=function(e,t,i){Array.isArray(e)&&e.length>0&&f(function(n){var o=[];e.forEach(function(e){"AddToCart"===e.name&&(n("track","AddToCart"),o.push(e))}),b(o,"quora","ad_account",t),i&&i()})},t.fireMarketoAdAccountEvents=function(e,t,i){Array.isArray(e)&&e.length>0&&g(function(){var n=[];e.forEach(function(e){"Dummy"===e.name&&n.push(e)}),b(n,"marketo","ad_account",t),i&&i()})},t.fireLinkedinAdAccountEvents=function(e,t,i){Array.isArray(e)&&e.length>0&&v(function(){var n=[];e.forEach(function(e){"Dummy"===e.name&&n.push(e)}),b(n,"linkedin","ad_account",t),i&&i()})};var u=function(e){o.execAfterLoadDelayed(function(){!function(e,t,i,n,o,s,a){e.fbq||(o=e.fbq=function(){o.callMethod?o.callMethod.apply(o,arguments):o.queue.push(arguments)},e._fbq||(e._fbq=o),o.push=o,o.loaded=!0,o.version="2.0",o.queue=[],s=t.createElement(i),s.async=!0,s.src=n,a=t.getElementsByTagName(i)[0],a.parentNode.insertBefore(s,a))}(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),e(fbq)})},h=n.once(function(e){o.execAfterLoadDelayed(function(){s(d,function(){function t(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],t("js",new Date),t("config","AW-963131518"),e(t)})})}),p=n.once(function(e){o.execAfterLoadDelayed(function(){s(l,function(){e()})})}),_=n.once(function(e){o.execAfterLoadDelayed(function(){!function(e,t,i,n,o,s){e.twq||(n=e.twq=function(){n.exe?n.exe.apply(n,arguments):n.queue.push(arguments)},n.version="1.1",n.queue=[],o=t.createElement(i),o.async=!0,o.src="//static.ads-twitter.com/uwt.js",s=t.getElementsByTagName(i)[0],s.parentNode.insertBefore(o,s))}(window,document,"script"),twq("init","o015y"),twq("track","PageView"),e(twq)})}),f=n.once(function(e){o.execAfterLoadDelayed(function(){!function(e,t,i,n,o,s){e.qp||(n=e.qp=function(){n.qp?n.qp.apply(n,arguments):n.queue.push(arguments)},n.queue=[],o=document.createElement(t),o.async=!0,o.src=i,s=document.getElementsByTagName(t)[0],s.parentNode.insertBefore(o,s))}(window,"script","https://a.quora.com/qevents.js"),qp("init","f88319ba83cb2e40064aff2dfeaab96e"),qp("track","ViewContent"),e(qp)})}),m=n.once(function(e){o.execAfterLoadDelayed(function(){!function(e,t,i){if(!e.snaptr){var n=e.snaptr=function(){n.handleRequest?n.handleRequest.apply(n,arguments):n.queue.push(arguments)};n.queue=[];var o="script";r=t.createElement(o),r.async=!0,r.src=i;var s=t.getElementsByTagName(o)[0];s.parentNode.insertBefore(r,s)}}(window,document,"https://sc-static.net/scevent.min.js"),e(snaptr)})}),g=n.once(function(e){o.execAfterLoadDelayed(function(){function t(){!1===i&&(i=!0,Munchkin.init("384-CMP-465",{asyncOnly:!0}))}var i=!1,n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="//munchkin.marketo.net/munchkin.js",n.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||t()},n.onload=t,document.getElementsByTagName("head")[0].appendChild(n),e()})}),v=n.once(function(e){o.execAfterLoadDelayed(function(){_linkedin_partner_id="155660",window._linkedin_data_partner_ids=window._linkedin_data_partner_ids||[],window._linkedin_data_partner_ids.push(_linkedin_partner_id);var t=document.getElementsByTagName("script")[0],i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src="https://snap.licdn.com/li.lms-analytics/insight.min.js",t.parentNode.insertBefore(i,t),e()})}),b=function(e,t,i,n){a.log("third_party_ad_platform_pixel",{events:e,platform:t,context:i,ad_account_id:n})}},"./shared/prettyprint.js":function(e,t,i){i("./third_party/prettify.js"),t.prettyPrint=window.prettyPrint},"./shared/qlocal_storage.js":function(e,t,i){function n(){try{if(window.localStorage)return!0}catch(e){return!1}return!1}var o=i("./shared/client.js"),s=null;t.storageAvailable=function(){return!!n()||!(!s||!o.isNativeApp())},t.setItem=function(e,t){if(n())try{window.localStorage.setItem(e,t)}catch(e){if("NS_ERROR_FILE_CORRUPTED"===e.name)return;throw e}else s&&o.isNativeApp()&&s.setItem(e,t)},t.getItem=function(e,t){if(n()){var i=window.localStorage.getItem(e);t(i)}else s&&o.isNativeApp()&&s.getItem(e,function(e){e.success&&t(e.value)})},t.removeItem=function(e){n?window.localStorage.removeItem(e):s&&o.isNativeApp()&&s.removeItem(e)}},"./shared/qtext.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/mathify.js").renderMath,s=i("./shared/core/component.js"),a=i("./shared/twitter_oembed.js"),r=i("./unified_view/qtext_video/player.js"),d=i("./unified_view/qtext_video/uploader.js"),l=i("./shared/prettyprint.js").prettyPrint,c=function(e,t,i){var o=n(e);o.find(t).not(".qt-processed").each(function(e,t){i(t)}),o.find(t).addClass("qt-processed")},u=t.renderQText=function(){c(document,".render_latex",o),c(document,".twitter-tweet",a.loadEmbeds),c(document,"[data-qt-video]",r.setupPlayer),c(document,"[data-qt-video-client-uuid]",d.updateUploadProgress),l()};t.ignoreNode=function(e){var t=function(){};c(e,".twitter-tweet",t),c(e,"[data-qt-video]",t),n(e).find(".render_latex").addClass("ignore_latex").removeClass("render_latex")},t.unIgnoreNode=function(e){n(e).find(".qt-processed").removeClass("qt-processed"),n(e).find(".ignore_latex").addClass("render_latex").removeClass("ignore_latex")},t.init=function(){s.registerAfterOnLoadCallback(u)}},"./shared/question_answer_page_reading_time.js":function(e,t,i){var n=i("./shared/visibility_state.js"),o=i("./shared/log_sender.js").log,s=i("./settings.js"),a=null,r=null;t.startLogging=function(e){a=e,d(),n.onChange(function(e){e?d():l()})};var d=function(){null==r&&(r=Date.now(),o("question_answer_page_reading_time",{action:"open",time:r,aid:a,windowId:s.windowId}))},l=function(){c()},c=function(){if(null!=r){var e=Date.now();o("question_answer_page_reading_time",{action:"close",time:e,reading_time:e-r,aid:a,windowId:s.windowId}),r=null}}},"./shared/question_page_reading_time.js":function(e,t,i){var n=i("./shared/viewport.js"),o=i("./shared/jquery.js"),s=i("./shared/debounce.js").debounce,a=i("./shared/visibility_state.js"),r=i("./shared/log_sender.js").log,d=i("./settings.js"),l=!1,c=null,u=null,h=null,p=[],_=!1;t.registerAnswerComponent=function(e,t){e&&(p.push([e,t]),_||(o(document).on("scroll",s(m,50)),_=!0,f(),a.isVisible()&&setTimeout(m,200)))};var f=function(){a.onChange(function(e){e?m():v()})},m=function(){for(var e=c,t=u,i=p.length;--i>=0;){var o=p[i],s=o[0],a=o[1],r=s.$id("@answer_content").get(0);if(r){if(!n.isElementDefinitelyOutOfViewport(r))if(null==e)e=r,t=a;else if(t==a)e=r;else{var d=window.innerHeight,l=d/2,h=e.getBoundingClientRect(),_=h.top<=l&&h.bottom>=l;if(_)break;var f=r.getBoundingClientRect(),m=f.top<=l&&f.bottom>=l;if(m){e=r,t=a;break}var b=Math.min(Math.abs(h.top-l),Math.abs(h.bottom-l)),y=Math.min(Math.abs(f.top-l),Math.abs(f.bottom-l));y-1},onClick:function(e){e.preventDefault();var t="500",i="400",n="True",o="width="+t+",height="+i+",resizable="+n;window.open(this.share_url,"_BLANK",o)}},t.Facebook={onLoad:function(){o.load()},onClick:function(e){var t=this;return t.is_debugging_mode&&(console.log(t.share_url),console.log(t.target)),window.FB.ui({method:"feed",display:"popup",link:t.share_url},function(i){i&&i.post_id&&(s.logEvent("ShareFacebook",e.target),t.serverCall("record_facebook_share").send())}),!1}}},"./shared/siteuri.js":function(e,t,i){function n(e){this.message=this.errorType+": "+e}function o(e){return"http:"==e.substring(0,5)?"https:"+e.substring(5):e}function s(e){var t=e.match(l);if(!t)return!1;var i=t[1],n=t[2],o=r();if("www."+n!=o){if("www"!=i&&i&&"www."+i+"."+n==o){var s=e.replace("://","://www.").match(l);if(s)return s}return!1}return t}var a=i("./settings.js");n.prototype=new Error,n.prototype.errorType="SiteURIError",n.prototype.constructor="SiteURIError",t.SiteURIError=n,t.getQuoraSubdomain=function(e){return e?e.substring(0,e.lastIndexOf("quora.com")-1):""};var r=function(e,t){var i;return i=t?"quora.com":a.subdomain_suffix||"quora.com",e?e+"."+i:"www."+i};t.netlocForSubdomainName=r;var d=function(e,t){return"http://"+r(e,t)+"/"};t.baseUrlForSubdomainName=d;var l=/https?:\/\/(?:([^.\/]+)\.)?((?:[^.\/]+\.)*quora\.com(?::[0-9]*)?)(\/.*)?/,c=function(e){return!1!==s(e)};t.isSiteAbsoluteUrl=c;var u=function(e){return e.startsWith("/")&&!e.startsWith("//")};t.isSiteRelativeUrl=u;var h=function(e){return c(e)||u(e)};t.isSiteUrl=h;var p=function(e,t){return new _(e,t)};t.URI=p;var _=i("./shared/Class.js").Class.extend({__init__:function(e,t){e instanceof _&&(e=e.unicode());var i,o=s(e),r=t&&t.subdomainName||null,d=t&&t.secure||!1;if(o){if(r)throw new n("subdomain context should not be set for absolute url, url = "+e+", subdomain = "+r);r=o[1],"www"==r&&(r=null),i=o[3]||"",""===i&&(i="/"),"https"==e.substring(0,5)&&(d=!0)}else i=e,"https:"==window.location.protocol&&(d=!0);if("/"!=i[0])throw new n("invalid site uri input "+e);return this.relativeUrl=i,this.subdomainName=r,this.subdomainName||(this.subdomainName=a.subdomain_of_network),this.isSecure=d,this},unicode:function(e){if(a.force_use_absolute_links)return this.absolute(e);var t=this.relativeUrl;return(this.subdomainName||a.subdomain_name)&&(t=d(this.subdomainName,e)+t.substring(1),"/"==t.charAt(t.length-1)&&(t=t.substring(0,t.length-1))),this.isSecure&&(t=o(t)),t},absolute:function(e){var t=d(this.subdomainName,e),i=t+this.relativeUrl.substring(1);return this.isSecure&&(i=o(i)),i},secure:function(e){return o(this.absolute(e))}});t.SiteURI=_},"./shared/toast.js":function(e,t,i){var n,o=i("./shared/Class.js").Class,s=i("./settings.js"),a=i("./shared/client.js"),r=s.interface_strings,d=i("./shared/jquery.js"),l=null,c=t.Toast={show:function(){if(a.isNativeApp()&&this.message_data)return void n.send("showPMsg",this.message_data);null!==l&&l.close(),l=this,this.closeTimeout=setTimeout(this.close.bind(this),this.duration||4e3)},close:function(){clearTimeout(this.closeTimeout),l=null,0!==this.$container.length&&(this.$container.addClass("animate_out"),this.$container.css("paddingBottom",""),setTimeout(this.cleanup.bind(this),1e3))},cleanup:function(){var e=this.$container.get(0);e.parentNode&&e.parentNode.removeChild(e)}},u=o.extend(c).extend({__init__:function(e,t){this.additionalClasses=t||[],this.message=e,this.$container=d(this.render())},render:function(){var e=document.getElementById("pmsg_container");e||(e=document.createElement("div"),e.id="pmsg_container",document.body.appendChild(e)),e.classList=["PMsgContainer"],window.isModalOpen&&e.classList.add("push_to_top");var t=document.createElement("div");t.className=["PMsg"].concat(this.additionalClasses).join(" "),e.appendChild(t);var i=document.createElement("div");return i.className="contents",d(i).text(this.message),t.appendChild(i),t}});t.show=function(e){if(a.isNativeApp())n.send("showPMsg",{message:e});else{new u(e).show()}};var h=t.showError=function(e){if(a.isNativeApp())n.send("showPMsg",{message:e,style:"error"});else{new u(e,["PMsgError"]).show()}};t.showPleaseTryAgainError=function(){h(r.please_try_again)}},"./shared/twitter.js":function(e,t,i){var n=i("./shared/onload.js"),o=i("./shared/util.js"),s=i("./shared/loadjs.js").loadJS,a=!1,r=[],d=o.once(function(){var e=window.twttr={_events:[],ready:function(t){e._events.push(t)}};s("//platform.twitter.com/widgets.js",function(){window.twttr.ready(function(e){for(a=!0;r.length;)r.pop().call()})})});t.onInit=function(e){a?e():(r.push(e),n.execAfterLoadDelayed(d))}},"./shared/twitter_oembed.js":function(e,t,i){function n(e,t,i){var n=a(e);n?t(n,!1):o(e,function(n){if(n){var o=document.createElement("iframe");o.className="tweet-content",o.srcdoc=n.html,t(o,!0),s(e,o)}else i(null)},i)}function o(e,t,i){r.rpc("/twitter/get_twitter_oembed_json_POST").kwargs({url:e}).success(function(e){"error"in e?i(e):t(e)}).error(i).send()}function s(e,t){var i=h[e];i?i.push(t):h[e]=[t]}function a(e){for(var t=h[e]||[],i=0;i0)return n}return null}var r=i("./shared/core/rpc.js"),d=i("./shared/twitter.js"),l=i("./shared/client.js"),c=i("./settings.js"),u=i("./shared/errors.js"),h={};t.getTweetData=n;var p=t.loadEmbeds=function(e){f()&&d.onInit(function(){window.twttr&&window.twttr.widgets?window.twttr.widgets.load(e):u.logJsError("Twitter","Error: Twitter JS initialized but widgets not available")})},_=function(e){d.onInit(function(){window.twttr&&window.twttr.events?window.twttr.events.bind("loaded",e):u.logJsError("Twitter","Error: Twitter JS initialized but events not available")})};t.renderTweetIFrame=function(e){e.onload=function(){var t=e.contentDocument||e.contentWindow.document;_(function(){e.style.height=t.body.scrollHeight+"px"}),p(t.body)}};var f=t.tweetsEnabled=function(){return!(l.isIOSApp()&&c.buildNumber<742)}},"./shared/upload.js":function(e,t,i){var n=i("./shared/beforeunload.js"),o=i("./shared/events/index.js"),s=i("./third_party/resumable.js"),a=i("./settings.js"),r=i("./shared/siteuri.js"),d=i("./shared/jquery.js"),l=function(e){return"quora.com"!=a.subdomain_suffix?e:c(e)},c=function(e){return[window.location.protocol,"//",r.netlocForSubdomainName("upload"),e].join("")},u=function(e,t,i,n,o){var s=new window.FormData;s.append("formkey",a.formkey);for(var r=Object.keys(e),l=0;l/g,">")},t.iterItems=function(e,t){if(!o(e))return void n.logJsError("util.iterItems expects a plain object. got "+e);for(var i=Object.keys(e),s=0;s-1}).each(function(){var e=n(this).data("validator-message"),t=!a[e];n(this).toggleClass("hidden",t)}),this.toggleValidationClasses(e,o)}},t=0;t-1)return!1;t=e.indexOf('"',t+1)}return!0}return!/([.,;:?!]([^\s\d"']))/g.test(e)&&(t(e,e.indexOf('"'))||t(e,e.indexOf("'")))},noEllipses:function(e){return!/\u2026/g.test(e)},sentenceEnd:function(e){return/[.?]\s*["']?$/i.test(e)},punctuation:function(e){return/[.?!]\s*['"]?$/i.test(e)},caps:function(e){return!/(?!HTML|ASAP|RSVP|DSLR)\b[A-Z]{4,}\b/g.test(e)},casing:function(e){if(!e)return!0;var t=/[A-Z][a-zA-Z]*\s*/g,i=/[^\s]+/gi,n=e.match(t),o=e.match(i);return!(n&&o&&n.length/o.length>=.45)},validUrl:function(e){return/^(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/gi.test(e)},validEmail:function(e){var t=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,i=/^[-|+|=|@]/i;return t.test(e)&&!i.test(e)},validDomain:function(e){return/[\w-]+\.[\w-]+/gi.test(e)},noTrailingChar:function(e){return!/\/([^\/]+)\/?$/gi.test(e.trim())},notRejected:function(e){return"Rejected"!=e},validAnswerUrlOrAnswerId:function(e){var t=/^https?\:\/\/(?:www\.)?([^\/:?#]+)(?:[\/:?#]|$)|\d+/i,i=t.test(e),o={type:n.Types.AD_MANAGER_VALID_ANSWER_URL_FILLED,payload:{answerUrl:e},scope:n.scope.GLOBAL};return n.ComponentProxy.dispatch(o,this.cid),i}}},"./shared/viewport.js":function(e,t,i){var n=i("./shared/dom.js"),o=i("./shared/jquery.js"),s=i("./shared/window_manager.js"),a=function(e){var t=e.getBoundingClientRect();return 0==t.bottom&&0==t.right&&0==t.top&&0==t.left};t.percentInViewport=function(e){if(a(e))return 0;var t=Math.round(o(e).offset().top),i=window.innerHeight,n=Math.max(0,window.pageYOffset-t),s=Math.max(0,t+e.offsetHeight-(window.pageYOffset+i));return n>e.offsetHeight||s>e.offsetHeight?0:1-(n+s)/e.offsetHeight},t.percentScrolledPastViewport=function(e){if(!e)return 0;var t=Math.round(o(e).offset().top);return Math.max(0,window.pageYOffset-t)/e.getBoundingClientRect().height};var r=function(e){if(a(e))return!1;var t=e.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,o=function(e,t){return document.elementFromPoint(e,t)};if(t.right<0||t.bottom<0||t.left>i||t.top>n)return!1;var s=5;return e.contains(o(t.left+s,t.top+s))||e.contains(o(t.right-s,t.top+s))||e.contains(o(t.right-s,t.bottom-s))||e.contains(o(t.left+s,t.bottom-s))};t.isElementInViewport=function(e){return!!e&&r(e)};var d=null;t.siteHeaderHeight=function(){return null===d&&(d=o(".SiteHeader").height()),d},t.setPageScroll=function(e){var t=o("body"),i=o(".SiteHeader"),s=n.getScrollbarWidth();t.addClass("web_page"),e?(t.removeClass("modal_prevent_scroll"),t.css("padding-right",0),i.css("padding-right",0)):(t.addClass("modal_prevent_scroll"),t.css("padding-right",s+"px"),i.css("padding-right",s+"px"))},t.isElementDefinitelyOutOfViewport=function(e){var t=e.getBoundingClientRect();return t.right<0||t.bottom<0||t.left>o(window).width()||t.top>o(window).height()},t.scrollToElem=function(e){e.jquery||(e=o(e)),e.length>1&&(e=e.get(0));var t=e.offset().top;t-=s.headerOffset+20,window.scroll(0,t)},t.scrolledToBottom=function(){return o(document).height()<=o(window).height()+o(window).scrollTop()+1}},"./shared/visibility_state.js":function(e,t,i){var n,o=(i("./shared/client.js"),i("./shared/beforeunload.js")),s=i("./shared/eventemitter.js"),a=i("./shared/util.js"),r=new s.EventEmitter,d=t.isVisible=function(){return!(n||h())};t.onChange=function(e){r.on("change",e)};var l,c;"undefined"!=typeof document.hidden?(l="hidden",c="visibilitychange"):"undefined"!=typeof document.msHidden?(l="msHidden",c="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(l="webkitHidden",c="webkitvisibilitychange");var u=function(e){n!==e&&(n=e,r.trigger("change",[d()]))},h=function(){return document[l]};document.addEventListener(c,function(){r.trigger("change",[d()])},!1),o.registerHandler(function(){u(!0)}),window.addEventListener("pagehide",function(){u(!0)}),window.addEventListener("pageshow",function(){u(!1)}),window.addEventListener("blur",function(){u(!0)}),window.addEventListener("focus",function(){u(!1)}),t.invokeAfterPageIsVisible=function(e){d()?e():(e=a.once(e),t.onChange(function(t){t&&e()}))}},"./shared/w2.context.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/errors.js"),s=n.extend({__init__:function(e){this.value=e,this.handlers={}},bind:function(e,t){this.handlers.hasOwnProperty(t)||(this.handlers[t]=[]),this.handlers[t].push(e)},unbind:function(e){delete this.handlers[e]},trigger:function(){var e=Array.prototype.slice.call(arguments);for(var t in this.handlers)if(this.handlers.hasOwnProperty(t))for(var i=this.handlers[t],n=0;n0&&(s[0]in t||(t[s[0]]=[]),t[s[0]].push(decodeURIComponent(s[1])))}return t};var f=t.parseURLParams=function(e){return e||(e=window.location.search.substring(1)),0===e.length?{}:_(e)};t.parseParams=function(e){var t={};if(e){var i=e.split("?");2==i.length&&(t=_(i[1]))}return t},t.isParamInURL=function(e,t){return e in f(t)},t.addParamToURL=function(e,t,i){var n=encodeURIComponent(t)+"="+encodeURIComponent(i);n=-1==e.indexOf("?")?"?"+n:"&"+n;var o=e.indexOf("#");return-1==o?e+n:e.substring(0,o)+n+e.substring(o)},t.getURLParam=function(e){return f()[e]};var m=function(e,t,i,n,s){var a=[];if(i)for(var r in i)if(i.hasOwnProperty(r)&&null!==i[r])if(!0===s&&o.isArray(i[r]))for(var d=0;d0&&(c+="?"+l),c+=n},g=t.makeURL=function(e,t,i,n){return m(e,t,i,n,!1)},v=t.makeURLMultiParams=function(e,t,i,n){return m(e,t,i,n,!0)},b=t.makeUpdatedURL=function(e){return g(window.location.origin,window.location.pathname,a.extend(f(),e),window.location.hash)};t.updateURLParams=function(e){var t=b(e);return p(t),t},t.replaceURLParamsMulti=function(e){var t=v(window.location.origin,window.location.pathname,e,window.location.hash);return p(t),t},t.replaceURLPath=function(e){var t=v(window.location.origin,e,f(),window.location.hash);return p(t),t},t.addURLParam=function(e,i){var n=f();return n[e]=i,t.updateURLParams(n)},t.removeURLParam=function(e){var i=f();return i[e]=null,t.updateURLParams(i)},t.getTitle=function(){return document.title},t.setTitle=function(e){document.title=e},t.reload=function(){window.location.reload()};var y=!1;t.isPendingNavigation=function(){return y};var w=function(e){return-1!==e.indexOf("quora://")};t.sameDomainURL=function(e){return e&&("/"==e.charAt(0)||new RegExp("^https?://"+window.location.hostname+"/","i").test(c(e)))};var E=function(e){var t=document.createElement("div");return t.innerHTML="",t.firstChild.href=e,t.innerHTML=t.innerHTML,t.firstChild.href},C=t.isQuoraURL=function(e){return w(e)||l(e)};t.navigateTo=function(e,t){""!==e&&"#"!==e&&e!=u()+"#"&&(e=E(e),C(e)?k(e,t):T(e,t))};var S=t.navigateToWeb=function(e,i){if(e=E(e),i)return void window.open(e);var n=!0;t.catchRedirectCallback&&(n=t.catchRedirectCallback(e)),n&&(y=!0,s.async_navigate_to_js?setTimeout(function(){window.location=e},0):window.location=e)},T=function(e,t){if(t=t||"system_browser",r.isNativeApp()){var i={url:e};"system_browser"==t?i.target="external":"app_browser"==t?i.target="browser":(d.logJsError("windowManager","invalid nav_style for external URL: "+t),i.target="external"),n.send("openURL",i)}else if(r.isMobileWeb()){var o={url:e};"system_browser"==t?o.target="external":"app_browser"==t?o.target="current":(d.logJsError("windowManager","invalid nav_style for external URL: "+t),o.target="external"),n.send("openURL",o)}else"system_browser"==t?S(e,!0):"app_browser"==t?S(e,!0):(d.logJsError("windowManager","invalid nav_style for external URL: "+t),S(e,!0))},k=function(e,t){if(t=t||"push",r.isNativeApp()){var i={url:e};"push"==t?i.target="current":"present"==t?i.target="discardable_modal":"replace"==t?i.target="reload":"modal_push"==t?i.target="modal":"modal_present"==t?i.target="modal":"system_browser"==t?i.target="external":"app_browser"==t?i.target="browser":(d.logJsError("windowManager","invalid nav_style for Quora URL: "+t),i.target="external"),n.send("openURL",i)}else if(r.isMobileWeb()){var o={url:e};"push"==t?o.target="current":"present"==t?o.target="external":"replace"==t?o.target="current":"modal_push"==t?o.target="current":"modal_present"==t?o.target="external":"system_browser"==t?o.target="external":"app_browser"==t?o.target="browser":(d.logJsError("windowManager","invalid nav_style for Quora URL: "+t),o.target="external"),n.send("openURL",o)}else"push"==t?S(e,!1):"present"==t?S(e,!0):"replace"==t?S(e,!1):"modal_push"==t?S(e,!1):"modal_present"==t?S(e,!0):"system_browser"==t?S(e,!0):"app_browser"==t?S(e,!0):(d.logJsError("windowManager","invalid nav_style for Quora URL: "+t),S(e,!0))};t.headerOffset=45,t.actionBarHeight=52,t.scrollContext=60,t.scrollAndFocus=function(e,i){e-=t.headerOffset,e=Math.max(0,Math.min(o(document).height()-o(window).height(),e));var n=Math.min(500,.5*Math.abs(e-o(document).scrollTop())),s=!1;o("html,body").animate({scrollTop:e},n,"swing",function(){if(!s&&o(i).length){var e=window.scrollX,t=window.scrollY;o(i).focus(),window.scrollTo(e,t),s=!0}})},t.scrollIntoView=function(e,i){i=i||o(e).offset().top;var n=i-o(document).scrollTop();(no(window).height())&&t.scrollAndFocus(i)}},"./shared/window_performance.js":function(e,t){var i=window&&(window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance),n=["name","initiatorType","connectStart","connectEnd","domainLookupStart","domainLookupEnd","duration","fetchStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","secureConnectionStart","startTime","workerStart","transferSize","encodedBodySize","decodedBodySize","entryType"];t.getResourceTimingInfo=function(){var e=[];if(i&&i.getEntriesByType)for(var t=i.getEntriesByType("resource"),o=0;o").css({height:0,margin:0,padding:0,clear:"both",display:"block"});t.before(u),r.push({elem:t,sentinelElem:u,container:i,origPadding:parseInt(i.css("padding-bottom")),origPos:o,curPos:o,offsets:n,height:l}),d||(d=!0,c())}}},t.remove=function(e){for(var t=0;t=a&&t<=d?(l(o,"fixed"),n(o.elem,o.container)):(l(o,o.origPos),o.elem.css("left","auto"))}}window.requestAnimationFrame(c)},100)},"./tchannel_up.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./w2.livenode.js"),s=i("./shared/onload.js"),a=i("./shared/util.js"),r=i("./shared/beforeunload.js"),d=i("./shared/Class.js").Class,l=null,c=function(e,t,i,n){var o=window.location.protocol;return n&&(o="https:"===o?"wss:":"ws:"),e?o+"//"+e:[o,"//tch",Math.floor(1e6*Math.random())+1,".tch.",t,"/up/",i,"/updates?"].join("")},u=function(e){new Function(e).call(window)},h=d.extend({__init__:function(e,t,i,n,o,s,a){this.minSeq=e,this.channel=t,this.channelHash=i,this.boxName=n,this.baseHost=o,this.enableWebsocket=a,this.socket=null,this.targetUrl=c(s,this.baseHost,this.boxName,this.enableWebsocket),this.isConnected=!0,this.isActive=!0,this.maxBackOffTime=3e4,this.updateBackOffTime(!0),this.numActiveXhr=0,this.pendingMessages=[]},makeJsonpRequest:function(e){if(0===this.numActiveXhr){this.numActiveXhr+=1;var t={min_seq:this.minSeq,channel:this.channel,hash:this.channelHash};e&&(t.timeout=e),n.ajax({url:this.targetUrl,jsonpCallback:function(){return"jsonp"+a.uuid4()},dataType:"jsonp",method:"GET",data:t,success:this._onSuccess.bind(this),error:this._onError.bind(this),complete:this._onPollComplete.bind(this)})}},makeWebsocketRequest:function(){if(null===this.socket){var e=this.targetUrl+n.param({min_seq:this.minSeq,channel:this.channel,hash:this.channelHash});try{this.socket=new window.WebSocket(e)}catch(e){return void this._onError()}this.socket.onerror=this._onWebsocketError.bind(this),this.socket.onmessage=this._onWebsocketSuccess.bind(this),this.socket.onclose=this._onWebsocketClose.bind(this)}},closeWebsocket:function(){null!==this.socket&&(this.socket.close(),this.socket=null)},setIsConnected:function(e){this.isConnected!=e&&(e?o.reportPageRegainedConnection():o.reportPageLostConnection()),this.isConnected=e},updateBackOffTime:function(e){e&&(this.backOffTime=500),this.backOffTime=Math.min(2*this.backOffTime,this.maxBackOffTime)},_onError:function(){var e=this;setTimeout(function(){e.isActive&&!r.isUnloading()&&(e.updateBackOffTime(),e.setIsConnected(!1),e.poll())},0)},_onWebsocketError:function(e){this.closeWebsocket(),this._onError()},_onPollError:function(e,t){this._onError()},_onSuccess:function(e){if(this.isActive&&!r.isUnloading()){this.updateBackOffTime(!0),this.setIsConnected(!0);try{if(e.error)throw e.error;this.minSeq=e.min_seq;for(var t=0;t-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(a=function(e){return e},a.destroy=function(e){return e},a.update=function(e){return e}):(a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return i(e,t)}),e},a.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],n),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e}),t.exports=a})},"./third_party/blockadblock.js":function(e,t){!function(e){var t=function(t){this._options={checkOnLoad:!1,resetOnEnd:!1,loopCheckTime:50,loopMaxNumber:5,baitClass:"pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",baitStyle:"width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;",debug:!1},this._var={version:"3.2.1",bait:null,checking:!1,loop:null,loopNumber:0,event:{detected:[],notDetected:[]}},t!==undefined&&this.setOption(t);var i=this,n=function(){setTimeout(function(){!0===i._options.checkOnLoad&&(!0===i._options.debug&&i._log("onload->eventCallback","A check loading is launched"),null===i._var.bait&&i._creatBait(),setTimeout(function(){i.check()},1))},1)};e.addEventListener!==undefined?e.addEventListener("load",n,!1):e.attachEvent("onload",n)};t.prototype._options=null,t.prototype._var=null,t.prototype._bait=null,t.prototype._log=function(e,t){console.log("[BlockAdBlock]["+e+"] "+t)},t.prototype.setOption=function(e,t){if(t!==undefined){var i=e;e={},e[i]=t}for(var n in e)this._options[n]=e[n],!0===this._options.debug&&this._log("setOption",'The option "'+n+'" he was assigned to "'+e[n]+'"');return this},t.prototype._creatBait=function(){var t=document.createElement("div");t.setAttribute("class",this._options.baitClass),t.setAttribute("style",this._options.baitStyle),this._var.bait=e.document.body.appendChild(t),this._var.bait.offsetParent,this._var.bait.offsetHeight,this._var.bait.offsetLeft,this._var.bait.offsetTop,this._var.bait.offsetWidth,this._var.bait.clientHeight,this._var.bait.clientWidth,!0===this._options.debug&&this._log("_creatBait","Bait has been created")},t.prototype._destroyBait=function(){e.document.body.removeChild(this._var.bait),this._var.bait=null,!0===this._options.debug&&this._log("_destroyBait","Bait has been removed")},t.prototype.check=function(e){if(e===undefined&&(e=!0),!0===this._options.debug&&this._log("check","An audit was requested "+(!0===e?"with a":"without")+" loop"),!0===this._var.checking)return!0===this._options.debug&&this._log("check","A check was canceled because there is already an ongoing"),!1;this._var.checking=!0,null===this._var.bait&&this._creatBait();var t=this;return this._var.loopNumber=0,!0===e&&(this._var.loop=setInterval(function(){t._checkBait(e)},this._options.loopCheckTime)),setTimeout(function(){t._checkBait(e)},1),!0===this._options.debug&&this._log("check","A check is in progress ..."),!0},t.prototype._checkBait=function(t){var i=!1;if(null===this._var.bait&&this._creatBait(),null===e.document.body.getAttribute("abp")&&null!==this._var.bait.offsetParent&&0!=this._var.bait.offsetHeight&&0!=this._var.bait.offsetLeft&&0!=this._var.bait.offsetTop&&0!=this._var.bait.offsetWidth&&0!=this._var.bait.clientHeight&&0!=this._var.bait.clientWidth||(i=!0),e.getComputedStyle!==undefined){var n=e.getComputedStyle(this._var.bait,null);!n||"none"!=n.getPropertyValue("display")&&"hidden"!=n.getPropertyValue("visibility")||(i=!0)}!0===this._options.debug&&this._log("_checkBait","A check ("+(this._var.loopNumber+1)+"/"+this._options.loopMaxNumber+" ~"+(1+this._var.loopNumber*this._options.loopCheckTime)+"ms) was conducted and detection is "+(!0===i?"positive":"negative")),!0===t&&++this._var.loopNumber>=this._options.loopMaxNumber&&this._stopLoop(),!0===i?(this._stopLoop(),this._destroyBait(),this.emitEvent(!0),!0===t&&(this._var.checking=!1)):null!==this._var.loop&&!1!==t||(this._destroyBait(),this.emitEvent(!1),!0===t&&(this._var.checking=!1))},t.prototype._stopLoop=function(e){clearInterval(this._var.loop),this._var.loop=null,this._var.loopNumber=0,!0===this._options.debug&&this._log("_stopLoop","A loop has been stopped")},t.prototype.emitEvent=function(e){!0===this._options.debug&&this._log("emitEvent","An event with a "+(!0===e?"positive":"negative")+" detection was called");var t=this._var.event[!0===e?"detected":"notDetected"];for(var i in t)!0===this._options.debug&&this._log("emitEvent","Call function "+(parseInt(i)+1)+"/"+t.length),t.hasOwnProperty(i)&&t[i]();return!0===this._options.resetOnEnd&&this.clearEvent(),this},t.prototype.clearEvent=function(){this._var.event.detected=[],this._var.event.notDetected=[],!0===this._options.debug&&this._log("clearEvent","The event list has been cleared")},t.prototype.on=function(e,t){return this._var.event[!0===e?"detected":"notDetected"].push(t),!0===this._options.debug&&this._log("on",'A type of event "'+(!0===e?"detected":"notDetected")+'" was added'),this},t.prototype.onDetected=function(e){return this.on(!0,e)},t.prototype.onNotDetected=function(e){return this.on(!1,e)},e.BlockAdBlock=t,e.blockAdBlock===undefined&&(e.blockAdBlock=new t({checkOnLoad:!0,resetOnEnd:!0}))}(window)},"./third_party/browser.js":function(e,t){/*! * This utility helps to detect browser type & version. * Modified from: * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2015 */ !function(t,i){void 0!==e&&e.exports?e.exports=i():"function"==typeof define&&define.amd?define(t,i):this[t]=i()}("bowser",function(){function e(e){function t(t){var i=e.match(t);return i&&i.length>1&&i[1]||""}function i(t){var i=e.match(t);return i&&i.length>1&&i[2]||""}var n,o=t(/(ipod|iphone|ipad)/i).toLowerCase(),s=/like android/i.test(e),r=!s&&/android/i.test(e),d=/nexus\s*[0-6]\s*/i.test(e),l=!d&&/nexus\s*[0-9]+/i.test(e),c=/CrOS/.test(e),u=/silk/i.test(e),h=/sailfish/i.test(e),p=/tizen/i.test(e),_=/(web|hpw)os/i.test(e),f=/windows phone/i.test(e),m=(/SamsungBrowser/i.test(e),!f&&/windows/i.test(e)),g=!o&&!u&&/macintosh/i.test(e),v=!r&&!h&&!p&&!_&&/linux/i.test(e),b=t(/edge\/(\d+(\.\d+)?)/i),y=t(/version\/(\d+(\.\d+)?)/i),w=/tablet/i.test(e),E=!w&&/[^-]mobi/i.test(e),C=/xbox/i.test(e);/opera/i.test(e)?n={name:"Opera",opera:a,version:y||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr|opios/i.test(e)?n={name:"Opera",opera:a,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||y}:/SamsungBrowser/i.test(e)?n={name:"Samsung Internet for Android",samsungBrowser:a,version:y||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?n={name:"Opera Coast",coast:a,version:y||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?n={name:"Yandex Browser",yandexbrowser:a,version:y||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?n={name:"UC Browser",ucbrowser:a,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?n={name:"Maxthon",maxthon:a,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?n={name:"Epiphany",epiphany:a,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?n={name:"Puffin",puffin:a,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?n={name:"Sleipnir",sleipnir:a,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?n={name:"K-Meleon",kMeleon:a,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:f?(n={name:"Windows Phone",windowsphone:a},b?(n.msedge=a,n.version=b):(n.msie=a,n.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?n={name:"Internet Explorer",msie:a,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?n={name:"Chrome",chromeos:a,chromeBook:a,chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/chrome.+? edge/i.test(e)?n={name:"Microsoft Edge",msedge:a,version:b}:/vivaldi/i.test(e)?n={name:"Vivaldi",vivaldi:a,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||y}:h?n={name:"Sailfish",sailfish:a,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?n={name:"SeaMonkey",seamonkey:a,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(n={name:"Firefox",firefox:a,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(n.firefoxos=a)):u?n={name:"Amazon Silk",silk:a,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?n={name:"PhantomJS",phantom:a,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?n={name:"SlimerJS",slimer:a,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?n={name:"BlackBerry",blackberry:a,version:y||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:_?(n={name:"WebOS",webos:a,version:y||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(n.touchpad=a)):/bada/i.test(e)?n={name:"Bada",bada:a,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:p?n={name:"Tizen",tizen:a,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||y}:/qupzilla/i.test(e)?n={name:"QupZilla",qupzilla:a,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||y}:/chromium/i.test(e)?n={name:"Chromium",chromium:a,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||y}:/chrome|crios|crmo/i.test(e)?n={name:"Chrome",chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:r?n={name:"Android",version:y}:/safari|applewebkit/i.test(e)?(n={name:"Safari",safari:a},y&&(n.version=y)):o?(n={name:"iphone"==o?"iPhone":"ipad"==o?"iPad":"iPod"},y&&(n.version=y)):n=/googlebot/i.test(e)?{name:"Googlebot",googlebot:a,version:t(/googlebot\/(\d+(\.\d+))/i)||y}:{name:t(/^(.*)\/(.*) /),version:i(/^(.*)\/(.*) /)},!n.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(n.name=n.name||"Blink",n.blink=a):(n.name=n.name||"Webkit",n.webkit=a),!n.version&&y&&(n.version=y)):!n.opera&&/gecko\//i.test(e)&&(n.name=n.name||"Gecko",n.gecko=a,n.version=n.version||t(/gecko\/(\d+(\.\d+)?)/i)),n.msedge||!r&&!n.silk?o?(n[o]=a,n.ios=a):g?n.mac=a:C?n.xbox=a:m?n.windows=a:v&&(n.linux=a):n.android=a;var S="";n.windowsphone?S=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):o?(S=t(/os (\d+([_\s]\d+)*) like mac os x/i),S=S.replace(/[_\s]/g,".")):r?S=t(/android[ \/-](\d+(\.\d+)*)/i):n.webos?S=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?S=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?S=t(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(S=t(/tizen[\/\s](\d+(\.\d+)*)/i)),S&&(n.osversion=S);var T=S.split(".")[0];return w||l||"ipad"==o||r&&(3==T||T>=4&&!E)||n.silk?n.tablet=a:(E||"iphone"==o||"ipod"==o||r||d||n.blackberry||n.webos||n.bada)&&(n.mobile=a),n.msedge||n.msie&&n.version>=10||n.yandexbrowser&&n.version>=15||n.vivaldi&&n.version>=1||n.chrome&&n.version>=20||n.samsungBrowser&&n.version>=4||n.firefox&&n.version>=20||n.safari&&n.version>=6||n.opera&&n.version>=10||n.ios&&n.osversion&&n.osversion.split(".")[0]>=6||n.blackberry&&n.version>=10.1||n.chromium&&n.version>=20?n.a=a:n.msie&&n.version<10||n.chrome&&n.version<20||n.firefox&&n.version<20||n.safari&&n.version<6||n.opera&&n.version<10||n.ios&&n.osversion&&n.osversion.split(".")[0]<6||n.chromium&&n.version<20?n.c=a:n.x=a,n}function t(e){return e.split(".").length}function i(e,t){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i=0;){if(o[0][n]>o[1][n])return 1;if(o[0][n]!==o[1][n])return-1;if(0===n)return 0}}function o(t,i,o){var s=r;"string"==typeof i&&(o=i,i=void 0),void 0===i&&(i=!1),o&&(s=e(o));var a=""+s.version;for(var d in t)if(t.hasOwnProperty(d)&&s[d])return n([a,t[d]])<0;return i}function s(e,t,i){return!o(e,t,i)}var a=!0,r=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return r.test=function(e){for(var t=0;t>>0)},u=function(e){try{var t=d[e]()}catch(e){a(e)}(null!=t&&void 0!==t||null!=(t=r[e])&&void 0!==t)&&h(e,t)},h=function(e,t,n){if(n=n||!1,-1!=e.indexOf(".")){var o=e.split(".");"undefined"==typeof s[o[0]]&&(s[o[0]]={}),s[o[0]][o[1]]=t}else s[e]=t;r[e]=t,_(r),n&&i.onPropertiesUpdate(r,s.getPropertiesAsString())},p=function(){return"undefined"==typeof n.cookieEnabled&&"string"==typeof t.cookie||!!n.cookieEnabled},_=function(e){if(p()){var i=new Date;i.setDate(i.getDate()+s.cookieExpiryDays);var n="";null!=s.cookieDomain&&(n=";domain="+s.cookieDomain),s.propsCache=f(e),t.cookie=s.cookieName+'="'+s.propsCache+'";expires='+i.toUTCString()+";path="+s.cookiePath+n}},f=function(e){var t,i="";for(t in e){var n=e[t];n="boolean"==typeof n?"b":"number"==typeof n?"i":"s",i+=n+t+":"+("b"==n?e[t]+0:e[t])+"|"}return i+"sversion:"+s.apiVersion+"|bE:0"};return o=function(e){e+="=";for(var i=t.cookie.split(";"),n=0;n=0&&r>=0&&{top:i,bottom:n,left:o,right:s,width:a,height:r}}function c(e){var t=e.getBoundingClientRect();if(t)return t.width&&t.height||(t={top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.right-t.left,height:t.bottom-t.top}),t}function u(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}var h=i.documentElement,p=[];o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.observe=function(e){if(!this._observationTargets.some(function(t){return t.element==e})){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections()}},o.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter(function(t){return t.element!=e}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},o.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter(function(e,t,i){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==i[t-1]})},o.prototype._parseRootMargin=function(e){var t=e||"0px",i=t.split(/\s+/).map(function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}});return i[1]=i[1]||i[0],i[2]=i[2]||i[0],i[3]=i[3]||i[1],i},o.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this._checkForIntersections(),this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(r(e,"resize",this._checkForIntersections,!0),r(i,"scroll",this._checkForIntersections,!0),"MutationObserver"in e&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(i,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},o.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,d(e,"resize",this._checkForIntersections,!0),d(i,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},o.prototype._checkForIntersections=function(){var e=this._rootIsInDom(),t=e?this._getRootRect():u();this._observationTargets.forEach(function(i){var o=i.element,a=c(o),r=this._rootContainsTarget(o),d=i.entry,l=e&&r&&this._computeTargetAndRootIntersection(o,t),u=i.entry=new n({time:s(),target:o,boundingClientRect:a,rootBounds:t,intersectionRect:l});e&&r?this._hasCrossedThreshold(d,u)&&this._queuedEntries.push(u):d&&d.isIntersecting&&this._queuedEntries.push(u)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},o.prototype._computeTargetAndRootIntersection=function(t,i){if("none"!=e.getComputedStyle(t).display){return l(i,c(t))}},o.prototype._getRootRect=function(){var e;if(this.root)e=c(this.root);else{var t=i.documentElement,n=i.body;e={top:0,left:0,right:t.clientWidth||n.clientWidth,width:t.clientWidth||n.clientWidth,bottom:t.clientHeight||n.clientHeight,height:t.clientHeight||n.clientHeight}}return this._expandRectByRootMargin(e)},o.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map(function(t,i){return"px"==t.unit?t.value:t.value*(i%2?e.width:e.height)/100}),i={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return i.width=i.right-i.left,i.height=i.bottom-i.top,i},o.prototype._hasCrossedThreshold=function(e,t){var i=e&&e.isIntersecting?e.intersectionRatio||0:-1,n=t.isIntersecting?t.intersectionRatio||0:-1;if(i!==n)for(var o=0;o0&&t-1 in e)}function o(e,t,i){if(he.isFunction(t))return he.grep(e,function(e,n){return!!t.call(e,n,e)!==i});if(t.nodeType)return he.grep(e,function(e){return e===t!==i});if("string"==typeof t){if(Ee.test(t))return he.filter(t,e,i);t=he.filter(t,e)}return he.grep(e,function(e){return oe.call(t,e)>-1!==i&&1===e.nodeType})}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t={};return he.each(e.match(xe)||[],function(e,i){t[i]=!0}),t}function r(e){return e}function d(e){throw e}function l(e,t,i){var n;try{e&&he.isFunction(n=e.promise)?n.call(e).done(t).fail(i):e&&he.isFunction(n=e.then)?n.call(e,t,i):t.call(undefined,e)}catch(e){i.call(undefined,e)}}function c(){Z.removeEventListener("DOMContentLoaded",c),e.removeEventListener("load",c),he.ready()}function u(){this.expando=he.expando+u.uid++}function h(e,t,i){var n;if(i===undefined&&1===e.nodeType)if(n="data-"+t.replace(Me,"-$&").toLowerCase(),"string"==typeof(i=e.getAttribute(n))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:je.test(i)?JSON.parse(i):i)}catch(e){}Oe.set(e,t,i)}else i=undefined;return i}function p(e,t,i,n){var o,s=1,a=20,r=n?function(){return n.cur()}:function(){return he.css(e,t,"")},d=r(),l=i&&i[3]||(he.cssNumber[t]?"":"px"),c=(he.cssNumber[t]||"px"!==l&&+d)&&Ne.exec(he.css(e,t));if(c&&c[3]!==l){l=l||c[3],i=i||[],c=+d||1;do{s=s||".5",c/=s,he.style(e,t,c+l)}while(s!==(s=r()/d)&&1!==s&&--a)}return i&&(c=+c||+d||0,o=i[1]?c+(i[1]+1)*i[2]:+i[2],n&&(n.unit=l,n.start=c,n.end=o)),o}function _(e){var t,i=e.ownerDocument,n=e.nodeName,o=qe[n];return o||(t=i.body.appendChild(i.createElement(n)),o=he.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),qe[n]=o,o)}function f(e,t){for(var i,n,o=[],s=0,a=e.length;s-1)o&&o.push(s);else if(l=he.contains(s.ownerDocument,s),a=m(u.appendChild(s),"script"),l&&g(a),i)for(c=0;s=a[c++];)We.test(s.type||"")&&i.push(s);return u}function b(){return!0}function y(){return!1}function w(){try{return Z.activeElement}catch(e){}}function E(e,t,i,n,o,s){var a,r;if("object"==typeof t){"string"!=typeof i&&(n=n||i,i=undefined);for(r in t)E(e,r,i,n,t[r],s);return e}if(null==n&&null==o?(o=i,n=i=undefined):null==o&&("string"==typeof i?(o=n,n=undefined):(o=n,n=i,i=undefined)),!1===o)o=y;else if(!o)return e;return 1===s&&(a=o,o=function(e){return he().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=he.guid++)),e.each(function(){he.event.add(this,t,o,n,i)})}function C(e,t){return he.nodeName(e,"table")&&he.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function S(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function T(e){var t=et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function k(e,t){var i,n,o,s,a,r,d,l;if(1===t.nodeType){if($e.hasData(e)&&(s=$e.access(e),a=$e.set(t,s),l=s.events)){delete a.handle,a.events={};for(o in l)for(i=0,n=l[o].length;i1&&"string"==typeof _&&!ce.checkClone&&Ze.test(_))return e.each(function(i){var s=e.eq(i);f&&(t[0]=_.call(this,i,s.html())),A(s,t,n,o)});if(h&&(s=v(t,e[0].ownerDocument,!1,e,o),a=s.firstChild,1===s.childNodes.length&&(s=a),a||o)){for(r=he.map(m(s,"script"),S),d=r.length;u=0&&iC.cacheLength&&delete e[t.shift()],e[i+" "]=n}var t=[];return e}function n(e){return e[F]=!0,e}function o(e){var t=O.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function s(e,t){for(var i=e.split("|"),n=i.length;n--;)C.attrHandle[i[n]]=t}function a(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function r(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function d(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function l(e){return function(t){return"label"in t&&t.disabled===e||"form"in t&&t.disabled===e||"form"in t&&!1===t.disabled&&(t.isDisabled===e||t.isDisabled!==!e&&("label"in t||!Se(t))!==e)}}function c(e){return n(function(t){return t=+t,n(function(i,n){for(var o,s=e([],i.length,t),a=s.length;a--;)i[o=s[a]]&&(i[o]=!(n[o]=i[o]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function h(){}function p(e){for(var t=0,i=e.length,n="";t1?function(t,i,n){for(var o=e.length;o--;)if(!e[o](t,i,n))return!1;return!0}:e[0]}function m(e,i,n){for(var o=0,s=i.length;o-1&&(n[l]=!(a[l]=u))}}else b=g(b===a?b.splice(_,b.length):b),s?s(null,a,b,d):Y.apply(a,b)})}function b(e){for(var t,i,n,o=e.length,s=C.relative[e[0].type],a=s||C.relative[" "],r=s?1:0,d=_(function(e){return e===t},a,!0),l=_(function(e){return ee(t,e)>-1},a,!0),c=[function(e,i,n){var o=!s&&(n||i!==L)||((t=i).nodeType?d(e,i,n):l(e,i,n));return t=null,o}];r1&&f(c),r>1&&p(e.slice(0,r-1).concat({value:" "===e[r-2].type?"*":""})).replace(re,"$1"),i,r0,s=e.length>0,a=function(n,a,r,d,l){var c,u,h,p=0,_="0",f=n&&[],m=[],v=L,b=n||s&&C.find.TAG("*",l),y=U+=null==v?1:Math.random()||.1,w=b.length;for(l&&(L=a===O||a||l);_!==w&&null!=(c=b[_]);_++){if(s&&c){for(u=0,a||c.ownerDocument===O||($(c),r=!M);h=e[u++];)if(h(c,a||O,r)){d.push(c);break}l&&(U=y)}o&&((c=!h&&c)&&p--,n&&f.push(c))}if(p+=_,o&&_!==p){for(u=0;h=i[u++];)h(f,m,a,r);if(n){if(p>0)for(;_--;)f[_]||m[_]||(m[_]=J.call(d));m=g(m)}Y.apply(d,m),l&&!n&&m.length>0&&p+i.length>1&&t.uniqueSort(d)}return l&&(U=y,L=v),f};return o?n(a):a}var w,E,C,S,T,k,x,A,L,D,I,$,O,j,M,R,N,P,B,F="sizzle"+1*new Date,q=e.document,U=0,H=0,W=i(),G=i(),V=i(),Q=function(e,t){return e===t&&(I=!0),0},z={}.hasOwnProperty,K=[],J=K.pop,X=K.push,Y=K.push,Z=K.slice,ee=function(e,t){for(var i=0,n=e.length;i+~]|"+ie+")"+ie+"*"),ce=new RegExp("="+ie+"*([^\\]'\"]*?)"+ie+"*\\]","g"),ue=new RegExp(se),he=new RegExp("^"+ne+"$"),pe={ID:new RegExp("^#("+ne+")"),CLASS:new RegExp("^\\.("+ne+")"),TAG:new RegExp("^("+ne+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+se),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ie+"*(even|odd|(([+-]|)(\\d*)n|)"+ie+"*(?:([+-]|)"+ie+"*(\\d+)|))"+ie+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ie+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ie+"*((?:-\\d)?\\d*)"+ie+"*\\)|)(?=[^-]|$)","i")},_e=/^(?:input|select|textarea|button)$/i,fe=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,be=new RegExp("\\\\([\\da-f]{1,6}"+ie+"?|("+ie+")|.)","ig"),ye=function(e,t,i){var n="0x"+t-65536;return n!==n||i?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},we=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,Ee=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Ce=function(){$()},Se=_(function(e){return!0===e.disabled},{dir:"parentNode",next:"legend"});try{Y.apply(K=Z.call(q.childNodes),q.childNodes),K[q.childNodes.length].nodeType}catch(e){Y={apply:K.length?function(e,t){X.apply(e,Z.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}E=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},$=t.setDocument=function(e){var t,i,n=e?e.ownerDocument||e:q;return n!==O&&9===n.nodeType&&n.documentElement?(O=n,j=O.documentElement,M=!T(O),q!==O&&(i=O.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",Ce,!1):i.attachEvent&&i.attachEvent("onunload",Ce)),E.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),E.getElementsByTagName=o(function(e){return e.appendChild(O.createComment("")),!e.getElementsByTagName("*").length}),E.getElementsByClassName=me.test(O.getElementsByClassName),E.getById=o(function(e){return j.appendChild(e).id=F,!O.getElementsByName||!O.getElementsByName(F).length}),E.getById?(C.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&M){var i=t.getElementById(e);return i?[i]:[]}},C.filter.ID=function(e){var t=e.replace(be,ye);return function(e){return e.getAttribute("id")===t}}):(delete C.find.ID,C.filter.ID=function(e){var t=e.replace(be,ye);return function(e){var i="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}}),C.find.TAG=E.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):E.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,n=[],o=0,s=t.getElementsByTagName(e);if("*"===e){for(;i=s[o++];)1===i.nodeType&&n.push(i);return n}return s},C.find.CLASS=E.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&M)return t.getElementsByClassName(e)},N=[],R=[],(E.qsa=me.test(O.querySelectorAll))&&(o(function(e){j.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&R.push("[*^$]="+ie+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||R.push("\\["+ie+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+F+"-]").length||R.push("~="),e.querySelectorAll(":checked").length||R.push(":checked"),e.querySelectorAll("a#"+F+"+*").length||R.push(".#.+[+~]")}),o(function(e){e.innerHTML="";var t=O.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&R.push("name"+ie+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&R.push(":enabled",":disabled"),j.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&R.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),R.push(",.*:")})),(E.matchesSelector=me.test(P=j.matches||j.webkitMatchesSelector||j.mozMatchesSelector||j.oMatchesSelector||j.msMatchesSelector))&&o(function(e){E.disconnectedMatch=P.call(e,"*"),P.call(e,"[s!='']:x"),N.push("!=",se)}),R=R.length&&new RegExp(R.join("|")),N=N.length&&new RegExp(N.join("|")),t=me.test(j.compareDocumentPosition),B=t||me.test(j.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Q=t?function(e,t){if(e===t)return I=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!E.sortDetached&&t.compareDocumentPosition(e)===i?e===O||e.ownerDocument===q&&B(q,e)?-1:t===O||t.ownerDocument===q&&B(q,t)?1:D?ee(D,e)-ee(D,t):0:4&i?-1:1)}:function(e,t){if(e===t)return I=!0,0;var i,n=0,o=e.parentNode,s=t.parentNode,r=[e],d=[t];if(!o||!s)return e===O?-1:t===O?1:o?-1:s?1:D?ee(D,e)-ee(D,t):0;if(o===s)return a(e,t);for(i=e;i=i.parentNode;)r.unshift(i);for(i=t;i=i.parentNode;)d.unshift(i);for(;r[n]===d[n];)n++;return n?a(r[n],d[n]):r[n]===q?-1:d[n]===q?1:0},O):O},t.matches=function(e,i){return t(e,null,null,i)},t.matchesSelector=function(e,i){if((e.ownerDocument||e)!==O&&$(e),i=i.replace(ce,"='$1']"),E.matchesSelector&&M&&!V[i+" "]&&(!N||!N.test(i))&&(!R||!R.test(i)))try{var n=P.call(e,i);if(n||E.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return t(i,O,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==O&&$(e),B(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==O&&$(e);var i=C.attrHandle[t.toLowerCase()],n=i&&z.call(C.attrHandle,t.toLowerCase())?i(e,t,!M):undefined;return n!==undefined?n:E.attributes||!M?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null},t.escape=function(e){return(e+"").replace(we,Ee)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,i=[],n=0,o=0;if(I=!E.detectDuplicates,D=!E.sortStable&&e.slice(0),e.sort(Q),I){for(;t=e[o++];)t===e[o]&&(n=i.push(o));for(;n--;)e.splice(i[n],1)}return D=null,e},S=t.getText=function(e){var t,i="",n=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=S(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[n++];)i+=S(t);return i},C=t.selectors={cacheLength:50,createPseudo:n,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,ye),e[3]=(e[3]||e[4]||e[5]||"").replace(be,ye),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&ue.test(i)&&(t=k(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,ye).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=W[e+" "];return t||(t=new RegExp("(^|"+ie+")"+e+"("+ie+"|$)"))&&W(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,i,n){return function(o){var s=t.attr(o,e);return null==s?"!="===i:!i||(s+="","="===i?s===n:"!="===i?s!==n:"^="===i?n&&0===s.indexOf(n):"*="===i?n&&s.indexOf(n)>-1:"$="===i?n&&s.slice(-n.length)===n:"~="===i?(" "+s.replace(ae," ")+" ").indexOf(n)>-1:"|="===i&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,i,n,o){var s="nth"!==e.slice(0,3),a="last"!==e.slice(-4),r="of-type"===t;return 1===n&&0===o?function(e){return!!e.parentNode}:function(t,i,d){var l,c,u,h,p,_,f=s!==a?"nextSibling":"previousSibling",m=t.parentNode,g=r&&t.nodeName.toLowerCase(),v=!d&&!r,b=!1;if(m){if(s){for(;f;){for(h=t;h=h[f];)if(r?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;_=f="only"===e&&!_&&"nextSibling"}return!0}if(_=[a?m.firstChild:m.lastChild],a&&v){for(h=m,u=h[F]||(h[F]={}),c=u[h.uniqueID]||(u[h.uniqueID]={}),l=c[e]||[],p=l[0]===U&&l[1],b=p&&l[2],h=p&&m.childNodes[p];h=++p&&h&&h[f]||(b=p=0)||_.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[U,p,b];break}}else if(v&&(h=t,u=h[F]||(h[F]={}),c=u[h.uniqueID]||(u[h.uniqueID]={}),l=c[e]||[],p=l[0]===U&&l[1],b=p),!1===b)for(;(h=++p&&h&&h[f]||(b=p=0)||_.pop())&&((r?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++b||(v&&(u=h[F]||(h[F]={}),c=u[h.uniqueID]||(u[h.uniqueID]={}),c[e]=[U,b]),h!==t)););return(b-=o)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,i){var o,s=C.pseudos[e]||C.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return s[F]?s(i):s.length>1?(o=[e,e,"",i],C.setFilters.hasOwnProperty(e.toLowerCase())?n(function(e,t){for(var n,o=s(e,i),a=o.length;a--;)n=ee(e,o[a]),e[n]=!(t[n]=o[a])}):function(e){return s(e,0,o)}):s}},pseudos:{not:n(function(e){var t=[],i=[],o=x(e.replace(re,"$1"));return o[F]?n(function(e,t,i,n){for(var s,a=o(e,null,n,[]),r=e.length;r--;)(s=a[r])&&(e[r]=!(t[r]=s))}):function(e,n,s){return t[0]=e,o(t,null,s,i),t[0]=null,!i.pop()}}),has:n(function(e){return function(i){return t(e,i).length>0}}),contains:n(function(e){return e=e.replace(be,ye),function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)>-1}}),lang:n(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,ye).toLowerCase(),function(t){var i;do{if(i=M?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===j},focus:function(e){return e===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:l(!1),disabled:l(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return fe.test(e.nodeName)},input:function(e){return _e.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,i){return[i<0?i+t:i]}),even:c(function(e,t){for(var i=0;i=0;)e.push(n);return e}),gt:c(function(e,t,i){for(var n=i<0?i+t:i;++n2&&"ID"===(a=s[0]).type&&E.getById&&9===t.nodeType&&M&&C.relative[s[1].type]){if(!(t=(C.find.ID(a.matches[0].replace(be,ye),t)||[])[0]))return i;l&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(o=pe.needsContext.test(e)?0:s.length;o--&&(a=s[o],!C.relative[r=a.type]);)if((d=C.find[r])&&(n=d(a.matches[0].replace(be,ye),ve.test(s[0].type)&&u(t.parentNode)||t))){if(s.splice(o,1),!(e=n.length&&p(s)))return Y.apply(i,n),i;break}}return(l||x(e,c))(n,t,!M,i,!t||ve.test(e)&&u(t.parentNode)||t),i},E.sortStable=F.split("").sort(Q).join("")===F,E.detectDuplicates=!!I,$(),E.sortDetached=o(function(e){return 1&e.compareDocumentPosition(O.createElement("fieldset"))}),o(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||s("type|href|height|width",function(e,t,i){if(!i)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),E.attributes&&o(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||s("value",function(e,t,i){if(!i&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||s(te,function(e,t,i){var n;if(!i)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),t}(e);he.find=ge,he.expr=ge.selectors,he.expr[":"]=he.expr.pseudos,he.uniqueSort=he.unique=ge.uniqueSort,he.text=ge.getText,he.isXMLDoc=ge.isXML,he.contains=ge.contains,he.escapeSelector=ge.escape;var ve=function(e,t,i){for(var n=[],o=i!==undefined;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&he(e).is(i))break;n.push(e)}return n},be=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},ye=he.expr.match.needsContext,we=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ee=/^.[^:#\[\.,]*$/;he.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?he.find.matchesSelector(n,e)?[n]:[]:he.find.matches(e,he.grep(t,function(e){return 1===e.nodeType}))},he.fn.extend({find:function(e){var t,i,n=this.length,o=this;if("string"!=typeof e)return this.pushStack(he(e).filter(function(){for(t=0;t1?he.uniqueSort(i):i},filter:function(e){return this.pushStack(o(this,e||[],!1))},not:function(e){return this.pushStack(o(this,e||[],!0))},is:function(e){return!!o(this,"string"==typeof e&&ye.test(e)?he(e):e||[],!1).length}});var Ce,Se=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(he.fn.init=function(e,t,i){var n,o;if(!e)return this;if(i=i||Ce,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Se.exec(e))||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof he?t[0]:t,he.merge(this,he.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:Z,!0)),we.test(n[1])&&he.isPlainObject(t))for(n in t)he.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return o=Z.getElementById(n[2]),o&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):he.isFunction(e)?i.ready!==undefined?i.ready(e):e(he):he.makeArray(e,this)}).prototype=he.fn,Ce=he(Z);var Te=/^(?:parents|prev(?:Until|All))/,ke={children:!0,contents:!0,next:!0,prev:!0};he.fn.extend({has:function(e){var t=he(e,this),i=t.length;return this.filter(function(){for(var e=0;e-1:1===i.nodeType&&he.find.matchesSelector(i,e))){s.push(i);break}return this.pushStack(s.length>1?he.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?oe.call(he(e),this[0]):oe.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(he.uniqueSort(he.merge(this.get(),he(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),he.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ve(e,"parentNode")},parentsUntil:function(e,t,i){return ve(e,"parentNode",i)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return ve(e,"nextSibling")},prevAll:function(e){return ve(e,"previousSibling")},nextUntil:function(e,t,i){return ve(e,"nextSibling",i)},prevUntil:function(e,t,i){return ve(e,"previousSibling",i)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return e.contentDocument||he.merge([],e.childNodes)}},function(e,t){he.fn[e]=function(i,n){var o=he.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(o=he.filter(n,o)),this.length>1&&(ke[e]||he.uniqueSort(o),Te.test(e)&&o.reverse()),this.pushStack(o)}});var xe=/\S+/g;he.Callbacks=function(e){e="string"==typeof e?a(e):he.extend({},e);var t,i,n,o,s=[],r=[],d=-1,l=function(){for(o=e.once,n=t=!0;r.length;d=-1)for(i=r.shift();++d-1;)s.splice(i,1),i<=d&&d--}),this},has:function(e){return e?he.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=r=[],s=i="",this},disabled:function(){return!s},lock:function(){return o=r=[],i||t||(s=i=""),this},locked:function(){return!!o},fireWith:function(e,i){return o||(i=i||[],i=[e,i.slice?i.slice():i],r.push(i),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},he.extend({Deferred:function(t){var i=[["notify","progress",he.Callbacks("memory"),he.Callbacks("memory"),2],["resolve","done",he.Callbacks("once memory"),he.Callbacks("once memory"),0,"resolved"],["reject","fail",he.Callbacks("once memory"),he.Callbacks("once memory"),1,"rejected"]],n="pending",o={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return o.then(null,e)},pipe:function(){var e=arguments;return he.Deferred(function(t){he.each(i,function(i,n){var o=he.isFunction(e[n[4]])&&e[n[4]];s[n[1]](function(){var e=o&&o.apply(this,arguments);e&&he.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[n[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,n,o){function s(t,i,n,o){return function(){var l=this,c=arguments,u=function(){var e,u;if(!(t=a&&(n!==d&&(l=undefined,c=[e]),i.rejectWith(l,c))}};t?h():(he.Deferred.getStackHook&&(h.stackTrace=he.Deferred.getStackHook()),e.setTimeout(h))}}var a=0;return he.Deferred(function(e){i[0][3].add(s(0,e,he.isFunction(o)?o:r,e.notifyWith)),i[1][3].add(s(0,e,he.isFunction(t)?t:r)),i[2][3].add(s(0,e,he.isFunction(n)?n:d))}).promise()},promise:function(e){return null!=e?he.extend(e,o):o}},s={};return he.each(i,function(e,t){var a=t[2],r=t[5];o[t[1]]=a.add,r&&a.add(function(){n=r},i[3-e][2].disable,i[0][2].lock),a.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?undefined:this,arguments),this},s[t[0]+"With"]=a.fireWith}),o.promise(s),t&&t.call(s,s),s},when:function(e){var t=arguments.length,i=t,n=Array(i),o=te.call(arguments),s=he.Deferred(),a=function(e){return function(i){n[e]=this,o[e]=arguments.length>1?te.call(arguments):i,--t||s.resolveWith(n,o)}};if(t<=1&&(l(e,s.done(a(i)).resolve,s.reject),"pending"===s.state()||he.isFunction(o[i]&&o[i].then)))return s.then();for(;i--;)l(o[i],a(i),s.reject);return s.promise()}});var Ae=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;he.Deferred.exceptionHook=function(t,i){e.console&&e.console.warn&&t&&Ae.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,i)};var Le=he.Deferred();he.fn.ready=function(e){return Le.then(e),this},he.extend({isReady:!1,readyWait:1,holdReady:function(e){e?he.readyWait++:he.ready(!0)},ready:function(e){(!0===e?--he.readyWait:he.isReady)||(he.isReady=!0,!0!==e&&--he.readyWait>0||Le.resolveWith(Z,[he]))}}),he.ready.then=Le.then,"complete"===Z.readyState||"loading"!==Z.readyState&&!Z.documentElement.doScroll?e.setTimeout(he.ready):(Z.addEventListener("DOMContentLoaded",c),e.addEventListener("load",c));var De=function(e,t,i,n,o,s,a){var r=0,d=e.length,l=null==i;if("object"===he.type(i)){o=!0;for(r in i)De(e,t,r,i[r],!0,s,a)}else if(n!==undefined&&(o=!0,he.isFunction(n)||(a=!0),l&&(a?(t.call(e,n),t=null):(l=t,t=function(e,t,i){return l.call(he(e),i)})),t))for(;r1,null,!0)},removeData:function(e){return this.each(function(){Oe.remove(this,e)})}}),he.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=$e.get(e,t),i&&(!n||he.isArray(i)?n=$e.access(e,t,he.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=he.queue(e,t),n=i.length,o=i.shift(),s=he._queueHooks(e,t),a=function(){he.dequeue(e,t)};"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===t&&i.unshift("inprogress"),delete s.stop,o.call(e,a,s)),!n&&s&&s.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return $e.get(e,i)||$e.access(e,i,{empty:he.Callbacks("once memory").add(function(){$e.remove(e,[t+"queue",i])})})}}),he.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length\x20\t\r\n\f]+)/i,We=/^$|\/(?:java|ecma)script/i,Ge={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};Ge.optgroup=Ge.option,Ge.tbody=Ge.tfoot=Ge.colgroup=Ge.caption=Ge.thead,Ge.th=Ge.td;var Ve=/<|&#?\w+;/;!function(){var e=Z.createDocumentFragment(),t=e.appendChild(Z.createElement("div")),i=Z.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),t.appendChild(i),ce.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",ce.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Qe=Z.documentElement,ze=/^key/,Ke=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Je=/^([^.]*)(?:\.(.+)|)/;he.event={global:{},add:function(e,t,i,n,o){var s,a,r,d,l,c,u,h,p,_,f,m=$e.get(e);if(m)for(i.handler&&(s=i,i=s.handler,o=s.selector),o&&he.find.matchesSelector(Qe,o),i.guid||(i.guid=he.guid++),(d=m.events)||(d=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==he&&he.event.triggered!==t.type?he.event.dispatch.apply(e,arguments):undefined}),t=(t||"").match(xe)||[""],l=t.length;l--;)r=Je.exec(t[l])||[],p=f=r[1],_=(r[2]||"").split(".").sort(),p&&(u=he.event.special[p]||{},p=(o?u.delegateType:u.bindType)||p,u=he.event.special[p]||{},c=he.extend({type:p,origType:f,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&he.expr.match.needsContext.test(o),namespace:_.join(".")},s),(h=d[p])||(h=d[p]=[],h.delegateCount=0,u.setup&&!1!==u.setup.call(e,n,_,a)||e.addEventListener&&e.addEventListener(p,a)),u.add&&(u.add.call(e,c),c.handler.guid||(c.handler.guid=i.guid)),o?h.splice(h.delegateCount++,0,c):h.push(c),he.event.global[p]=!0)},remove:function(e,t,i,n,o){var s,a,r,d,l,c,u,h,p,_,f,m=$e.hasData(e)&&$e.get(e);if(m&&(d=m.events)){for(t=(t||"").match(xe)||[""],l=t.length;l--;)if(r=Je.exec(t[l])||[],p=f=r[1],_=(r[2]||"").split(".").sort(),p){for(u=he.event.special[p]||{},p=(n?u.delegateType:u.bindType)||p,h=d[p]||[],r=r[2]&&new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;s--;)c=h[s],!o&&f!==c.origType||i&&i.guid!==c.guid||r&&!r.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(h.splice(s,1),c.selector&&h.delegateCount--,u.remove&&u.remove.call(e,c));a&&!h.length&&(u.teardown&&!1!==u.teardown.call(e,_,m.handle)||he.removeEvent(e,p,m.handle),delete d[p])}else for(p in d)he.event.remove(e,p+t[l],i,n,!0);he.isEmptyObject(d)&&$e.remove(e,"handle events")}},dispatch:function(e){var t,i,n,o,s,a,r=he.event.fix(e),d=new Array(arguments.length),l=($e.get(this,"events")||{})[r.type]||[],c=he.event.special[r.type]||{};for(d[0]=r,t=1;t-1:he.find(o,this,null,[d]).length),n[o]&&n.push(s);n.length&&a.push({elem:d,handlers:n})}return r\x20\t\r\n\f]*)[^>]*)\/>/gi,Ye=/\s*$/g;he.extend({htmlPrefilter:function(e){return e.replace(Xe,"<$1>")},clone:function(e,t,i){var n,o,s,a,r=e.cloneNode(!0),d=he.contains(e.ownerDocument,e);if(!(ce.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||he.isXMLDoc(e)))for(a=m(r),s=m(e),n=0,o=s.length;n0&&g(a,!d&&m(e,"script")),r},cleanData:function(e){for(var t,i,n,o=he.event.special,s=0;(i=e[s])!==undefined;s++)if(Ie(i)){if(t=i[$e.expando]){if(t.events)for(n in t.events)o[n]?he.event.remove(i,n):he.removeEvent(i,n,t.handle);i[$e.expando]=undefined}i[Oe.expando]&&(i[Oe.expando]=undefined)}}}),he.fn.extend({detach:function(e){return L(this,e,!0)},remove:function(e){return L(this,e)},text:function(e){return De(this,function(e){return e===undefined?he.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return A(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){C(this,e).appendChild(e)}})},prepend:function(){return A(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=C(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return A(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return A(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(he.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return he.clone(this,e,t)})},html:function(e){return De(this,function(e){var t=this[0]||{},i=0,n=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ye.test(e)&&!Ge[(He.exec(e)||["",""])[1].toLowerCase()]){e=he.htmlPrefilter(e);try{for(;i1)}}),he.Tween=R,R.prototype={constructor:R,init:function(e,t,i,n,o,s){this.elem=e,this.prop=i,this.easing=o||he.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=s||(he.cssNumber[i]?"":"px")},cur:function(){var e=R.propHooks[this.prop];return e&&e.get?e.get(this):R.propHooks._default.get(this)},run:function(e){var t,i=R.propHooks[this.prop];return this.options.duration?this.pos=t=he.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):R.propHooks._default.set(this),this}},R.prototype.init.prototype=R.prototype,R.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=he.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){he.fx.step[e.prop]?he.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[he.cssProps[e.prop]]&&!he.cssHooks[e.prop]?e.elem[e.prop]=e.now:he.style(e.elem,e.prop,e.now+e.unit)}}},R.propHooks.scrollTop=R.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},he.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},he.fx=R.prototype.init,he.fx.step={};var ct,ut,ht=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;he.Animation=he.extend(H,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);return p(i.elem,e,Ne.exec(t),i),i}]},tweener:function(e,t){he.isFunction(e)?(t=e,e=["*"]):e=e.match(xe);for(var i,n=0,o=e.length;n1)},removeAttr:function(e){return this.each(function(){he.removeAttr(this,e)})}}),he.extend({attr:function(e,t,i){var n,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return"undefined"==typeof e.getAttribute?he.prop(e,t,i):(1===s&&he.isXMLDoc(e)||(o=he.attrHooks[t.toLowerCase()]||(he.expr.match.bool.test(t)?_t:undefined)),i!==undefined?null===i?void he.removeAttr(e,t):o&&"set"in o&&(n=o.set(e,i,t))!==undefined?n:(e.setAttribute(t,i+""),i):o&&"get"in o&&null!==(n=o.get(e,t))?n:(n=he.find.attr(e,t),null==n?undefined:n))},attrHooks:{type:{set:function(e,t){if(!ce.radioValue&&"radio"===t&&he.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n=0,o=t&&t.match(xe);if(o&&1===e.nodeType)for(;i=o[n++];)e.removeAttribute(i)}}),_t={set:function(e,t,i){return!1===t?he.removeAttr(e,i):e.setAttribute(i,i),i}},he.each(he.expr.match.bool.source.match(/\w+/g),function(e,t){var i=ft[t]||he.find.attr;ft[t]=function(e,t,n){var o,s,a=t.toLowerCase();return n||(s=ft[a],ft[a]=o,o=null!=i(e,t,n)?a:null,ft[a]=s),o}});var mt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;he.fn.extend({prop:function(e,t){return De(this,he.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[he.propFix[e]||e]})}}),he.extend({prop:function(e,t,i){var n,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&he.isXMLDoc(e)||(t=he.propFix[t]||t,o=he.propHooks[t]),i!==undefined?o&&"set"in o&&(n=o.set(e,i,t))!==undefined?n:e[t]=i:o&&"get"in o&&null!==(n=o.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=he.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),ce.optSelected||(he.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),he.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){he.propFix[this.toLowerCase()]=this});var vt=/[\t\r\n\f]/g;he.fn.extend({addClass:function(e){var t,i,n,o,s,a,r,d=0;if(he.isFunction(e))return this.each(function(t){he(this).addClass(e.call(this,t,W(this)))});if("string"==typeof e&&e)for(t=e.match(xe)||[];i=this[d++];)if(o=W(i),n=1===i.nodeType&&(" "+o+" ").replace(vt," ")){for(a=0;s=t[a++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");r=he.trim(n),o!==r&&i.setAttribute("class",r)}return this},removeClass:function(e){var t,i,n,o,s,a,r,d=0;if(he.isFunction(e))return this.each(function(t){he(this).removeClass(e.call(this,t,W(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(xe)||[];i=this[d++];)if(o=W(i),n=1===i.nodeType&&(" "+o+" ").replace(vt," ")){for(a=0;s=t[a++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");r=he.trim(n),o!==r&&i.setAttribute("class",r)}return this},toggleClass:function(e,t){var i=typeof e;return"boolean"==typeof t&&"string"===i?t?this.addClass(e):this.removeClass(e):he.isFunction(e)?this.each(function(i){he(this).toggleClass(e.call(this,i,W(this),t),t)}):this.each(function(){var t,n,o,s;if("string"===i)for(n=0,o=he(this),s=e.match(xe)||[];t=s[n++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else e!==undefined&&"boolean"!==i||(t=W(this),t&&$e.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":$e.get(this,"__className__")||""))})},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&(" "+W(i)+" ").replace(vt," ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g,yt=/[\x20\t\r\n\f]+/g;he.fn.extend({val:function(e){var t,i,n,o=this[0];{if(arguments.length)return n=he.isFunction(e),this.each(function(i){var o;1===this.nodeType&&(o=n?e.call(this,i,he(this).val()):e,null==o?o="":"number"==typeof o?o+="":he.isArray(o)&&(o=he.map(o,function(e){return null==e?"":e+""})),(t=he.valHooks[this.type]||he.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&t.set(this,o,"value")!==undefined||(this.value=o))});if(o)return(t=he.valHooks[o.type]||he.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&(i=t.get(o,"value"))!==undefined?i:(i=o.value,"string"==typeof i?i.replace(bt,""):null==i?"":i)}}}),he.extend({valHooks:{option:{get:function(e){var t=he.find.attr(e,"value");return null!=t?t:he.trim(he.text(e)).replace(yt," ")}},select:{get:function(e){for(var t,i,n=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],r=s?o+1:n.length,d=o<0?r:s?o:0;d-1)&&(i=!0);return i||(e.selectedIndex=-1),s}}}}),he.each(["radio","checkbox"],function(){he.valHooks[this]={set:function(e,t){if(he.isArray(t))return e.checked=he.inArray(he(e).val(),t)>-1}},ce.checkOn||(he.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var wt=/^(?:focusinfocus|focusoutblur)$/;he.extend(he.event,{trigger:function(t,i,n,o){var s,a,r,d,l,c,u,h=[n||Z],p=re.call(t,"type")?t.type:t,_=re.call(t,"namespace")?t.namespace.split("."):[];if(a=r=n=n||Z,3!==n.nodeType&&8!==n.nodeType&&!wt.test(p+he.event.triggered)&&(p.indexOf(".")>-1&&(_=p.split("."),p=_.shift(),_.sort()),l=p.indexOf(":")<0&&"on"+p,t=t[he.expando]?t:new he.Event(p,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=_.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=n),i=null==i?[t]:he.makeArray(i,[t]),u=he.event.special[p]||{},o||!u.trigger||!1!==u.trigger.apply(n,i))){if(!o&&!u.noBubble&&!he.isWindow(n)){for(d=u.delegateType||p,wt.test(d+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),r=a;r===(n.ownerDocument||Z)&&h.push(r.defaultView||r.parentWindow||e)}for(s=0;(a=h[s++])&&!t.isPropagationStopped();)t.type=s>1?d:u.bindType||p,c=($e.get(a,"events")||{})[t.type]&&$e.get(a,"handle"),c&&c.apply(a,i),(c=l&&a[l])&&c.apply&&Ie(a)&&(t.result=c.apply(a,i),!1===t.result&&t.preventDefault());return t.type=p,o||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(h.pop(),i)||!Ie(n)||l&&he.isFunction(n[p])&&!he.isWindow(n)&&(r=n[l],r&&(n[l]=null),he.event.triggered=p,n[p](),he.event.triggered=undefined,r&&(n[l]=r)),t.result}},simulate:function(e,t,i){var n=he.extend(new he.Event,i,{type:e,isSimulated:!0});he.event.trigger(n,null,t)}}),he.fn.extend({trigger:function(e,t){return this.each(function(){he.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];if(i)return he.event.trigger(e,t,i,!0)}}),he.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){he.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}}),he.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ce.focusin="onfocusin"in e,ce.focusin||he.each({focus:"focusin",blur:"focusout"},function(e,t){var i=function(e){he.event.simulate(t,e.target,he.event.fix(e))};he.event.special[t]={setup:function(){var n=this.ownerDocument||this,o=$e.access(n,t);o||n.addEventListener(e,i,!0),$e.access(n,t,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=$e.access(n,t)-1;o?$e.access(n,t,o):(n.removeEventListener(e,i,!0),$e.remove(n,t))}}});var Et=e.location,Ct=he.now(),St=/\?/;he.parseXML=function(t){var i;if(!t||"string"!=typeof t)return null;try{i=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){i=undefined}return i&&!i.getElementsByTagName("parsererror").length||he.error("Invalid XML: "+t),i};var Tt=/\[\]$/,kt=/\r?\n/g,xt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;he.param=function(e,t){var i,n=[],o=function(e,t){var i=he.isFunction(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==i?"":i)};if(he.isArray(e)||e.jquery&&!he.isPlainObject(e))he.each(e,function(){o(this.name,this.value)});else for(i in e)G(i,e[i],t,o);return n.join("&")},he.fn.extend({serialize:function(){return he.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=he.prop(this,"elements");return e?he.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!he(this).is(":disabled")&&At.test(this.nodeName)&&!xt.test(e)&&(this.checked||!Ue.test(e))}).map(function(e,t){var i=he(this).val();return null==i?null:he.isArray(i)?he.map(i,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:i.replace(kt,"\r\n")}}).get()}});var Lt=/%20/g,Dt=/#.*$/,It=/([?&])_=[^&]*/,$t=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,jt=/^(?:GET|HEAD)$/,Mt=/^\/\//,Rt={},Nt={},Pt="*/".concat("*"),Bt=Z.createElement("a");Bt.href=Et.href,he.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:Ot.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":he.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?z(z(e,he.ajaxSettings),t):z(he.ajaxSettings,e)},ajaxPrefilter:V(Rt),ajaxTransport:V(Nt),ajax:function(t,i){function n(t,i,n,r){var l,h,p,y,w,E=i;c||(c=!0,d&&e.clearTimeout(d),o=undefined,a=r||"",C.readyState=t>0?4:0,l=t>=200&&t<300||304===t,n&&(y=K(_,C,n)),y=J(_,y,C,l),l?(_.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(he.lastModified[s]=w),(w=C.getResponseHeader("etag"))&&(he.etag[s]=w)),204===t||"HEAD"===_.type?E="nocontent":304===t?E="notmodified":(E=y.state,h=y.data,p=y.error,l=!p)):(p=E,!t&&E||(E="error",t<0&&(t=0))),C.status=t,C.statusText=(i||E)+"",l?g.resolveWith(f,[h,E,C]):g.rejectWith(f,[C,E,p]),C.statusCode(b),b=undefined,u&&m.trigger(l?"ajaxSuccess":"ajaxError",[C,_,l?h:p]),v.fireWith(f,[C,E]),u&&(m.trigger("ajaxComplete",[C,_]),--he.active||he.event.trigger("ajaxStop")))}"object"==typeof t&&(i=t,t=undefined),i=i||{};var o,s,a,r,d,l,c,u,h,p,_=he.ajaxSetup({},i),f=_.context||_,m=_.context&&(f.nodeType||f.jquery)?he(f):he.event,g=he.Deferred(),v=he.Callbacks("once memory"),b=_.statusCode||{},y={},w={},E="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(c){if(!r)for(r={};t=$t.exec(a);)r[t[1].toLowerCase()]=t[2];t=r[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,y[e]=t),this},overrideMimeType:function(e){return null==c&&(_.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)C.always(e[C.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||E;return o&&o.abort(t),n(0,t),this}};if(g.promise(C),_.url=((t||_.url||Et.href)+"").replace(Mt,Et.protocol+"//"),_.type=i.method||i.type||_.method||_.type,_.dataTypes=(_.dataType||"*").toLowerCase().match(xe)||[""],null==_.crossDomain){l=Z.createElement("a");try{l.href=_.url,l.href=l.href,_.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){_.crossDomain=!0}}if(_.data&&_.processData&&"string"!=typeof _.data&&(_.data=he.param(_.data,_.traditional)),Q(Rt,_,i,C),c)return C;u=he.event&&_.global,u&&0==he.active++&&he.event.trigger("ajaxStart"),_.type=_.type.toUpperCase(),_.hasContent=!jt.test(_.type),s=_.url.replace(Dt,""),_.hasContent?_.data&&_.processData&&0===(_.contentType||"").indexOf("application/x-www-form-urlencoded")&&(_.data=_.data.replace(Lt,"+")):(p=_.url.slice(s.length),_.data&&(s+=(St.test(s)?"&":"?")+_.data,delete _.data),!1===_.cache&&(s=s.replace(It,""),p=(St.test(s)?"&":"?")+"_="+Ct+++p),_.url=s+p),_.ifModified&&(he.lastModified[s]&&C.setRequestHeader("If-Modified-Since",he.lastModified[s]),he.etag[s]&&C.setRequestHeader("If-None-Match",he.etag[s])),(_.data&&_.hasContent&&!1!==_.contentType||i.contentType)&&C.setRequestHeader("Content-Type",_.contentType),C.setRequestHeader("Accept",_.dataTypes[0]&&_.accepts[_.dataTypes[0]]?_.accepts[_.dataTypes[0]]+("*"!==_.dataTypes[0]?", "+Pt+"; q=0.01":""):_.accepts["*"]);for(h in _.headers)C.setRequestHeader(h,_.headers[h]);if(_.beforeSend&&(!1===_.beforeSend.call(f,C,_)||c))return C.abort();if(E="abort",v.add(_.complete),C.done(_.success),C.fail(_.error),o=Q(Nt,_,i,C)){if(C.readyState=1,u&&m.trigger("ajaxSend",[C,_]),c)return C;_.async&&_.timeout>0&&(d=e.setTimeout(function(){C.abort("timeout")},_.timeout));try{c=!1,o.send(y,n)}catch(e){if(c)throw e;n(-1,e)}}else n(-1,"No Transport");return C},getJSON:function(e,t,i){return he.get(e,t,i,"json")},getScript:function(e,t){return he.get(e,undefined,t,"script")}}),he.each(["get","post"],function(e,t){he[t]=function(e,i,n,o){return he.isFunction(i)&&(o=o||n,n=i,i=undefined),he.ajax(he.extend({url:e,type:t,dataType:o,data:i,success:n},he.isPlainObject(e)&&e))}}),he._evalUrl=function(e){return he.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},he.fn.extend({wrapAll:function(e){var t;return this[0]&&(he.isFunction(e)&&(e=e.call(this[0])),t=he(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return he.isFunction(e)?this.each(function(t){he(this).wrapInner(e.call(this,t))}):this.each(function(){var t=he(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=he.isFunction(e);return this.each(function(i){he(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){he(this).replaceWith(this.childNodes)}),this}}),he.expr.pseudos.hidden=function(e){return!he.expr.pseudos.visible(e)},he.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},he.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ft={0:200,1223:204},qt=he.ajaxSettings.xhr();ce.cors=!!qt&&"withCredentials"in qt,ce.ajax=qt=!!qt,he.ajaxTransport(function(t){var i,n;if(ce.cors||qt&&!t.crossDomain)return{send:function(o,s){var a,r=t.xhr();if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)r[a]=t.xhrFields[a];t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)r.setRequestHeader(a,o[a]);i=function(e){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(Ft[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=i("error"),r.onabort!==undefined?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&e.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(t.hasContent&&t.data||null)}catch(e){if(i)throw e}},abort:function(){i&&i()}}}),he.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),he.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return he.globalEval(e),e}}}),he.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),he.ajaxTransport("script",function(e){if(e.crossDomain){var t,i;return{send:function(n,o){t=he("